|
@@ -1,9 +1,48 @@
|
|
|
-import React from 'react'
|
|
|
+import { Table } from 'antd'
|
|
|
+import React, { useState, useEffect } from 'react'
|
|
|
+import { useRequest } from 'umi'
|
|
|
+import { queryOrganizationalStructureList } from '@/services/api/institution'
|
|
|
|
|
|
const Organization = () => {
|
|
|
+ const [state, setState] = useState({
|
|
|
+ organizationList: []
|
|
|
+ })
|
|
|
+
|
|
|
+ const columns: ColumnType<API.OrganizationalStructureListItem>[] = [
|
|
|
+ {
|
|
|
+ title: '组织名称',
|
|
|
+ dataIndex: 'name',
|
|
|
+ key: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '包含人员',
|
|
|
+ dataIndex: 'accountTotal',
|
|
|
+ key: 'accountTotal'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'operate',
|
|
|
+ key: 'operate'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const { run: tryOrganizationList } = useRequest(
|
|
|
+ (id: string) => queryOrganizationalStructureList({ id }),
|
|
|
+ {
|
|
|
+ manual: true,
|
|
|
+ onSuccess: result => {
|
|
|
+ setState({ ...state, organizationList: result })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ useEffect(() => {
|
|
|
+ if (state.id) {
|
|
|
+ tryOrganizationList(state.id)
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
return (
|
|
|
<div>
|
|
|
- <span>组织架构</span>
|
|
|
+ {/* <span>组织架构</span> */}
|
|
|
+ <Table<API.OrganizationalStructureListItem> columns={columns} />
|
|
|
</div>
|
|
|
)
|
|
|
}
|