Преглед изворни кода

[Nod 0000] 优化局部风机风排瓦斯模拟功能

hongrunxia пре 10 часа
родитељ
комит
d4938085ed

+ 159 - 121
src/views/vent/monitorManager/fanLocalMonitor/components/deviceFaultDetailModal.vue

@@ -18,53 +18,85 @@
       <div class="basic-content">
         <div class="basic-title">风速监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'windSpeed'" :legendName="'风速'"
-            :echartColor="'#ff0000'"></faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'windSpeed'"
+            :legendName="'风速'"
+            :echartColor="'#ff0000'"
+          />
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">风量监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'wind'"  :legendName="'风量'"
-            :echartColor="'#2ec1dd'"></faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'wind'"
+            :legendName="'风量'"
+            :echartColor="'#2ec1dd'"
+          />
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">电流监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dl'"  :legendName="'电流'"
-            :echartColor="'#fbc21c'">
-          </faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'Dl'"
+            :legendName="'电流'"
+            :echartColor="'#fbc21c'"
+          />
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">电压监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dy'"  :legendName="'电压'"
-            :echartColor="'#259745'">
-          </faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'Dy'"
+            :legendName="'电压'"
+            :echartColor="'#259745'"
+          />
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">瓦斯浓度监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'wsnd'"  :legendName="'瓦斯浓度'"
-            :echartColor="'#0fcb74'">
-          </faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'wsnd'"
+            :legendName="'瓦斯浓度'"
+            :echartColor="'#0fcb74'"
+          />
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">振动监测曲线</div>
         <div class="echart-box">
-          <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Zd'"  :legendName="'振动'"
-            :echartColor="'#00a9ff'">
-          </faultEchartLine>
+          <faultEchartLine
+            :selectData="selectData"
+            :warningMonitorRowIndex="warningMonitorRowIndex"
+            :deviceId="deviceID"
+            :deviceType="deviceType"
+            :Type="'Zd'"
+            :legendName="'振动'"
+            :echartColor="'#00a9ff'"
+          />
         </div>
       </div>
     </div>
@@ -105,114 +137,120 @@
   let normalNum = ref(0); //正常测点数量
   let abnormalNum = ref(0); //
 
-// let windsValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1WindSpeed'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2WindSpeed'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
-// }) //实时风速
-// let windValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wind'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wind'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
+  // let windsValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1WindSpeed'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2WindSpeed'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
+  // }) //实时风速
+  // let windValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wind'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wind'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
 
-// }) //实时风量
-// let dlValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
+  // }) //实时风量
+  // let dlValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
 
-// }) //实时电流
-// let dyValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
+  // }) //实时电流
+  // let dyValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
 
-// }) //实时电压
-// let wsndValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wsnd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wsnd'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
+  // }) //实时电压
+  // let wsndValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wsnd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wsnd'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
 
-// }) //实时瓦斯浓度
-// let zdValue = computed(() => {
-//   return {
-//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Zd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Zd'] : '',
-//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-//   }
+  // }) //实时瓦斯浓度
+  // let zdValue = computed(() => {
+  //   return {
+  //     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Zd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Zd'] : '',
+  //     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+  //   }
 
-// }) //实时振动
+  // }) //实时振动
 
-let $emit = defineEmits(['handlerClose'])
+  let $emit = defineEmits(['handlerClose']);
 
+  //弹窗关闭
+  function handleCancel() {
+    $emit('handlerClose', false);
+  }
 
-//弹窗关闭
-function handleCancel() {
-  $emit('handlerClose', false)
-}
-
-watch(() => props.isShowModal, (newV, oldV) => {
-  visible.value = newV
-})
+  watch(
+    () => props.isShowModal,
+    (newV, oldV) => {
+      visible.value = newV;
+    }
+  );
 
