From dca78d5fd0c67fd841d6841ef2cd94a10669c356 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 21 二月 2024 15:40:48 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/system/menu/index.jsx |   39 ++++++++++++---------------------------
 1 files changed, 12 insertions(+), 27 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/menu/index.jsx b/zy-asrs-flow/src/pages/system/menu/index.jsx
index 50891f7..d2ad362 100644
--- a/zy-asrs-flow/src/pages/system/menu/index.jsx
+++ b/zy-asrs-flow/src/pages/system/menu/index.jsx
@@ -11,18 +11,9 @@
 import Http from '@/utils/http';
 import Edit from './components/edit'
 import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
-import { buildTreeData } from '@/utils/tree-util'
-
-const statusMap = {
-    1: {
-        color: 'green',
-        text: '姝e父',
-    },
-    0: {
-        color: 'red',
-        text: '绂佺敤',
-    },
-};
+import { transformTreeData } from '@/utils/tree-util'
+import { createIcon } from '@/utils/icon-util'
+import { statusMap } from '@/utils/enum-util'
 
 const typeMap = {
     0: {
@@ -282,6 +273,9 @@
             valueType: 'text',
             hidden: false,
             width: 140,
+            render: (_, record) => {
+                return createIcon(_);
+            }
         },
         {
             title: '鎺掑簭',
@@ -290,7 +284,6 @@
             hidden: false,
             width: 100,
             render: (_, record) => {
-                console.log(_);
                 return <span style={{ fontWeight: "bold" }}>{_}</span>
             }
         },
@@ -492,18 +485,10 @@
                     }}
                     request={(params, sorter, filter) =>
                         Http.doPostPromise('/api/menu/tree', { ...params, ...searchParam }, (res) => {
-                            console.log(res.data);
-                            // console.log(res); return;
-                            // const records = res.data.records;
-                            // console.log(records);
-
-                            // const rootMenu = { id: 0, label: '涓荤被鐩�', children: [], value: 0 };
-                            // const memuData = buildTreeData(records, 'menuId', 'menuName', '', '', '');
-                            // rootMenu.children = memuData;
-                            // const treeData = [];
-                            // treeData.push(rootMenu);
-                            // setTreeData(treeData);
-
+                            const rootMenu = { id: 0, name: '鏍圭洰褰�', value: 0, children: [] };
+                            rootMenu.children = res.data;
+                            const treeData = transformTreeData([rootMenu]);
+                            setTreeData(treeData);
                             return {
                                 data: res.data,
                                 success: true,
@@ -562,6 +547,7 @@
             <Edit
                 open={modalVisible}
                 values={currentRow || {}}
+                treeData={treeData}
                 onCancel={
                     () => {
                         setModalVisible(false);
@@ -582,8 +568,7 @@
                             actionRef.current.reload();
                         }
                     }
-                }
-                }
+                }}
             />
         </PageContainer>
     );

--
Gitblit v1.9.1