| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- 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',
- },
- ],
- };
|