import { MyButtons, MyColumns, MyPageContainer, MyProTableProps, usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import EmployeesCreate from '../company/companies/modals/EmployeesCreate'; import EmployeesUpdate from '../company/companies/modals/EmployeesUpdate'; export default function Index({ title = '员工管理' }) { // 使用多标签页功能 usePageTabs({ tabKey: 'employees-list', tabLabel: title, closable: true }); return ( MyProTableProps.request( params, sort, Apis.Company.CompanyEmployees.List, ) } toolBarRender={(action) => [ , ]} columns={[ MyColumns.ID(), MyColumns.Companies({ title: '选择机构', }), { title: '机构', dataIndex: ['company', 'name'], search: false, }, { title: '组织', dataIndex: ['organization', 'name'], search: false, }, { title: '姓名', dataIndex: 'name', }, { title: '手机号', dataIndex: 'phone', }, { title: '岗位', dataIndex: ['position', 'name'], }, MyColumns.UpdatedAt(), // MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Common.Admins.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }