#
luxiaotao1123
2024-02-28 f93a5719f77508aae2eb45eaa7e68bd447d607e2
zy-asrs-flow/src/pages/system/role/components/scope.jsx
@@ -3,6 +3,7 @@
    ProForm,
    ProFormDigit,
} from '@ant-design/pro-components';
import { DownOutlined } from '@ant-design/icons';
import { Col, Form, Modal, Row, Checkbox, Skeleton, Tree, Drawer, Space, Button, Card } from 'antd';
import Http from '@/utils/http';
import { transformTreeData, getTreeAllKeys } from '@/utils/tree-util'
@@ -51,14 +52,13 @@
    }
    const handleFinish = async (values) => {
        console.log({ ...values, menuIds }); return
        props.onSubmit({ ...values, menuIds });
    }
    return (
        <>
            <Drawer
                title={`${name}`}
                title={`分配权限 - ${name ? name : '-'}`}
                width={640}
                forceRender
                destroyOnClose
@@ -94,10 +94,9 @@
                        <ProForm.Item
                            name="deptIds"
                            label="菜单权限"
                            label="权限菜单"
                            colProps={{ md: 24, xl: 24 }}
                        >
                            <Row gutter={[16, 16]}>
                                <Col md={24}>
                                    <Checkbox.Group
@@ -113,9 +112,9 @@
                                                setMenuExpandedKeys([]);
                                            }
                                            if (values.includes('checkAll')) {
                                                setMenuIds(menuTreeAllKeys)
                                            } else {
                                                setMenuIds([]);
                                            }
                                        }} />
                                </Col>
@@ -124,7 +123,10 @@
                                        <Skeleton active />
                                    ) : (
                                        <Tree
                                            showLine
                                            blockNode
                                            checkable
                                            switcherIcon={<DownOutlined />}
                                            treeData={menuTreeData}
                                            expandedKeys={menuExpandedKeys}
                                            onExpand={(expandedKeys) => {
@@ -137,12 +139,10 @@
                                                    halfChecked: checkInfo.halfCheckedKeys  // 父节点
                                                });
                                            }}
                                        // defaultCheckedKeys={onSelect}
                                        />
                                    )}
                                </Col>
                            </Row>
                        </ProForm.Item>
                    </ProForm>
                </Card>