Procházet zdrojové kódy

[Feat 0000] 工作面支持报表监测

houzekong před 6 dny
rodič
revize
e8c659835a

+ 27 - 2
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -554,6 +554,9 @@ export const noWarningArr = [
   'gate_linkdlfm',
   'substation_normal',
   'safetymonitor',
+  'bundleReport',
+  'bundleSpyReport',
+  'dustReport',
 ]; // 无预警详情的
 export const haveSysDetailArr = ['forcFan', 'pulping']; //有场景详情的
 
@@ -569,5 +572,27 @@ export const noLocationArr = () => {
 };
 export const noHistoryArr = () =>
   History_Type['type'] == 'remote'
-    ? ['surface_history', 'gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gasDay', 'gate_linkdlfm']
-    : ['gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gate_linkdlfm', 'gasDay', 'substation_normal'];
+    ? [
+        'surface_history',
+        'gasDayReport',
+        'dustDayReport',
+        'bundleDayReport',
+        'bundleSpyDayReport',
+        'gasDay',
+        'gate_linkdlfm',
+        'bundleReport',
+        'bundleSpyReport',
+        'dustReport',
+      ]
+    : [
+        'gasDayReport',
+        'dustDayReport',
+        'bundleDayReport',
+        'bundleSpyDayReport',
+        'gate_linkdlfm',
+        'gasDay',
+        'substation_normal',
+        'bundleReport',
+        'bundleSpyReport',
+        'dustReport',
+      ];

+ 36 - 23
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -171,9 +171,11 @@
               deviceType.startsWith('gasDay_normal')
                 ? '当日巡检监测'
                 : deviceType.startsWith('dustDayReport') ||
-                  deviceType.startsWith('dustDayReport') ||
                   deviceType.startsWith('bundleDayReport') ||
-                  deviceType.startsWith('bundleSpyDayReport')
+                  deviceType.startsWith('bundleSpyDayReport') ||
+                  deviceType.startsWith('bundleReport') ||
+                  deviceType.startsWith('bundleSpyReport') ||
+                  deviceType.startsWith('dustReport')
                 ? '最新监测报表'
                 : '实时监测'
             "
@@ -670,7 +672,6 @@
     surfaceChartsColumns,
     noHistoryArr,
     getMonitorComponent,
-    vehicleFormConfig,
     noLocationArr,
     haveHistoryEcharts,
   } from './device.data';
@@ -809,7 +810,7 @@
 
   function tabChange(activeKeyVal) {
     activeKey.value = activeKeyVal;
-    // router.push({ path: route.path, query: { ...route.query, tabtype: activeKey.value } });
+    router.push({ path: route.path, query: { ...route.query, tabtype: activeKey.value } });
   }
 
   function showTree(flag, value) {
@@ -897,25 +898,38 @@
           const readData = data.readData;
           return Object.assign(data, readData);
         });
-        if (item.type != 'sys') {
-          if (item.type === 'majorpath') {
-            deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] });
-            majorPathEchartsData.value = item['datalist'][0];
-          } else if (item.type.startsWith('surface_history')) {
-            surfaceEchartsData.value = item['datalist'][0];
-            deviceArr.unshift({
-              deviceType: item.type,
-              deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
-              datalist: data,
-            });
-          } else {
-            deviceArr.unshift({
-              deviceType: item.type,
-              deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
-              datalist: data,
-            });
-          }
+
+        // 如果查出的所有设备里,设备类型是sys的,标识其是系统总体,不应显示在设备列表中
+        if (item.type == 'sys') return;
+
+        // majorpath关键线路需要显示图表
+        if (item.type === 'majorpath') {
+          deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] });
+          return (majorPathEchartsData.value = item['datalist'][0]);
         }
+        // 工作面历史数据需要显示图表
+        if (item.type.startsWith('surface_history')) {
+          surfaceEchartsData.value = item['datalist'][0];
+          return deviceArr.unshift({
+            deviceType: item.type,
+            deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
+            datalist: data,
+          });
+        }
+        // 其余的存在 subtype 的(一般为报表)仅需显示报表表格,同时它们一版都排在后面
+        if (item.subtype) {
+          return deviceArr.push({
+            deviceType: item.subtype,
+            deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
+            datalist: data,
+          });
+        }
+
+        deviceArr.unshift({
+          deviceType: item.type,
+          deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
+          datalist: data,
+        });
       });
 
       deviceList.value = deviceArr;
@@ -1350,7 +1364,6 @@
     if (activeKey.value == '4' && handlerHistoryTable.value) {
       handlerHistoryTable.value.setLoading(true);
     }
-    router.push({ path: route.path, query: { ...route.query, deviceActive: deviceActive.value } });
   }
   /**
    * 设置巷道设备定位图标的显示与隐藏