import { MyButtons, MyColumns, MyPageContainer, MyProTableProps, usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; export default function Index({ title = '岗位管理' }) { const navigate = useNavigate(); // 注册当前页面为标签页 usePageTabs({ tabKey: 'positions', tabLabel: title, }); return ( MyProTableProps.request(params, sort, Apis.Common.Positions.List) } toolBarRender={(action) => [ , ]} columns={[ MyColumns.ID(), { title: '岗位名称', dataIndex: 'name', width: 300, }, { title: '是否启用', dataIndex: 'is_use', search: false, render: (text) => (text ? '是' : '否'), width: 200, }, MyColumns.CreatedAt(), MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Common.Positions.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }