/* * @Author: donghao donghao@supervision.ltd * @Date: 2024-04-30 10:02:29 * @LastEditors: donghao donghao@supervision.ltd * @LastEditTime: 2024-04-30 17:01:59 * @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\modelSetting.tsx * @Description: 业务模型部署 * @交互说明 * 1、业务模型部署列表的分页展示 * 2、配置参数功能 */ import TableActionCard from '@/components/TableActionCard'; import { getBusinessModelList } from '@/services/testApi/businessModel'; import { ExclamationCircleFilled } from '@ant-design/icons'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components'; import { FormattedMessage } from '@umijs/max'; import { Button } from 'antd'; import { useRef, useState } from 'react'; import { proTableCommonOptions, proTablePaginationOptions, } from '../../../../../config/defaultTable'; // import CreateForm from './components/createForm'; const ModelSetting: React.FC = () => { // const intl = useIntl(); const actionRef = useRef(); // const [createModalOpen, setCreateModalOpen] = useState(false); // const [categoryFkIdIds, setCategoryFkIdIds] = useState([]); // 动态设置每页数量 const [currentPageSize, setCurrentPageSize] = useState(10); // const [currentRow, setCurrentRow] = useState>({}); /**配置参数 */ // function reloadList() { // actionRef.current?.reload(); // } // 业务模型列表信息 const columns: ProColumns>[] = [ { title: , dataIndex: 'name', hideInSearch: true, key: 'fixedName', fixed: 'left', }, { title: , dataIndex: 'status', hideInSearch: true, }, { title: ( ), dataIndex: 'createTime', hideInSearch: true, valueType: 'dateTime', }, { title: , dataIndex: 'option', valueType: 'option', fixed: 'right', key: 'option', render: () => [ { // TODO 编辑在新增联调后实现 // setCurrentRow(record); }} > ), }, ]} >, ], }, ]; return (
配置参数需关联具体设备请先至设备列表添加设备后再进行配置
{ console.log(data, 'onDataSourceChange_data'); // let CategoryFkIdIds: any = data.map((v) => { // return v.categoryFkId; // }); // setCategoryFkIdIds(CategoryFkIdIds); }} pagination={{ ...proTablePaginationOptions, pageSize: currentPageSize, onChange: (page, pageSize) => setCurrentPageSize(pageSize), }} columnsState={{ persistenceKey: 'algorithm_model_list', persistenceType: 'localStorage', }} request={async (params = {}) => { const { current, ...rest } = params; const reqParams = { page: current, ...rest, }; let resp = await getBusinessModelList({ ...reqParams }); console.log(resp, 'getModelVersionList_resp'); return { data: resp.data?.results.map((v: Record) => { return { ...v, key: v.id }; }), success: resp.success, total: resp.data.count, current: current, pageSize: currentPageSize, }; }} columns={columns} />
); }; export default ModelSetting;