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: '系统名称', dataIndex: 'sysName', align: 'center', }, { title: '数量', dataIndex: 'sysNum', align: 'center', }, ]; // 系统接入情况数据 export const sysData = [ { sysName: 'wscc', sysNum: 32, }, { sysName: 'wscc', sysNum: 33, }, { sysName: 'wscc', sysNum: 34, }, { sysName: 'wscc', sysNum: 35, }, { sysName: 'wscc', sysNum: 35, }, { sysName: 'wscc', sysNum: 35, }, ]; //系统接入情况 export const accessStatusColumn: BasicColumn[] = [ { title: '序号', align: 'center', customRender: ({ index }: { index: number }) => `${index + 1}`, }, { title: '系统名称', dataIndex: 'sysName', align: 'center', }, { title: '系统接入时间', dataIndex: 'accessTime', align: 'center', }, { title: '点位数量', dataIndex: 'pointNum', align: 'center', }, { title: '运行状态', dataIndex: 'runStatus', align: 'center', }, { title: '数据更新时间', dataIndex: 'dataUpdateTime', align: 'center', }, { title: '操作', dataIndex: 'action', width: 200, align: 'center', slots: { customRender: 'action' }, }, ]; // 系统接入情况数据 export const accessStatusData = [ { sysName: '1', accessTime: '2025.10.01', pointNum: 32, runStatus: '1', dataUpdateTime: '2025.10.01', }, { sysName: '2', accessTime: '2025.10.02', pointNum: 32, runStatus: '2', dataUpdateTime: '2025.10.02', }, { sysName: '3', accessTime: '2025.10.02', pointNum: 32, runStatus: '3', dataUpdateTime: '2025.10.02', }, { sysName: '3', accessTime: '2025.10.02', pointNum: 32, runStatus: '3', dataUpdateTime: '2025.10.02', }, ]; // 每日采集数据表格属性 export const dailyNumOption: ModuleDataChart = { type: 'bar', readFrom: '', legend: { show: false }, xAxis: [{ show: true }], yAxis: [{ show: true, name: '', position: 'left' }], series: [{ readFrom: 'history', xprop: 'time', yprop: 'val', label: '' }], }; // 每日采集数据 export const dailyNumData = { history: [ { time: '2025-10-13', val: '113', }, { time: '2025-10-14', val: '153', }, { time: '2025-10-15', val: '163', }, { time: '2025-10-16', val: '193', }, { time: '2025-10-17', val: '203', }, { time: '2025-10-18', val: '203', }, { time: '2025-10-19', val: '223', }, { time: '2025-10-20', val: '183', }, { time: '2025-10-21', val: '153', }, { time: '2025-10-22', val: '183', }, { time: '2025-10-23', val: '153', }, ], };