-watch(() => props.warningMonitorRowIndex, (newV, oldV) => {
-  // if (props.rightColumns.length) {
-  //   let dataList: any[] = []
-  //   props.rightColumns.forEach((el) => {
-  //     if (el.dataIndex.startsWith('Fan')) {
-  //       if (newV == 0 && props.selectData[el.dataIndex.replace('Fan', 'Fan1')] != undefined) {
-  //         dataList.push({ label: el.title })
-  //       } else if (newV == 1 && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != '0') {
-  //         dataList.push({ label: el.title })
-  //       } else if (newV == 2 && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != '0') {
-  //         dataList.push({ label: el.title })
-  //       }
-  //     } else {
-  //       if (props.selectData[el.dataIndex] != undefined && props.selectData[el.dataIndex] != '0') {
-  //         dataList.push({ label: el.title })
-  //       }
-  //     }
-  //   })
-  //   faultList.value = dataList
-  //   abnormalNum.value = dataList.length
-  //   normalNum.value = props.rightColumns.length - dataList.length
-  //   console.log(dataList, 'dataList===')
-  // }
-  if (newV == 0) {
-    faultList.value = [
-      { label: '2025年7月12日,风速超限' },
-      { label: '2025年7月21日,风量波动' },
-      { label: '2025年8月4日,轴温偏高' },
-      { label: '2025年8月17日,径向振动过大' },
-      { label: '2025年8月23日,油温高' },
-      { label: '2025年8月26日,电机故障' },
-    ]
-  } else if (newV == 1) {
-    faultList.value = [
-      { label: '2025年8月2日,风速超限' },
-      { label: '2025年8月11日,振动过高' },
-      { label: '2025年8月24日,轴温偏高' },
-      { label: '2025年9月17日,径向振动过大' },
-      { label: '2025年9月23日,油温高' },
-      { label: '2025年9月26日,蝶阀故障' },
-    ]
-  } else {
-    faultList.value = [
-      { label: '2025年8月2日,风门故障' },
-      { label: '2025年8月11日,风量波动' },
-      { label: '2025年8月24日,轴温偏高' },
-      { label: '2025年9月17日,径向振动过大' },
-      { label: '2025年9月23日,变频故障反馈' },
-      { label: '2025年9月26日,电机故障' },
-    ]
-  }
-  abnormalNum.value = faultList.value.length
-  normalNum.value = Math.ceil(Math.random() * 10)
-}, { immediate: true })
+  watch(
+    () => props.warningMonitorRowIndex,
+    (newV, oldV) => {
+      // if (props.rightColumns.length) {
+      //   let dataList: any[] = []
+      //   props.rightColumns.forEach((el) => {
+      //     if (el.dataIndex.startsWith('Fan')) {
+      //       if (newV == 0 && props.selectData[el.dataIndex.replace('Fan', 'Fan1')] != undefined) {
+      //         dataList.push({ label: el.title })
+      //       } else if (newV == 1 && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != '0') {
+      //         dataList.push({ label: el.title })
+      //       } else if (newV == 2 && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != '0') {
+      //         dataList.push({ label: el.title })
+      //       }
+      //     } else {
+      //       if (props.selectData[el.dataIndex] != undefined && props.selectData[el.dataIndex] != '0') {
+      //         dataList.push({ label: el.title })
+      //       }
+      //     }
+      //   })
+      //   faultList.value = dataList
+      //   abnormalNum.value = dataList.length
+      //   normalNum.value = props.rightColumns.length - dataList.length
+      //   console.log(dataList, 'dataList===')
+      // }
+      if (newV == 0) {
+        faultList.value = [
+          { label: '2025年7月12日,风速超限' },
+          { label: '2025年7月21日,风量波动' },
+          { label: '2025年8月4日,轴温偏高' },
+          { label: '2025年8月17日,径向振动过大' },
+          { label: '2025年8月23日,油温高' },
+          { label: '2025年8月26日,电机故障' },
+        ];
+      } else if (newV == 1) {
+        faultList.value = [
+          { label: '2025年8月2日,风速超限' },
+          { label: '2025年8月11日,振动过高' },
+          { label: '2025年8月24日,轴温偏高' },
+          { label: '2025年9月17日,径向振动过大' },
+          { label: '2025年9月23日,油温高' },
+          { label: '2025年9月26日,蝶阀故障' },
+        ];
+      } else {
+        faultList.value = [
+          { label: '2025年8月2日,风门故障' },
+          { label: '2025年8月11日,风量波动' },
+          { label: '2025年8月24日,轴温偏高' },
+          { label: '2025年9月17日,径向振动过大' },
+          { label: '2025年9月23日,变频故障反馈' },
+          { label: '2025年9月26日,电机故障' },
+        ];
+      }
+      abnormalNum.value = faultList.value.length;
+      normalNum.value = Math.ceil(Math.random() * 10);
+    },
+    { immediate: true }
+  );
 </script>
 
 <style lang="less" scoped>

