|
@@ -16,20 +16,20 @@ import {
|
|
|
moveSortOrganizationalStructure
|
|
|
} from '@/services/api/institution'
|
|
|
import OrganizationModal from './OrganizationModal'
|
|
|
-import { ModalType } from '@/utils/enum'
|
|
|
+// import { ModalType } from '@/utils/enum'
|
|
|
|
|
|
type OrganizationProps = {
|
|
|
dataID: string
|
|
|
structureType: string
|
|
|
}
|
|
|
|
|
|
-// export enum OrganizationModalEnum {
|
|
|
-// ADD = 1,
|
|
|
-// ADDITEM = 2,
|
|
|
-// RENAME = 3,
|
|
|
-// DEL = 4,
|
|
|
-// MOVE = 5
|
|
|
-// }
|
|
|
+export enum ModalTypeEnum {
|
|
|
+ ADD = 1,
|
|
|
+ ADDITEM = 2,
|
|
|
+ UPDATE = 3,
|
|
|
+ DEL = 4,
|
|
|
+ MOVE = 5
|
|
|
+}
|
|
|
|
|
|
const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) => {
|
|
|
const tRef = useRef<ActionType>(null)
|
|
@@ -39,8 +39,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
expandTreeIds: [],
|
|
|
defaultFormData: null,
|
|
|
parentID: '',
|
|
|
- currentModalType: ModalType.ADD,
|
|
|
- typeEum: '1',
|
|
|
+ currentModalType: ModalTypeEnum.ADD,
|
|
|
accountTotal: null
|
|
|
})
|
|
|
|
|
@@ -128,8 +127,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
...state,
|
|
|
visible: true,
|
|
|
defaultFormData: record,
|
|
|
- currentModalType: ModalType.MOVE,
|
|
|
- typeEum: ModalType.MOVE
|
|
|
+ currentModalType: ModalTypeEnum.MOVE
|
|
|
})
|
|
|
}}>
|
|
|
<Tooltip placement="top" title="移动">
|
|
@@ -149,8 +147,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
structureType: structureType,
|
|
|
parentID: record.ID
|
|
|
},
|
|
|
- currentModalType: ModalType.ADD,
|
|
|
- typeEum: ModalType.ADDITEM
|
|
|
+ currentModalType: ModalTypeEnum.ADDITEM
|
|
|
})
|
|
|
}}>
|
|
|
<Tooltip placement="top" title="添加子项">
|
|
@@ -164,8 +161,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
...state,
|
|
|
visible: true,
|
|
|
defaultFormData: record,
|
|
|
- currentModalType: ModalType.UPDATE,
|
|
|
- typeEum: ModalType.UPDATE
|
|
|
+ currentModalType: ModalTypeEnum.UPDATE
|
|
|
})
|
|
|
}}>
|
|
|
<Tooltip placement="top" title="重命名">
|
|
@@ -181,8 +177,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
...state,
|
|
|
visible: true,
|
|
|
defaultFormData: record,
|
|
|
- currentModalType: ModalType.DEL,
|
|
|
- typeEum: ModalType.DEL,
|
|
|
+ currentModalType: ModalTypeEnum.DEL,
|
|
|
accountTotal: record.accountTotal
|
|
|
})
|
|
|
}}
|
|
@@ -230,8 +225,7 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
setState({
|
|
|
...state,
|
|
|
visible: true,
|
|
|
- currentModalType: ModalType.ADD,
|
|
|
- typeEum: ModalType.ADD,
|
|
|
+ currentModalType: ModalTypeEnum.ADD,
|
|
|
defaultFormData: {
|
|
|
dataID: dataID,
|
|
|
structureType: structureType,
|
|
@@ -246,7 +240,6 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
|
|
|
/>
|
|
|
<OrganizationModal
|
|
|
type={state.currentModalType}
|
|
|
- typeEum={state.typeEum}
|
|
|
visible={state.visible}
|
|
|
setVisible={(visible: boolean) => setState({ ...state, visible })}
|
|
|
reload={() => {
|