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 GridCreate from './modals/GridCreate'; import GridMannger from './modals/GridMannger'; import GridUpdate from './modals/GridUpdate'; export default function Index({ title = '楼栋范围' }) { const navigate = useNavigate(); // 注册当前页面为标签页 usePageTabs({ tabKey: 'grids', tabLabel: title, }); return ( MyProTableProps.request(params, sort, Apis.Grid.Grids.List) } toolBarRender={(action) => [ , ]} columns={[ { title: '关联项目', dataIndex: ['asset_project', 'name'], search: { transform: (value) => { return { project_name: value }; }, }, }, { title: 'ID', dataIndex: 'id', }, { title: '板块名称', dataIndex: 'name', }, { title: '标识', dataIndex: 'grid_mark', }, { title: '楼栋管家', dataIndex: ['company_employee', 'name'], render: (_, item: any) => `${item?.company_employee?.name || ''}-${ item?.company_employee?.phone || '' }`, }, // MyColumns.CreatedAt(), MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Grid.Grids.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }