#
luxiaotao1123
2024-02-22 ca4ae962c818cca7d3568621426ea686329e6f9b
#
1个文件已修改
27 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/system/role/components/scope.jsx 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>