95 lines
2.3 KiB
TypeScript
95 lines
2.3 KiB
TypeScript
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 EmployeeUpdate from '../company/components/modals/EmployeeUpdate';
|
|
|
|
export default function Index({ title = '员工管理' }) {
|
|
// 使用多标签页功能
|
|
usePageTabs({
|
|
tabKey: 'employees-list',
|
|
tabLabel: title,
|
|
closable: true,
|
|
});
|
|
|
|
return (
|
|
<MyPageContainer
|
|
enableTabs
|
|
tabKey="employees-list"
|
|
tabLabel={title}
|
|
title={title}
|
|
>
|
|
<ProTable
|
|
{...MyProTableProps.props}
|
|
// search={false}
|
|
request={async (params, sort) =>
|
|
MyProTableProps.request(
|
|
params,
|
|
sort,
|
|
Apis.Company.CompanyEmployees.List,
|
|
)
|
|
}
|
|
// toolBarRender={(action) => [
|
|
// <EmployeesCreate
|
|
// key="Create"
|
|
// reload={action?.reload}
|
|
// title={title}
|
|
// />,
|
|
// ]}
|
|
columns={[
|
|
MyColumns.ID(),
|
|
{
|
|
title: '机构',
|
|
dataIndex: ['company', 'name'],
|
|
search: false,
|
|
},
|
|
{
|
|
title: '组织',
|
|
dataIndex: ['organization', 'name'],
|
|
search: false,
|
|
},
|
|
{
|
|
title: '姓名',
|
|
dataIndex: 'name',
|
|
},
|
|
{
|
|
title: '手机号',
|
|
dataIndex: 'phone',
|
|
},
|
|
{
|
|
title: '岗位',
|
|
dataIndex: ['position', 'name'],
|
|
search: false,
|
|
},
|
|
MyColumns.UpdatedAt(),
|
|
// MyColumns.CreatedAt(),
|
|
MyColumns.Option({
|
|
render: (_, item: any, index, action) => (
|
|
<Space key={index}>
|
|
<EmployeeUpdate
|
|
item={item}
|
|
reload={action?.reload}
|
|
title={title}
|
|
/>
|
|
<MyButtons.Delete
|
|
onConfirm={() =>
|
|
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
|
action?.reload(),
|
|
)
|
|
}
|
|
/>
|
|
</Space>
|
|
),
|
|
}),
|
|
]}
|
|
/>
|
|
</MyPageContainer>
|
|
);
|
|
}
|