|
@@ -9,7 +9,7 @@ import './index.less'
|
|
|
const { DirectoryTree } = Tree
|
|
const { DirectoryTree } = Tree
|
|
|
|
|
|
|
|
const RoleMenu = props => {
|
|
const RoleMenu = props => {
|
|
|
- const { dispatch, departments = [], onSelect, showType } = props
|
|
|
|
|
|
|
+ const { dispatch, departments = [], onSelect } = props
|
|
|
const hasPerm = useAccess()?.validatePermByType('employee_del_department')
|
|
const hasPerm = useAccess()?.validatePermByType('employee_del_department')
|
|
|
const newList = [...departments]
|
|
const newList = [...departments]
|
|
|
newList.unshift({
|
|
newList.unshift({
|
|
@@ -44,15 +44,13 @@ const RoleMenu = props => {
|
|
|
<div className="department-node">
|
|
<div className="department-node">
|
|
|
<div>{item.title}</div>
|
|
<div>{item.title}</div>
|
|
|
<div className="extra">
|
|
<div className="extra">
|
|
|
- {showType ? (
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title="确认删除吗?"
|
|
|
|
|
- onText="确认"
|
|
|
|
|
- cancelText="取消"
|
|
|
|
|
- onConfirm={() => handleDelDepartment(item.id)}>
|
|
|
|
|
- <DeleteOutlined />
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- ) : null}
|
|
|
|
|
|
|
+ <Popconfirm
|
|
|
|
|
+ title="确认删除吗?"
|
|
|
|
|
+ onText="确认"
|
|
|
|
|
+ cancelText="取消"
|
|
|
|
|
+ onConfirm={() => handleDelDepartment(item.id)}>
|
|
|
|
|
+ <DeleteOutlined />
|
|
|
|
|
+ </Popconfirm>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
@@ -92,7 +90,7 @@ const RoleMenu = props => {
|
|
|
}}>
|
|
}}>
|
|
|
<div className="p-4 pb-3 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] flex justify-around items-center">
|
|
<div className="p-4 pb-3 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>
|
|
|
- {hasPerm && showType ? (
|
|
|
|
|
|
|
+ {hasPerm && (
|
|
|
<ModalForm
|
|
<ModalForm
|
|
|
title="创建部门"
|
|
title="创建部门"
|
|
|
width="500px"
|
|
width="500px"
|
|
@@ -119,7 +117,7 @@ const RoleMenu = props => {
|
|
|
/>
|
|
/>
|
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
</ModalForm>
|
|
</ModalForm>
|
|
|
- ) : null}
|
|
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
<div className="py-4 pt-4 bg-white" style={{ height: 'calc(100% - 1rem*2 - 21px)' }}>
|
|
<div className="py-4 pt-4 bg-white" style={{ height: 'calc(100% - 1rem*2 - 21px)' }}>
|
|
|
{departments.length ? (
|
|
{departments.length ? (
|