From 49874d82eef018941e4ee0f8629c315590cbd0ab Mon Sep 17 00:00:00 2001
From: verou <857149855@qq.com>
Date: 星期五, 21 三月 2025 13:39:17 +0800
Subject: [PATCH] fix:逻辑分区id修改
---
rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx b/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
index 8436018..732710c 100644
--- a/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
+++ b/rsf-admin/src/page/basicInfo/matnrGroup/MatnrGroupList.jsx
@@ -39,15 +39,16 @@
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: 'name',
+ label: 'table.field.matnrGroup.name',
+ Width: 100,
},
{
id: 'parentId',
@@ -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', {
@@ -226,6 +227,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>
@@ -336,4 +354,4 @@
);
}
-export default MatnrGroupList;
+export default MatnrGroupList;
\ No newline at end of file
--
Gitblit v1.9.1