|
@@ -6,7 +6,7 @@ import { useRequest } from 'umi'
|
|
|
import { DeleteOutlined } from '@ant-design/icons'
|
|
|
import {
|
|
|
queryOrganizationalStructureList,
|
|
|
- moveOrganizationalStructure
|
|
|
+ moveSortOrganizationalStructure
|
|
|
} from '@/services/api/institution'
|
|
|
import OrganizationModal, { ModalType } from './OrganizationModal'
|
|
|
|
|
@@ -22,7 +22,9 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
currentModalType: ModalType.ADD,
|
|
|
defaultFormData: null,
|
|
|
parentID: '',
|
|
|
- typeEum: '1'
|
|
|
+ typeEum: '1',
|
|
|
+ up: 'up',
|
|
|
+ down: 'down'
|
|
|
})
|
|
|
const titleType = {
|
|
|
ADD: 1,
|
|
@@ -42,7 +44,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
}
|
|
|
)
|
|
|
|
|
|
- const { run: tryMoveOrganization } = useRequest(moveOrganizationalStructure, {
|
|
|
+ const { run: tryMoveOrganization } = useRequest(moveSortOrganizationalStructure, {
|
|
|
manual: true,
|
|
|
onSuccess: () => {
|
|
|
tryOrganizationList()
|
|
@@ -73,7 +75,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
title="确认上移吗?"
|
|
|
okText="确认"
|
|
|
cancelText="取消"
|
|
|
- onConfirm={() => tryMoveOrganization({ ID: record.ID, moveID: record.parentID })}>
|
|
|
+ onConfirm={() => tryMoveOrganization({ ID: record.ID, operation: state.up })}>
|
|
|
上移
|
|
|
</Popconfirm>
|
|
|
</div>
|
|
@@ -84,11 +86,26 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
title="确认下移吗?"
|
|
|
okText="确认"
|
|
|
cancelText="取消"
|
|
|
- onConfirm={() => tryMoveOrganization({ ID: record.parentID, moveID: record.ID })}>
|
|
|
+ onConfirm={() => tryMoveOrganization({ ID: record.ID, operation: state.down })}>
|
|
|
下移
|
|
|
</Popconfirm>
|
|
|
</div>
|
|
|
) : null}
|
|
|
+ {record.isLeaf === true ? (
|
|
|
+ <div
|
|
|
+ className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
+ onClick={() => {
|
|
|
+ setState({
|
|
|
+ ...state,
|
|
|
+ visible: true,
|
|
|
+ currentModalType: ModalType.MOVE,
|
|
|
+ defaultFormData: record,
|
|
|
+ typeEum: titleType.MOVE
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ 移动
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
<div
|
|
|
className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
onClick={() => {
|
|
@@ -107,19 +124,6 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
}}>
|
|
|
添加子项
|
|
|
</div>
|
|
|
- {/* <div
|
|
|
- className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
- onClick={() => {
|
|
|
- setState({
|
|
|
- ...state,
|
|
|
- visible: true,
|
|
|
- currentModalType: ModalType.MOVE,
|
|
|
- defaultFormData: record,
|
|
|
- typeEum: titleType.MOVE
|
|
|
- })
|
|
|
- }}>
|
|
|
- 移动
|
|
|
- </div> */}
|
|
|
<div
|
|
|
className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
onClick={() => {
|