#
luxiaotao1123
2024-02-22 aca3aaca9e11095f2b819e09deceec7b47749c04
#
1个文件已修改
30 ■■■■ 已修改文件
zy-asrs-flow/src/pages/system/role/components/scope.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/system/role/components/scope.jsx
@@ -3,13 +3,13 @@
    ProForm,
    ProFormDigit,
} from '@ant-design/pro-components';
import { Col, Form, Modal, Row, Checkbox, Skeleton, Tree } from 'antd';
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'
const Scope = (props) => {
    const [form] = Form.useForm();
    const { originMenuIds } = props;
    const { originMenuIds, values: { name } } = props;
    const [menuTreeLoading, setMenuTreeLoading] = useState(false);
    const [menuTreeData, setMenuTreeData] = useState([]);
    const [menuExpandedKeys, setMenuExpandedKeys] = useState([]);
@@ -25,6 +25,7 @@
            setMenuTreeData(treeData);
            const treeAllKeys = getTreeAllKeys(treeData);
            setMenuTreeAllKeys(treeAllKeys);
            setMenuExpandedKeys(treeAllKeys);
        }).catch((err) => {
            console.error(err);
            setMenuTreeLoading(false);
@@ -56,15 +57,28 @@
    return (
        <>
            <Modal
                title="Scope"
            <Drawer
                title={`${name}`}
                width={640}
                forceRender
                destroyOnClose
                open={props.open}
                onCancel={handleCancel}
                onOk={handleOk}
                onClose={handleCancel}
                styles={{
                    body: {
                        paddingBottom: 80,
                    },
                }}
                extra={
                    <Space>
                        <Button onClick={handleCancel}>Cancel</Button>
                        <Button onClick={handleOk} type="primary">
                            Submit
                        </Button>
                    </Space>
                }
            >
                <Card>
                <ProForm
                    form={form}
                    submitter={false}
@@ -91,6 +105,7 @@
                                        { label: '展开/折叠', value: 'expandAll' },
                                        { label: '全选/全不选', value: 'checkAll' },
                                    ]}
                                        defaultValue={['expandAll']}
                                    onChange={(values) => {
                                        if (values.includes('expandAll')) {
                                            setMenuExpandedKeys(menuTreeAllKeys);
@@ -130,7 +145,8 @@
                    </ProForm.Item>
                </ProForm>
            </Modal>
                </Card>
            </Drawer>
        </>
    )
}