|
@@ -1,10 +1,14 @@
|
|
|
import { Table } from 'antd'
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
import { useRequest } from 'umi'
|
|
|
-import { queryOrganizationalStructureList } from '@/services/api/institution'
|
|
|
|
|
|
-const Organization = ({ dataID, structureType }) => {
|
|
|
+type OrganizationProps = {
|
|
|
+ dataID: string
|
|
|
+ structureType: string
|
|
|
+}
|
|
|
+const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) => {
|
|
|
const [state, setState] = useState({
|
|
|
+ id: '',
|
|
|
organizationList: []
|
|
|
})
|
|
|
|
|
@@ -26,16 +30,16 @@ const Organization = ({ dataID, structureType }) => {
|
|
|
}
|
|
|
]
|
|
|
const { run: tryOrganizationList } = useRequest(
|
|
|
- (id: string) => queryOrganizationalStructureList({ id }),
|
|
|
+ () => queryOrganizationalStructureList({ dataID, structureType }),
|
|
|
{
|
|
|
- manual: true,
|
|
|
+ // manual: true,
|
|
|
onSuccess: result => {
|
|
|
- setState({ ...state, organizationList: result })
|
|
|
+ setState({ ...state, organizationList: result.data })
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
useEffect(() => {
|
|
|
- tryOrganizationList(state.id)
|
|
|
+ // tryOrganizationList()
|
|
|
}, [])
|
|
|
return (
|
|
|
<div>
|