import { Button } from 'antd'; import React, { useRef } from 'react'; import { history } from 'umi'; import { PageContainer } from '@ant-design/pro-layout'; import type { ProColumns, ActionType } from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'; import { fetchProjectFileList } from './service'; import type { TableListItem, TableListPagination } from './data'; import { purchaseTypeEnum } from './dict'; const ProjectFiles: React.FC = () => { const actionRef = useRef(); const columns: ProColumns[] = [ { title: '序号', dataIndex: 'index', renderText: (text, record, index) => index + 1, width: 50, hideInSearch: true, }, { title: '项目名称', dataIndex: 'projectName', valueType: 'text', }, { title: '项目编号', dataIndex: 'ebpProjectNumber', hideInSearch: true, }, { title: '创建时间', dataIndex: 'createDate', hideInSearch: true, }, { title: '采购方式', dataIndex: 'purchaseType', valueType: 'select', valueEnum: purchaseTypeEnum, }, { title: '采购类型', dataIndex: 'purchaseType', hideInSearch: true, }, { title: '状态', dataIndex: 'status', valueType: 'select', }, { title: '版本号', dataIndex: 'version', hideInSearch: true, }, { title: '操作', dataIndex: 'option', valueType: 'option', render: (_, record) => [ { history.push(`/ProjectFiles/file?action=view&id=${record.id}`); }} > 查看 , ], }, ]; return (
actionRef={actionRef} rowKey="id" search={{ labelWidth: 120, }} toolBarRender={() => [ , ]} options={{ density: false, reload: false, setting: false, fullScreen: false }} request={fetchProjectFileList} columns={columns} />
); }; export default ProjectFiles;