| | |
| | | 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' |
| | |
| | | } |
| | | |
| | | const handleFinish = async (values) => { |
| | | console.log({ ...values, menuIds }); return |
| | | props.onSubmit({ ...values, menuIds }); |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Drawer |
| | | title={`分配权限 - ${name?name:'-'}`} |
| | | title={`分配权限 - ${name ? name : '-'}`} |
| | | width={640} |
| | | forceRender |
| | | destroyOnClose |
| | |
| | | |
| | | <ProForm.Item |
| | | name="deptIds" |
| | | label="菜单权限" |
| | | label="权限菜单" |
| | | colProps={{ md: 24, xl: 24 }} |
| | | > |
| | | |
| | | <Row gutter={[16, 16]}> |
| | | <Col md={24}> |
| | | <Checkbox.Group |
| | |
| | | setMenuExpandedKeys([]); |
| | | } |
| | | if (values.includes('checkAll')) { |
| | | |
| | | setMenuIds(menuTreeAllKeys) |
| | | } else { |
| | | |
| | | setMenuIds([]); |
| | | } |
| | | }} /> |
| | | </Col> |
| | |
| | | <Skeleton active /> |
| | | ) : ( |
| | | <Tree |
| | | showLine |
| | | blockNode |
| | | checkable |
| | | switcherIcon={<DownOutlined />} |
| | | treeData={menuTreeData} |
| | | expandedKeys={menuExpandedKeys} |
| | | onExpand={(expandedKeys) => { |
| | |
| | | halfChecked: checkInfo.halfCheckedKeys // 父节点 |
| | | }); |
| | | }} |
| | | // defaultCheckedKeys={onSelect} |
| | | /> |
| | | )} |
| | | </Col> |
| | | </Row> |
| | | |
| | | </ProForm.Item> |
| | | </ProForm> |
| | | </Card> |