| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import BasicTable from '@/components/Table'
- import consts from '@/consts'
- import { queryStaff } from '@/services/staff'
- import React, { useState } from 'react'
- import RoleMenu from '../Employee/components/RoleMenu'
- const AddressBook = () => {
- const [state, setState] = useState({
- params: { id: '0' }
- })
- const onSelect = id => {
- setState({ ...state, params: { id } })
- }
- const columns = [
- {
- title: '工号',
- dataIndex: 'jobNumber',
- search: false,
- width: 100
- },
- {
- title: '姓名',
- dataIndex: 'username',
- search: false,
- width: 80
- },
- {
- title: '手机',
- dataIndex: 'telephone',
- search: false,
- width: 120
- },
- {
- title: 'QQ',
- dataIndex: 'qq',
- search: false,
- width: 150
- },
- {
- title: '部门',
- dataIndex: 'departmentName',
- search: false,
- width: 70
- },
- {
- title: '岗位',
- dataIndex: 'position',
- search: false,
- width: 100
- },
- {
- title: '生日',
- dataIndex: 'birthday',
- search: false,
- width: 150
- },
- {
- title: '入职时间',
- dataIndex: 'hiredate',
- search: false,
- width: 150
- }
- ]
- return (
- <div className="h-full w-full flex flex-row">
- <RoleMenu onSelect={onSelect} showType={false} />
- <div style={{ width: 'calc(100% - 12rem)' }}>
- <div className="ml-8 shadow-hex-3e2c5a">
- {state.params.id && (
- <BasicTable
- mainMenuType="hr"
- columnStateType="ADDRESSBOOK"
- params={{ departmentId: state.params.id }}
- rowKey={record => record.id}
- columns={columns}
- request={async params => {
- const { code = -1, data: { list = [], total = 0 } = { list: [], total: 0 } } =
- await queryStaff({ ...params })
- return {
- data: list,
- success: code === consts.RET_CODE.SUCCESS,
- total
- }
- }}
- search={false}
- />
- )}
- </div>
- </div>
- </div>
- )
- }
- export default AddressBook
|