+ 2 - 2
src/views/vent/monitorManager/fanLocalMonitor/fanLocal.data.ts

@@ -4204,8 +4204,8 @@ export const GAS_DISCHARGE_DEFAULT_CONFIG: GasDischargeConfig = {
   ratedAirVolume: 400,
   frequencyK: 1.0,
   normalFrequencyHz: 29,
-  decayFactor: 0.32,
-  crossSection: 8,
+  decayFactor: 0.82,
+  crossSection: 7,
   maxWindSpeed: 4.0,
   minWindSpeed: 0.25,
   warningThreshold: 0.8,

+ 12 - 12
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -525,7 +525,7 @@
       <div v-if="controlType == 'dischargeGas'">
         <div class="vent-flex-row input-box">
           <div class="label">设置瓦斯超限浓度:</div>
-          <a-input-number size="small" v-model:value="gasWarningVal1" :min="0" :max="0.8" :step="0.01" />
+          <a-input-number size="small" v-model:value="gasWarningVal1" :min="0" :max="1.8" :step="0.01" />
         </div>
       </div>
       <div v-if="controlType == 'supplyAir'">
@@ -627,7 +627,7 @@
     FAN_FREQ_STEP: 0.1,
     // 瓦斯报警值常量
     GAS_WARNING_VAL_DEFAULT: 0.6,
-    GAS_WARNING_VAL1_DEFAULT: 0.8,
+    GAS_WARNING_VAL1_DEFAULT: 1.48,
     // 设备类型/字典常量
     DEVICE_TYPE_FANLOCAL: 'fanlocal',
     DICT_CODE_FANLOCALTYPE: 'fanlocaltype',
@@ -1615,7 +1615,7 @@
         openModal2(true, {});
       } else if (handType === 'dischargeGas') {
         modalIsShow.value = false;
-        autoMode.value = false;
+        autoMode.value = true;
         openModal3(true, {});
       } else if (handType === 'remote') {
         if (control === 'Fan1remote') {
@@ -1721,15 +1721,15 @@
 
   onMounted(() => {
     // 定时器自动启动排放仿真:屏幕居中红色大字提示1s后进入模拟
-    setTimeout(() => {
-      autoMode.value = true;
-      showAutoAlert.value = true;
-      // 提示消失后再打开模拟弹窗
-      setTimeout(() => {
-        showAutoAlert.value = false;
-        openModal3(true, {});
-      }, 3000);
-    }, 10000);
+    // setTimeout(() => {
+    //   autoMode.value = true;
+    //   showAutoAlert.value = true;
+    //   // 提示消失后再打开模拟弹窗
+    //   setTimeout(() => {
+    //     showAutoAlert.value = false;
+    //     openModal3(true, {});
+    //   }, 3000);
+    // }, 10000);
 
     const { query } = unref(currentRoute);
     if (query['deviceType']) devicekind.value = query['deviceType'] as string;