From ca4ae962c818cca7d3568621426ea686329e6f9b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 22 二月 2024 14:19:26 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/system/role/components/scope.jsx | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/zy-asrs-flow/src/pages/system/role/components/scope.jsx b/zy-asrs-flow/src/pages/system/role/components/scope.jsx
index 141f89f..253e6ac 100644
--- a/zy-asrs-flow/src/pages/system/role/components/scope.jsx
+++ b/zy-asrs-flow/src/pages/system/role/components/scope.jsx
@@ -2,8 +2,6 @@
import {
ProForm,
ProFormDigit,
- ProFormText,
- ProFormSelect,
} from '@ant-design/pro-components';
import { Col, Form, Modal, Row, Checkbox, Skeleton, Tree } from 'antd';
import Http from '@/utils/http';
@@ -23,9 +21,6 @@
setMenuTreeLoading(true);
Http.doPostPromise('/api/menu/tree', param, (res) => {
setMenuTreeLoading(false);
- const rootMenu = { id: 0, name: '鍏ㄩ儴', value: 0, children: [] };
- rootMenu.children = res.data;
- // const treeData = transformTreeData([rootMenu]);
const treeData = transformTreeData(res.data);
setMenuTreeData(treeData);
const treeAllKeys = getTreeAllKeys(treeData);
@@ -54,7 +49,8 @@
}
const handleFinish = async (values) => {
- props.onSubmit({ ...values });
+ console.log({ ...values, menuIds }); return
+ props.onSubmit({ ...values, menuIds });
}
return (
@@ -95,12 +91,12 @@
{ label: '鍏ㄩ��/鍏ㄤ笉閫�', value: 'checkAll' },
]}
onChange={(values) => {
- if(values.includes('expandAll')) {
+ if (values.includes('expandAll')) {
setMenuExpandedKeys(menuTreeAllKeys);
} else {
setMenuExpandedKeys([]);
}
- if(values.includes('checkAll')) {
+ if (values.includes('checkAll')) {
} else {
@@ -118,13 +114,14 @@
onExpand={(expandedKeys) => {
setMenuExpandedKeys(expandedKeys)
}}
- // checkedKeys={menuIds}
-
-
- // onCheck={(checkedKeys, checkInfo) => {
- // console.log(checkedKeys, checkInfo);
- // }}
- // defaultCheckedKeys={onSelect}
+ checkedKeys={menuIds}
+ onCheck={(checkedKeys, checkInfo) => {
+ return setMenuIds({
+ checked: checkedKeys,
+ halfChecked: checkInfo.halfCheckedKeys // 鐖惰妭鐐�
+ });
+ }}
+ // defaultCheckedKeys={onSelect}
/>
)}
</Col>
--
Gitblit v1.9.1