/* * @Author: donghao donghao@supervision.ltd * @Date: 2024-04-22 15:23:36 * @LastEditors: donghao donghao@supervision.ltd * @LastEditTime: 2024-05-10 17:07:15 * @FilePath: \general-ai-platform-web\src\pages\Business\BusinessState\components\detailDeviceStateLog.tsx * @Description: 设备日志 * @交互说明 * 1、设备日志列表的分页展示 */ import { getDeviceStateLogList } from '@/services/testApi/businessState'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { ProCard, ProTable } from '@ant-design/pro-components'; import { FormattedMessage } from '@umijs/max'; import { useRef, useState } from 'react'; import { proTablePaginationOptions } from '../../../../../config/defaultTable'; const DetailDeviceStateLog: React.FC = () => { const actionRef = useRef(); // 动态设置每页数量 const [currentPageSize, setCurrentPageSize] = useState(10); // 业务模型列表信息 const columns: ProColumns>[] = [ { title: , dataIndex: 'IP', hideInSearch: true, key: 'fixedName', fixed: 'left', width: '40%', }, { title: ( ), dataIndex: 'runTime', hideInSearch: true, width: '20%', }, { title: ( ), dataIndex: 'updateTime', hideInSearch: true, valueType: 'dateTime', }, ]; return (
setCurrentPageSize(pageSize), }} columnsState={{ persistenceKey: 'bs_server_log_list', persistenceType: 'localStorage', }} request={async (params = {}) => { const { current, ...rest } = params; const reqParams = { page: current, ...rest, }; let resp = await getDeviceStateLogList({ ...reqParams }); console.log(resp, 'getDeviceStateLogList_resp'); return { data: resp.data?.results, success: resp.success, total: resp.data.count, current: current, pageSize: currentPageSize, }; }} columns={columns} />
); }; export default DetailDeviceStateLog;