import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useEffect, useRef } from 'react'; import GridCreate from './modals/GridCreate'; import GridMannger from './modals/GridMannger'; import GridCreateUpdate from './modals/GridUpdate'; export default function Index({ ...rest }) { const actionLooks = useRef(); useEffect(() => { actionLooks?.current.reloadAndRest(); }, [rest.loadmore]); return ( <> > {...MyProTableProps.props} actionRef={actionLooks} request={async (params, sort) => MyProTableProps.request( { ...params, asset_projects_id: rest.item?.id }, sort, Apis.Grid.Grids.List, ) } toolBarRender={(action) => [ , ]} search={false} columns={[ { 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(), ) } /> ), }), ]} /> ); }