| | |
| | | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { Button, message, Modal, Row, Col, Card, Tree, Input, Tag } from 'antd'; |
| | | import { Button, message, Modal, Row, Col, Card, Tree, Input, Tag, Skeleton } from 'antd'; |
| | | import { |
| | | FooterToolbar, |
| | | PageContainer, |
| | |
| | | const [modalVisible, setModalVisible] = useState(false); |
| | | const [currentRow, setCurrentRow] = useState(); |
| | | const [searchParam, setSearchParam] = useState({}); |
| | | |
| | | const [boxHeight, setBoxHeight] = useState(); |
| | | const [deptTreeLoading, setDeptTreeLoading] = useState(false); |
| | | const [deptTreeData, setDeptTreeData] = useState([]); |
| | | const [deptExpandedKeys, setDeptExpandedKeys] = useState([]); |
| | | |
| | | const [pwdModalVisible, setPwdModalVisible] = useState(false); |
| | | |
| | | const loadDeptTreeData = (param) => { |
| | | setDeptTreeLoading(true); |
| | | Http.doPostPromise('/api/dept/tree', param, (res) => { |
| | | setDeptTreeLoading(false); |
| | | const rootMenu = { id: 0, name: '全部', value: 0, children: [] }; |
| | | rootMenu.children = res.data; |
| | | // const treeData = transformTreeData([rootMenu]); |
| | |
| | | setDeptTreeData(treeData); |
| | | const treeAllKeys = getTreeAllKeys(treeData); |
| | | setDeptExpandedKeys(treeAllKeys); |
| | | }).catch((err) => { |
| | | setDeptTreeLoading(false); |
| | | }) |
| | | } |
| | | |
| | |
| | | }} |
| | | /> |
| | | <div style={{height: 'calc(100vh - 350px)', overflowY: 'auto' }}> |
| | | {deptTreeLoading ? ( |
| | | <Skeleton active /> |
| | | ) : ( |
| | | <Tree |
| | | showLine |
| | | blockNode |
| | |
| | | actionRef.current?.reload(); |
| | | }} |
| | | /> |
| | | )} |
| | | </div> |
| | | </Card> |
| | | </Col> |