77 lines
1.9 KiB
TypeScript
77 lines
1.9 KiB
TypeScript
|
|
import {
|
||
|
|
MyBetaModalFormProps,
|
||
|
|
MyButtons,
|
||
|
|
MyColumns,
|
||
|
|
MyProTableProps,
|
||
|
|
} from '@/common';
|
||
|
|
import { Apis } from '@/gen/Apis';
|
||
|
|
import { ProTable } from '@ant-design/pro-components';
|
||
|
|
import { Space } from 'antd';
|
||
|
|
import OrganizationsCreate from '../modals/OrganizationsCreate';
|
||
|
|
|
||
|
|
export default function Organizations(props: MyBetaModalFormProps) {
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
<ProTable
|
||
|
|
{...MyProTableProps.props}
|
||
|
|
search={false}
|
||
|
|
request={async (params, sort) =>
|
||
|
|
MyProTableProps.request(
|
||
|
|
{ ...params, companies_id: props?.item?.id },
|
||
|
|
sort,
|
||
|
|
Apis.Company.CompanyPositions.List,
|
||
|
|
)
|
||
|
|
}
|
||
|
|
toolBarRender={(action) => [
|
||
|
|
<OrganizationsCreate
|
||
|
|
key="Create"
|
||
|
|
reload={action?.reload}
|
||
|
|
item={props?.item}
|
||
|
|
title="组织"
|
||
|
|
/>,
|
||
|
|
]}
|
||
|
|
options={false}
|
||
|
|
columns={[
|
||
|
|
MyColumns.ID(),
|
||
|
|
|
||
|
|
{
|
||
|
|
title: '岗位名称',
|
||
|
|
dataIndex: 'name',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '岗位编号',
|
||
|
|
dataIndex: 'code',
|
||
|
|
search: false,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '岗位排序',
|
||
|
|
dataIndex: 'sort',
|
||
|
|
search: false,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '备注',
|
||
|
|
dataIndex: 'remark',
|
||
|
|
search: false,
|
||
|
|
},
|
||
|
|
MyColumns.UpdatedAt(),
|
||
|
|
MyColumns.CreatedAt(),
|
||
|
|
MyColumns.Option({
|
||
|
|
render: (_, item: any, index, action) => (
|
||
|
|
<Space key={index}>
|
||
|
|
{/* <Update item={item} reload={action?.reload} title={title} /> */}
|
||
|
|
<MyButtons.Delete
|
||
|
|
onConfirm={() =>
|
||
|
|
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||
|
|
action?.reload(),
|
||
|
|
)
|
||
|
|
}
|
||
|
|
/>
|
||
|
|
</Space>
|
||
|
|
),
|
||
|
|
}),
|
||
|
|
]}
|
||
|
|
/>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|