|
@@ -1,9 +1,82 @@
|
|
|
-import React from 'react'
|
|
|
+import ProTable from '@ant-design/pro-table'
|
|
|
+import React, { useState, useRef } from 'react'
|
|
|
+import { Button } from 'antd'
|
|
|
+import consts from '@/utils/consts'
|
|
|
+import { history } from 'umi'
|
|
|
+import { queryAcountList } from '@/services/api/institution'
|
|
|
|
|
|
-const Staff = () => {
|
|
|
+type ListProps = ConnectProps & {
|
|
|
+ accountType: API.AccountType[]
|
|
|
+}
|
|
|
+const Staff: React.FC<ListProps> = ({ dataID }) => {
|
|
|
+ const tRef = useRef<ActionType>(null)
|
|
|
+ const [state, setState] = useState({
|
|
|
+ params: {
|
|
|
+ search: null,
|
|
|
+ accountType: 1,
|
|
|
+ dataID
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ dataIndex: 'account',
|
|
|
+ title: '帐号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'name',
|
|
|
+ title: '姓名'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'institution',
|
|
|
+ title: '组织架构'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'phone',
|
|
|
+ title: '手机'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'createdTime',
|
|
|
+ title: '创建时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'created',
|
|
|
+ title: '创建人'
|
|
|
+ }
|
|
|
+ ]
|
|
|
return (
|
|
|
<div>
|
|
|
- <span>人员管理</span>
|
|
|
+ <ProTable<API.AccountListItem>
|
|
|
+ rowKey="ID"
|
|
|
+ params={state.params}
|
|
|
+ actionRef={tRef}
|
|
|
+ columns={columns}
|
|
|
+ search={false}
|
|
|
+ request={async (params, filter, sorter) => {
|
|
|
+ const { code = -1, data: { items = [], totle = 0 } = {} } = await queryAcountList({
|
|
|
+ ...params,
|
|
|
+ ...filter,
|
|
|
+ ...sorter
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ data: items,
|
|
|
+ success: code === consts.RET_CODE.SUCCESS,
|
|
|
+ totle
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ toolbar={{
|
|
|
+ search: {
|
|
|
+ onSearch: val => setState({ ...state, params: { ...state.params, search: val } })
|
|
|
+ },
|
|
|
+ actions: [
|
|
|
+ <Button
|
|
|
+ onClick={() => {
|
|
|
+ history.push('/institutions/company/add')
|
|
|
+ }}>
|
|
|
+ 添加人员
|
|
|
+ </Button>
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
)
|
|
|
}
|