|
@@ -8,8 +8,6 @@ import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'
|
|
|
|
|
|
|
|
const RoleMenu = props => {
|
|
const RoleMenu = props => {
|
|
|
const { dispatch, departments = [] } = props
|
|
const { dispatch, departments = [] } = props
|
|
|
- // eslint-disable-next-line no-unused-vars
|
|
|
|
|
- const [activeId, setActiveId] = useState('')
|
|
|
|
|
const { DirectoryTree } = Tree
|
|
const { DirectoryTree } = Tree
|
|
|
|
|
|
|
|
const initData = () => {
|
|
const initData = () => {
|
|
@@ -32,13 +30,14 @@ const RoleMenu = props => {
|
|
|
}
|
|
}
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
- const onSelect = (keys, info) => {
|
|
|
|
|
- console.log('Trigger Select', keys, info)
|
|
|
|
|
|
|
+ const saveActiveId = keys => {
|
|
|
|
|
+ // console.log(keys)
|
|
|
|
|
+ if (saveActiveId) {
|
|
|
|
|
+ saveActiveId(keys)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const onExpand = () => {
|
|
|
|
|
- console.log('Trigger Expand')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const onExpand = () => {}
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="h-full w-max-234px rounded-4px roleMenu">
|
|
<div className="h-full w-max-234px rounded-4px roleMenu">
|
|
@@ -73,28 +72,12 @@ const RoleMenu = props => {
|
|
|
<DirectoryTree
|
|
<DirectoryTree
|
|
|
multiple
|
|
multiple
|
|
|
defaultExpandAll
|
|
defaultExpandAll
|
|
|
- onSelect={onSelect}
|
|
|
|
|
|
|
+ onSelect={saveActiveId}
|
|
|
onExpand={onExpand}
|
|
onExpand={onExpand}
|
|
|
|
|
+ showIcon={false}
|
|
|
treeData={departments}
|
|
treeData={departments}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
- {/* <DirectoryTree
|
|
|
|
|
- multiple
|
|
|
|
|
- defaultExpandAll
|
|
|
|
|
- onSelect={onSelect}
|
|
|
|
|
- onExpand={onExpand}
|
|
|
|
|
- treeData={departments}
|
|
|
|
|
- /> */}
|
|
|
|
|
- {/* <ul className="p-0 m-0 list-none text-primary flex flex-col flex-1">
|
|
|
|
|
- {departments.map(item => (
|
|
|
|
|
- <li
|
|
|
|
|
- key={item.id}
|
|
|
|
|
- className="flex justify-between items-center py-2 px-5 cursor-pointer"
|
|
|
|
|
- onClick={() => setActiveId(item.id)}>
|
|
|
|
|
- <span>{item.name}</span>
|
|
|
|
|
- </li>
|
|
|
|
|
- ))}
|
|
|
|
|
- </ul> */}
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|