소스 검색

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 1 일 전
부모
커밋
5663bf5fa0

+ 6 - 0
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHome2.vue

@@ -84,6 +84,12 @@
               }
             });
           }
+          if (e.type.startsWith('avgpressure_lowoxygen')) {
+            e.datalist.forEach((ele) => {
+              ele.strinstallpos.replace(' ', '');
+              ele.strname.replace(' ', '');
+            });
+          }
         }
 
         return obj;

+ 29 - 21
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -40,7 +40,7 @@
         }"
         :data-source="dataSource"
         height="290px"
-        x-axis-prop-type="ttime"
+        :x-axis-prop-type="stationType !== 'redis' ? 'ttime' : 'time'"
       />
     </div>
   </div>
@@ -207,22 +207,6 @@
     } else {
       columns.value = column;
     }
-    if (props.showHistoryCurve) {
-      const arr = type.split('_');
-      // 没错,又是安全监控。安全监控的单位无法一次定好,所以根据返回的数据协定单位
-      if (props.deviceType.startsWith('safetymonitor')) {
-        chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart').map((e) => {
-          const unit = get(selectedOption.value, 'readData.unit', e.unit);
-          return {
-            ...e,
-            unit: unit,
-            seriesName: unit,
-          };
-        });
-      } else {
-        chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart');
-      }
-    }
     setColumns(columns.value);
   });
 
@@ -247,6 +231,24 @@
     return findDict(dtns);
   }
 
+  function initHistoryCurveColumns() {
+    if (!props.showHistoryCurve) return;
+    const arr = historyType.value.split('_');
+    // 没错,又是安全监控。安全监控的单位无法一次定好,所以根据返回的数据协定单位
+    if (props.deviceType.startsWith('safetymonitor')) {
+      chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart').map((e) => {
+        const unit = get(selectedOption.value, 'readData.unit', e.unit);
+        return {
+          ...e,
+          unit: unit,
+          seriesName: unit,
+        };
+      });
+    } else {
+      chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart');
+    }
+  }
+
   const tableScroll = computed(() => {
     if (props.scroll.y && showCurve.value) return { y: props.scroll.y - 450 };
     if (props.scroll.y) return { y: props.scroll.y - 100 };
@@ -319,12 +321,17 @@
       });
 
       stationType.value = deviceOptions.value[0]['stationtype'];
-      showCurve.value = calcShowCurveValue();
       if (props.deviceType.startsWith('vehicle')) {
         historyType.value = 'vehicle';
       } else {
         historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
       }
+
+      /** 此处使用nextTick是由于可能表单暂未更新,而下面的方法依赖表单项 */
+      nextTick(() => {
+        showCurve.value = calcShowCurveValue();
+        initHistoryCurveColumns();
+      });
     }
     if (VENT_PARAM.historyIsMultiple) {
       await getForm().setFieldsValue({
@@ -481,9 +488,10 @@
                         deviceTypeStr.value = option['strtype'];
                       }
                       stationType.value = option['stationtype'];
-                      showCurve.value = calcShowCurveValue();
-                      nextTick(async () => {
-                        await getDataSource();
+                      nextTick(() => {
+                        showCurve.value = calcShowCurveValue();
+                        initHistoryCurveColumns();
+                        getDataSource();
                       });
                     },
                   },