|
@@ -1,17 +1,70 @@
|
|
|
-import React from 'react'
|
|
|
|
|
-import { ModalForm, ProFormText } from '@ant-design/pro-form'
|
|
|
|
|
|
|
+import React, { useState, useEffect } from 'react'
|
|
|
|
|
+import { Button } from 'antd'
|
|
|
|
|
+import { PlusOutlined } from '@ant-design/icons'
|
|
|
|
|
+import consts from '@/consts'
|
|
|
|
|
+import { getDepartMentList } from '@/services/department'
|
|
|
|
|
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'
|
|
|
|
|
|
|
|
-const RoleMenu = () => {
|
|
|
|
|
|
|
+const RoleMenu = props => {
|
|
|
|
|
+ const [state, setState] = useState({
|
|
|
|
|
+ data: []
|
|
|
|
|
+ })
|
|
|
|
|
+ const initData = async id => {
|
|
|
|
|
+ setState({ ...state, loading: true })
|
|
|
|
|
+ const {
|
|
|
|
|
+ data: { data = [] },
|
|
|
|
|
+ code = -1
|
|
|
|
|
+ } = await getDepartMentList(id)
|
|
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
+ setState({ ...state, data })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ initData()
|
|
|
|
|
+ }, [])
|
|
|
return (
|
|
return (
|
|
|
<div className="h-full w-max-234px rounded-4px roleMenu">
|
|
<div className="h-full w-max-234px rounded-4px roleMenu">
|
|
|
<div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] flex justify-around items-center">
|
|
<div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] flex justify-around items-center">
|
|
|
<span className="text-[0.9375rem]">组织架构</span>
|
|
<span className="text-[0.9375rem]">组织架构</span>
|
|
|
|
|
+ <ModalForm
|
|
|
|
|
+ title="创建部门"
|
|
|
|
|
+ width="500px"
|
|
|
|
|
+ trigger={
|
|
|
|
|
+ <Button size="small" type="primary" ghost>
|
|
|
|
|
+ <PlusOutlined />
|
|
|
|
|
+ 创建部门
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ }>
|
|
|
|
|
+ <ProFormText name="backstageMenuId" hidden />
|
|
|
|
|
+ <ProFormText name="name" label="新增部门" rules={[{ message: '请输入部门名称' }]} />
|
|
|
|
|
+ <ProFormSelect
|
|
|
|
|
+ width="md"
|
|
|
|
|
+ options={[
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 'time',
|
|
|
|
|
+ label: '总部'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 'timea',
|
|
|
|
|
+ label: '研究中心'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]}
|
|
|
|
|
+ name="unusedMode"
|
|
|
|
|
+ label="上级部门"
|
|
|
|
|
+ />
|
|
|
|
|
+ </ModalForm>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="p-4 bg-white" style={{ height: 'calc(100% - 1rem*2 - 20px)' }}>
|
|
<div className="p-4 bg-white" style={{ height: 'calc(100% - 1rem*2 - 20px)' }}>
|
|
|
- <div className="p-0 m-0 list-none text-primary flex flex-col flex-1">dads</div>
|
|
|
|
|
|
|
+ <ul className="p-0 m-0 list-none text-primary flex flex-col flex-1">
|
|
|
|
|
+ <li>全公司</li>
|
|
|
|
|
+ </ul>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default RoleMenu
|
|
export default RoleMenu
|
|
|
|
|
+// export default connect(({ staff }) => ({
|
|
|
|
|
+// departments: staff.departments
|
|
|
|
|
+// }))(RoleMenu)
|