import { BasicColumn } from '/@/components/Table'; import { ModuleDataChart } from '/@/views/vent/deviceManager/configurationTable/types'; import { h } from 'vue'; // 引入vue的h函数用于创建VNode // 系统数据排名 export const sysDataColumn: BasicColumn[] = [ { title: '', align: 'center', width: 60, // 修正customRender的类型和返回值 customRender: ({ index }: { index: number }) => { // 确保index是数字类型,避免算术运算错误 const numIndex = Number(index); let rankImg = ''; if (numIndex === 0) { rankImg = '/src/assets/images/dataCenter/infoCenter/rank-1.png'; } else if (numIndex === 1) { rankImg = '/src/assets/images/dataCenter/infoCenter/rank-2.png'; } else if (numIndex === 2) { rankImg = '/src/assets/images/dataCenter/infoCenter/rank-3.png'; } else { rankImg = '/src/assets/images/dataCenter/infoCenter/rank-4.png'; } return h( 'div', { style: { width: '80px', height: '35px', backgroundImage: `url(${rankImg})`, backgroundSize: '100% 100%', backgroundRepeat: 'no-repeat', position: 'relative', margin: '0 15px', }, }, [ // 排名文字 h( 'span', { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', color: '#fff', fontSize: '14px', fontWeight: 'bold', }, }, `NO.${index + 1}` ), // 显示NO.1、NO.2等 ] ); }, }, { title: '设备id', dataIndex: 'sub_id', align: 'center', ifShow: false, }, { title: '设备名称', dataIndex: 'strName', align: 'center', }, { title: '数量', dataIndex: 'total_num', align: 'center', }, ]; //系统接入情况 export const accessStatusColumn: BasicColumn[] = [ { title: '序号', align: 'center', customRender: ({ index }: { index: number }) => `${index + 1}`, }, { title: '设备名称', dataIndex: 'devicekind_dictText', align: 'center', }, { title: '设备接入时间', dataIndex: 'createTime', align: 'center', }, { title: '点位数量', dataIndex: 'monitorPointNum', align: 'center', }, { title: '运行状态', dataIndex: 'netStatus', align: 'center', }, { title: '数据更新时间', dataIndex: 'dataUpdateTime', align: 'center', }, { title: '操作', dataIndex: 'action', width: 200, align: 'center', slots: { customRender: 'action' }, }, ]; // 每日采集数据表格属性 export const dailyNumOption: ModuleDataChart = { type: 'bar', readFrom: '', legend: { show: false }, xAxis: [{ show: true }], yAxis: [{ show: true, name: '', position: 'left' }], series: [{ readFrom: 'collectDataByDayList', xprop: 'day', yprop: 'total_count', label: '' }], }; export const deviceData = { monitorParamsCount: 1727, deviceCount: 4, databaseDiskUsage: 10165, collectDataByStationList: [ { sub_id: '1696417397868986370', strName: '调试http协议束管', total_num: 258, }, { sub_id: '1696417397868986370', strName: '调试http协议束管', total_num: 256, }, { sub_id: '1696417397868986370', strName: '调试http协议束管', total_num: 254, }, { sub_id: '1696417397868986370', strName: '调试http协议束管', total_num: 252, }, ], collectTotalNum: 258, collectDataByDayList: [ { day: '2025-10-29', total_count: '30', }, { day: '2025-10-30', total_count: '165', }, { day: '2025-10-31', total_count: '63', }, { day: '2025-11-01', total_count: '30', }, { day: '2025-11-02', total_count: '165', }, { day: '2025-11-03', total_count: '63', }, { day: '2025-11-04', total_count: '30', }, { day: '2025-11-05', total_count: '165', }, { day: '2025-11-06', total_count: '63', }, ], };