|
@@ -90,6 +90,24 @@ export const columns: BasicColumn[] = [
|
|
|
title: '监测时长(天)',
|
|
title: '监测时长(天)',
|
|
|
dataIndex: 'daysMonitored',
|
|
dataIndex: 'daysMonitored',
|
|
|
width: 100,
|
|
width: 100,
|
|
|
|
|
+ // 自定义渲染函数,计算并显示天数差
|
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
|
+ // 校验预警时间是否存在
|
|
|
|
|
+ if (!record?.createTime) {
|
|
|
|
|
+ return '0';
|
|
|
|
|
+ }
|
|
|
|
|
+ const alarmDate = new Date(record.createTime);
|
|
|
|
|
+ alarmDate.setHours(0, 0, 0, 0);
|
|
|
|
|
+ const alarmTime = alarmDate.getTime();
|
|
|
|
|
+ if (isNaN(alarmTime)) {
|
|
|
|
|
+ return '0';
|
|
|
|
|
+ }
|
|
|
|
|
+ const nowDate = new Date();
|
|
|
|
|
+ nowDate.setHours(0, 0, 0, 0);
|
|
|
|
|
+ const nowTime = nowDate.getTime();
|
|
|
|
|
+ const diffDays = Math.floor((nowTime - alarmTime) / 86400000);
|
|
|
|
|
+ return Math.max(diffDays, 0).toString();
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '风险分析',
|
|
title: '风险分析',
|
|
@@ -101,6 +119,11 @@ export const columns: BasicColumn[] = [
|
|
|
dataIndex: 'createTime',
|
|
dataIndex: 'createTime',
|
|
|
width: 100,
|
|
width: 100,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '是否解决',
|
|
|
|
|
+ customRender: () => '未解决',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
export const searchFormSchema: FormSchema[] = [
|