From 24bee1a669c3f01f4c3ce7c6f4f4e2e37fe3dfe2 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期六, 10 一月 2026 08:34:40 +0800
Subject: [PATCH] #application-dev

---
 rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx |   63 ++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx b/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
index 8436018..61e2d69 100644
--- a/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
+++ b/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
@@ -39,21 +39,22 @@
 const TITLE = 'menu.matnrGroup';
 
 const columns = [
-    {
-        id: 'name',
-        label: 'table.field.matnrGroup.name',
-        minWidth: 200,
-    },
+
     {
         id: 'code',
         label: 'table.field.matnrGroup.code',
         minWidth: 80,
     },
     {
-        id: 'parentId',
-        label: 'table.field.matnrGroup.parentId',
-        minWidth: 100,
-    }
+        id: 'name',
+        label: 'table.field.matnrGroup.name',
+        Width: 100,
+    },
+    // {
+    //     id: 'parCode',
+    //     label: 'table.field.matnrGroup.parCode',
+    //     minWidth: 100,
+    // }
 ];
 
 const getIconComponent = (iconStr) => {
@@ -160,7 +161,7 @@
     const [createDialog, setCreateDialog] = React.useState(false);
     const [editRecord, setEditRecord] = React.useState(null);
     const [openNodes, setOpenNodes] = React.useState({});
-    const [expandAll, setExpandAll] = React.useState(false);
+    const [expandAll, setExpandAll] = React.useState(true);
 
     const http = async () => {
         const res = await request.post(RESOURCE + '/tree', {
@@ -196,15 +197,16 @@
             deleteOne(
                 RESOURCE,
                 { id: node.id },
-                {
-                    onSuccess: () => {
-                        handleRefresh();
-                        notify('Department deleted successfully', { type: 'info', messageArgs: { _: 'Department deleted successfully' } });
-                    },
-                    onError: (error) => {
-                        notify(`Error: ${error.message}`, { type: 'warning', messageArgs: { _: `Error: ${error.message}` } });
-                    },
-                }
+                    {
+                        onSuccess: () => {
+                            handleRefresh();
+                            const msg = translate('ra.message.delete_success');
+                            notify(msg, { type: 'success', messageArgs: { _: msg } });
+                        },
+                        onError: (error) => {
+                            notify(`Error: ${error.message}`, { type: 'warning', messageArgs: { _: `Error: ${error.message}` } });
+                        },
+                    }
             );
         }
     };
@@ -226,6 +228,23 @@
             return newExpandAll;
         });
     };
+
+    // 鍒濆鍖� openNodes 浠ュ睍寮�鎵�鏈夎妭鐐�
+    React.useEffect(() => {
+        if (treeData) {
+            const newOpenNodes = {};
+            const updateOpenNodes = (nodes) => {
+                nodes.forEach(node => {
+                    newOpenNodes[node.id] = true;
+                    if (node.children) {
+                        updateOpenNodes(node.children);
+                    }
+                });
+            };
+            updateOpenNodes(treeData);
+            setOpenNodes(newOpenNodes);
+        }
+    }, [treeData]);
 
     return (
         <div>
@@ -250,8 +269,8 @@
                     >
                         {expandAll ? translate('common.action.collapseAll') : translate('common.action.expandAll')}
                     </Button>
-                    {/* <TextField
-                        label="Search"
+                    <TextField
+                        label="鎼滅储鍚嶇О"
                         value={filter}
                         onChange={({ target }) => {
                             setFilter(target.value)
@@ -260,7 +279,7 @@
                         size="small"
                         margin="dense"
                         fullWidth
-                    /> */}
+                    />
                 </Box>
                 <Box>
                     <Button

--
Gitblit v1.9.1