From a97422cbeb0fd95d664f185d39154d9a57dabd43 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 21 二月 2024 11:02:04 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/system/menu/index.jsx |   12 +-----------
 zy-asrs-flow/src/utils/enum-util.js          |   10 ++++++++++
 zy-asrs-flow/src/pages/system/dept/index.jsx |   12 +-----------
 zy-asrs-flow/src/pages/system/user/index.jsx |   14 +++++++++++++-
 4 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/dept/index.jsx b/zy-asrs-flow/src/pages/system/dept/index.jsx
index 50c1c3a..6b689dc 100644
--- a/zy-asrs-flow/src/pages/system/dept/index.jsx
+++ b/zy-asrs-flow/src/pages/system/dept/index.jsx
@@ -12,17 +12,7 @@
 import Edit from './components/edit'
 import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
 import { transformTreeData } from '@/utils/tree-util'
-
-const statusMap = {
-    1: {
-        color: 'green',
-        text: '姝e父',
-    },
-    0: {
-        color: 'red',
-        text: '绂佺敤',
-    },
-};
+import { statusMap } from '@/utils/enum-util'
 
 const handleSave = async (val) => {
     const hide = message.loading('姝e湪娣诲姞');
diff --git a/zy-asrs-flow/src/pages/system/menu/index.jsx b/zy-asrs-flow/src/pages/system/menu/index.jsx
index 0e854cc..d2ad362 100644
--- a/zy-asrs-flow/src/pages/system/menu/index.jsx
+++ b/zy-asrs-flow/src/pages/system/menu/index.jsx
@@ -13,17 +13,7 @@
 import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
 import { transformTreeData } from '@/utils/tree-util'
 import { createIcon } from '@/utils/icon-util'
-
-const statusMap = {
-    1: {
-        color: 'green',
-        text: '姝e父',
-    },
-    0: {
-        color: 'red',
-        text: '绂佺敤',
-    },
-};
+import { statusMap } from '@/utils/enum-util'
 
 const typeMap = {
     0: {
diff --git a/zy-asrs-flow/src/pages/system/user/index.jsx b/zy-asrs-flow/src/pages/system/user/index.jsx
index 5734465..a5c0d6a 100644
--- a/zy-asrs-flow/src/pages/system/user/index.jsx
+++ b/zy-asrs-flow/src/pages/system/user/index.jsx
@@ -1,6 +1,6 @@
 
 import React, { useState, useRef, useEffect } from 'react';
-import { Button, message, Modal, Row, Col, Card, Tree, Input } from 'antd';
+import { Button, message, Modal, Row, Col, Card, Tree, Input, Tag } from 'antd';
 import {
     FooterToolbar,
     PageContainer,
@@ -12,6 +12,7 @@
 import Edit from './components/edit'
 import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
 import { transformTreeData, getTreeAllKeys } from '@/utils/tree-util'
+import { statusMap } from '@/utils/enum-util'
 
 const handleSave = async (val) => {
     const hide = message.loading('姝e湪娣诲姞');
@@ -256,6 +257,13 @@
             valueType: 'text',
             hidden: false,
             width: 100,
+            render: (_, record) => {
+                if (_ && _ !== '-') {
+                    return <Tag color={""}>{_}</Tag>
+                } else {
+                    return '-'
+                }
+            },
             filterDropdown: (props) => <LinkFilter
                 name='deptId'
                 major='dept'
@@ -322,6 +330,10 @@
             valueType: 'text',
             hidden: false,
             width: 80,
+            render: (_, record) => {
+                const status = statusMap[record.status]
+                return <Tag color={status.color}>{status.text}</Tag>
+            },
             filterDropdown: (props) => <SelectFilter
                 name='status'
                 {...props}
diff --git a/zy-asrs-flow/src/utils/enum-util.js b/zy-asrs-flow/src/utils/enum-util.js
new file mode 100644
index 0000000..eb2401e
--- /dev/null
+++ b/zy-asrs-flow/src/utils/enum-util.js
@@ -0,0 +1,10 @@
+export const statusMap = {
+    1: {
+        color: 'green',
+        text: '姝e父',
+    },
+    0: {
+        color: 'red',
+        text: '绂佺敤',
+    },
+};
\ No newline at end of file

--
Gitblit v1.9.1