浏览代码

[Feat 0000]预警分析模块开发

bobo04052021@163.com 3 月之前
父节点
当前提交
4ab734a469

+ 23 - 2
src/views/analysis/warningAnalysis/airLeakStatus/airLeakStatus.data.ts

@@ -60,13 +60,34 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否漏风',
-    dataIndex: 'leakage',
+    dataIndex: 'alarmName',
     width: 100,
+    customRender: ({ text }) => {
+      // 解构获取真正的 text 字符串值
+      // 先校验 text 是字符串类型,再处理分割逻辑
+      if (typeof text !== 'string') {
+        return '-';
+      }
+      if (!text.includes('-')) {
+        return text;
+      }
+      return text.split('-')[0];
+    },
   },
   {
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
+    customRender: ({ text }) => {
+      if (typeof text !== 'string') {
+        return '-';
+      }
+      if (!text.includes('-')) {
+        return text;
+      }
+      const parts = text.split('-');
+      return parts.slice(1).join('-');
+    },
   },
   {
     title: '预警时间',
@@ -75,7 +96,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否解决',
-    dataIndex: 'isResolved',
+    customRender: () => '未解决',
     width: 100,
   },
 ];

+ 14 - 2
src/views/analysis/warningAnalysis/autoFireAnalysis/autoFireAnalysis.data.ts

@@ -63,7 +63,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: 'CO日增率',
-    dataIndex: 'coIncreaseRate',
+    dataIndex: 'coRzl',
     width: 100,
   },
   {
@@ -85,6 +85,18 @@ export const columns: BasicColumn[] = [
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
+    customRender: ({ text }) => {
+      if (typeof text !== 'string') {
+        return '-';
+      }
+      const riskMap = {
+        '1': '低风险',
+        '2': '一般风险',
+        '3': '较高风险',
+        '4': '高风险',
+      };
+      return riskMap[text] || text;
+    },
   },
   {
     title: '预警时间',
@@ -93,7 +105,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否解决',
-    dataIndex: 'isResolved',
+    customRender: () => '未解决',
     width: 100,
   },
 ];

+ 23 - 0
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/fireAreaJudgeAnalysis.data.ts

@@ -90,6 +90,24 @@ export const columns: BasicColumn[] = [
     title: '监测时长(天)',
     dataIndex: 'daysMonitored',
     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: '风险分析',
@@ -101,6 +119,11 @@ export const columns: BasicColumn[] = [
     dataIndex: 'createTime',
     width: 100,
   },
+  {
+    title: '是否解决',
+    customRender: () => '未解决',
+    width: 100,
+  },
 ];
 
 export const searchFormSchema: FormSchema[] = [

+ 2 - 2
src/views/analysis/warningAnalysis/overlimitAlarm/overlimitAlarm.data.ts

@@ -63,7 +63,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: 'CO日增率',
-    dataIndex: 'coIncreaseRate',
+    dataIndex: 'coRzl',
     width: 100,
   },
   {
@@ -93,7 +93,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否解决',
-    dataIndex: 'isResolved',
+    customRender: () => '未解决',
     width: 100,
   },
 ];

+ 18 - 6
src/views/analysis/warningAnalysis/pressureDiffAnalysis/pressureDiffAnalysis.data.ts

@@ -57,24 +57,36 @@ export const columns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: '密闭内压力',
+    title: '监测压差(Pa)',
     dataIndex: 'sourcePressure',
     width: 100,
   },
   {
-    title: '密闭外压力',
-    dataIndex: 'sourcePressure',
+    title: '日差压差均值(Pa)',
+    dataIndex: 'dailyYaCha',
     width: 100,
   },
   {
-    title: '是否漏风',
-    dataIndex: 'leakage',
+    title: '绝对压差变化(%)',
+    dataIndex: 'yaChaChange',
     width: 100,
   },
   {
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
+    customRender: ({ text }) => {
+      if (typeof text !== 'string') {
+        return '-';
+      }
+      const riskMap = {
+        '1': '低风险',
+        '2': '一般风险',
+        '3': '较高风险',
+        '4': '高风险',
+      };
+      return riskMap[text] || text;
+    },
   },
   {
     title: '预警时间',
@@ -83,7 +95,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否解决',
-    dataIndex: 'isResolved',
+    customRender: () => '未解决',
     width: 100,
   },
 ];

+ 2 - 2
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/sealRiskJudgeAnalysis.data.ts

@@ -83,7 +83,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '爆炸危险性',
-    dataIndex: 'explosionHazard',
+    dataIndex: 'alarmName',
     width: 100,
   },
   {
@@ -98,7 +98,7 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '是否解决',
-    dataIndex: 'isResolved',
+    customRender: () => '未解决',
     width: 100,
   },
 ];