Browse Source

[Fix 0000] 均压问题修复

houzekong 1 day ago
parent
commit
b4d8dbe104
1 changed files with 11 additions and 5 deletions
  1. 11 5
      src/views/vent/monitorManager/comment/HistoryTable.vue

+ 11 - 5
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -26,6 +26,7 @@
       <BarAndLine
         v-if="showCurve"
         :charts-columns="chartsColumns"
+        chartsType="history"
         :option="{
           legend: {
             top: '5',
@@ -225,13 +226,16 @@
     setColumns(columns.value);
   });
 
+  const showCurve = ref(false);
+
   // 是否显示历史曲线,在devices_shows_history_curve字典里可以配置哪些设备类型需要显示曲线
   // 字典内的字段可以是前缀,例如fanlocal之于fanlocal_normal
   // 安全监控设备需要更多的配置,除去配置safetymonitor,还需要配置哪些安全监控设备需要曲线
   // 因此可以配置例如A1001的dataTypeName代码(可以查看真实数据参考)
-  const historyCurveDicts = getDictItemsByCode('devices_shows_history_curve') || [];
-  const findDict = (str) => historyCurveDicts.some(({ value }) => str.startsWith(value));
-  const showCurve = computed(() => {
+  function calcShowCurveValue() {
+    const historyCurveDicts = getDictItemsByCode('devices_shows_history_curve') || [];
+    const findDict = (str) => historyCurveDicts.some(({ value }) => str.startsWith(value));
+
     if (!props.showHistoryCurve) return false;
     const dt = props.deviceType; // 依赖项
 
@@ -241,7 +245,8 @@
     // 和字典的设备类型匹配后,如果是安全监控设备,需要额外的匹配安全监控类型
     const dtns = get(selectedOption.value, 'readData.dataTypeName', ''); // 依赖项
     return findDict(dtns);
-  });
+  }
+
   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 };
@@ -273,7 +278,6 @@
       response = await getDeviceListApi({
         systemID: props.sysId,
         devicetype: 'sys',
-        pageSize: 10000,
       }).then(({ msgTxt }) => {
         return { msgTxt: msgTxt.filter((e) => e.type === props.deviceType) };
       });
@@ -315,6 +319,7 @@
       });
 
       stationType.value = deviceOptions.value[0]['stationtype'];
+      showCurve.value = calcShowCurveValue();
       if (props.deviceType.startsWith('vehicle')) {
         historyType.value = 'vehicle';
       } else {
@@ -476,6 +481,7 @@
                         deviceTypeStr.value = option['strtype'];
                       }
                       stationType.value = option['stationtype'];
+                      showCurve.value = calcShowCurveValue();
                       nextTick(async () => {
                         await getDataSource();
                       });