From 03c068e4128f8235ae2d4c1570e234d6ea661770 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 19 二月 2024 14:38:41 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/system/menu/index.jsx           |   20 ++--------
 zy-asrs-flow/src/pages/system/menu/components/edit.jsx |   54 ++++----------------------
 2 files changed, 13 insertions(+), 61 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/menu/components/edit.jsx b/zy-asrs-flow/src/pages/system/menu/components/edit.jsx
index 7c5dd94..4baf5fe 100644
--- a/zy-asrs-flow/src/pages/system/menu/components/edit.jsx
+++ b/zy-asrs-flow/src/pages/system/menu/components/edit.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useRef, useEffect } from 'react';
+import React, { useState, useRef, useEffect, useMemo } from 'react';
 import {
     ProForm,
     ProFormDigit,
@@ -11,6 +11,7 @@
 import Http from '@/utils/http';
 
 const Edit = (props) => {
+    const [menuType, setMenuType] = useState(0);
     const [form] = Form.useForm();
     const { } = props;
 
@@ -130,6 +131,12 @@
                                 { label: '鑿滃崟', value: 0 },
                                 { label: '鎸夐挳', value: 1 },
                             ]}
+                            fieldProps={{
+                                defaultValue: 0,
+                                onChange: (e) => {
+                                    setMenuType(e);
+                                },
+                            }}
                         />
                     </ProForm.Group>
                     <ProForm.Group>
@@ -142,6 +149,7 @@
                         <ProFormText
                             name="icon"
                             label="鑿滃崟鍥炬爣"
+                            hidden={menuType !== 0}
                             colProps={{ md: 12, xl: 12 }}
                             placeholder="璇疯緭鍏�"
                         />
@@ -171,50 +179,6 @@
                                 { label: '姝e父', value: 1 },
                                 { label: '绂佺敤', value: 0 },
                             ]}
-                        />
-                        <ProFormDateTimePicker
-                            name="createTime"
-                            label="娣诲姞鏃堕棿"
-                            colProps={{ md: 12, xl: 12 }}
-                            placeholder="璇烽�夋嫨"
-                            transform={(value) => moment(value).toISOString()}
-                        />
-                    </ProForm.Group>
-                    <ProForm.Group>
-                        <ProFormSelect
-                            name="createBy"
-                            label="娣诲姞浜哄憳"
-                            colProps={{ md: 12, xl: 12 }}
-                            fieldProps={{ precision: 0 }}
-                            placeholder="璇烽�夋嫨"
-                            showSearch
-                            debounceTime={300}
-                            request={async ({ keyWords }) => {
-                                const resp = await Http.doPostForm('api/user/query', { condition: keyWords });
-                            return resp.data;
-                            }}
-                        />
-                        <ProFormDateTimePicker
-                            name="updateTime"
-                            label="淇敼鏃堕棿"
-                            colProps={{ md: 12, xl: 12 }}
-                            placeholder="璇烽�夋嫨"
-                            transform={(value) => moment(value).toISOString()}
-                        />
-                    </ProForm.Group>
-                    <ProForm.Group>
-                        <ProFormSelect
-                            name="updateBy"
-                            label="淇敼浜哄憳"
-                            colProps={{ md: 12, xl: 12 }}
-                            fieldProps={{ precision: 0 }}
-                            placeholder="璇烽�夋嫨"
-                            showSearch
-                            debounceTime={300}
-                            request={async ({ keyWords }) => {
-                                const resp = await Http.doPostForm('api/user/query', { condition: keyWords });
-                            return resp.data;
-                            }}
                         />
                     </ProForm.Group>
 
diff --git a/zy-asrs-flow/src/pages/system/menu/index.jsx b/zy-asrs-flow/src/pages/system/menu/index.jsx
index 50891f7..bb9d2e4 100644
--- a/zy-asrs-flow/src/pages/system/menu/index.jsx
+++ b/zy-asrs-flow/src/pages/system/menu/index.jsx
@@ -290,8 +290,7 @@
             hidden: false,
             width: 100,
             render: (_, record) => {
-                console.log(_);
-                return <span style={{ fontWeight: "bold" }}>{_}</span>
+                return <span st yle={{ fontWeight: "bold" }}>{_}</span>
             }
         },
         {
@@ -492,18 +491,7 @@
                     }}
                     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);
-
+                            setTreeData(res.data)
                             return {
                                 data: res.data,
                                 success: true,
@@ -562,6 +550,7 @@
             <Edit
                 open={modalVisible}
                 values={currentRow || {}}
+                treeData = {treeData}
                 onCancel={
                     () => {
                         setModalVisible(false);
@@ -582,8 +571,7 @@
                             actionRef.current.reload();
                         }
                     }
-                }
-                }
+                }}
             />
         </PageContainer>
     );

--
Gitblit v1.9.1