import { MyButtons, MyColumns, MyPageContainer, MyProTableProps, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; export default function Index({ title = '代理商' }) { return ( MyProTableProps.request(params, sort, Apis.Agents.List) } toolBarRender={(action) => [ , ]} columns={[ MyColumns.ID(), { title: '简称', dataIndex: 'name', }, { title: '全称', dataIndex: 'full_name', }, { dataIndex: 'address', title: '地址', }, { dataIndex: 'contact', title: '联系人', }, { dataIndex: 'phone', title: '联系电话', }, MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Agents.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }