Browse Source

[Feat 0000] 均压相关页面进行了对接

houzekong 4 days ago
parent
commit
9d3d5dc5a6

+ 31 - 11
src/views/vent/monitorManager/balancePressMonitor/balancePress.data.ts

@@ -41,20 +41,26 @@ export const sensorColumns: BasicColumn[] = [
     align: 'center',
   },
 ];
+
 export const windowParam = [
   {
-    title: '当前面积',
-    code: '',
+    title: '前窗面积',
+    code: 'readData.forntArea',
+    unit: '㎡',
+  },
+  {
+    title: '后窗面积',
+    code: 'readData.rearArea',
     unit: '㎡',
   },
   {
-    title: '过风风量',
-    code: '',
+    title: '过风量',
+    code: 'readData.fWindowM3',
     unit: 'm³/min',
   },
   {
     title: '风窗压差',
-    code: '',
+    code: 'readData.frontRearDP',
     unit: 'Pa',
   },
 ];
@@ -62,20 +68,34 @@ export const windowParam = [
 export const localFanParam = [
   {
     title: '风机频率',
-    code: '',
+    code: 'FanfHz',
     unit: 'Hz',
   },
   {
+    title: '供风量',
+    code: 'm3_merge',
+    unit: 'm³/min',
+  },
+  {
     title: '运行风机',
-    code: '',
+    code: 'FanRun',
     unit: '',
   },
-  {
-    title: '供风量',
-    code: '',
-    unit: 'm³/min',
+];
+
+export const monitorParam = [
+  // {
+  //   title: '安装位置',
+  //   code: 'strinstallpos',
+  //   unit: '',
+  // },
+  {
+    title: '监测值',
+    code: 'readData.ss_analog_value',
+    unit: '',
   },
 ];
+
 export const settingParam1 = [
   {
     title: 'CO浓度限值',

+ 62 - 27
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHome.vue

@@ -36,7 +36,7 @@
                 </div>
               </div>
               <div class="btn-box" style="text-align: center">
-                <div class="btn btn1">提交</div>
+                <div class="btn btn1" @click="onSubmit">提交</div>
               </div>
             </template>
           </ventBox1>
@@ -48,29 +48,52 @@
             <template #title>
               <div>CO与O2监测</div>
             </template>
-            <template #container> </template>
+            <template #container>
+              <template v-for="monitor in safetyMonitorData" :key="monitor.deviceId">
+                <div class="parameter-title group-parameter-title"
+                  ><SvgIcon class="icon" size="14" name="fiber-title" />
+                  <span>{{ monitor.strinstallpos }}</span>
+                </div>
+                <div class="input-box">
+                  <div v-for="(item, index) in monitorParam" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}</div>
+                    <div class="value" style="width: 50%">{{ get(monitor, item.code, '-') }}</div>
+                  </div>
+                </div>
+              </template>
+            </template>
           </ventBox1>
           <ventBox1 class="vent-margin-t-10">
             <template #title>
               <div>设备监测详情</div>
             </template>
             <template #container>
-              <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="fiber-title" /><span>风窗</span></div>
-              <div class="input-box">
-                <div v-for="(item, index) in windowParam" class="input-item" :key="index">
-                  <div class="title">{{ item.title }}</div>
-                  <div class="value">-</div>
-                  <div class="unit">{{ item.unit }}</div>
+              <template v-for="monitor in windowMonitorData" :key="monitor.deviceId">
+                <div class="parameter-title group-parameter-title"
+                  ><SvgIcon class="icon" size="14" name="fiber-title" />
+                  <span>风窗:{{ monitor.strinstallpos }}</span>
                 </div>
-              </div>
-              <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="fiber-title" /><span>均压局扇</span></div>
-              <div class="input-box">
-                <div v-for="(item, index) in localFanParam" class="input-item" :key="index">
-                  <div class="title">{{ item.title }}</div>
-                  <div class="value">-</div>
-                  <div class="unit">{{ item.unit }}</div>
+                <div class="input-box">
+                  <div v-for="(item, index) in windowParam" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}</div>
+                    <div class="value">{{ get(monitor, item.code, '-') }}</div>
+                    <div class="unit">{{ item.unit }}</div>
+                  </div>
                 </div>
-              </div>
+              </template>
+              <template v-for="monitor in fanlocalMonitorData" :key="monitor.deviceId">
+                <div class="parameter-title group-parameter-title"
+                  ><SvgIcon class="icon" size="14" name="fiber-title" />
+                  <span>局扇:{{ monitor.strinstallpos }}</span>
+                </div>
+                <div class="input-box">
+                  <div v-for="(item, index) in localFanParam" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}</div>
+                    <div class="value">{{ get(monitor, item.code, '-') }}</div>
+                    <div class="unit">{{ item.unit }}</div>
+                  </div>
+                </div>
+              </template>
             </template>
           </ventBox1>
         </div>
@@ -83,8 +106,10 @@
   import ventBox1 from '/@/components/vent/ventBox1.vue';
   import { SvgIcon } from '/@/components/Icon';
   import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
-  import { settingParam1, settingParam2, settingParam3, windowParam, localFanParam } from '../balancePress.data';
+  import { settingParam1, settingParam2, settingParam3, windowParam, localFanParam, monitorParam, o2Param } from '../balancePress.data';
   import { list } from '../balancePress.api';
+  import { message } from 'ant-design-vue';
+  import { get } from 'lodash-es';
 
   const props = defineProps({
     deviceId: {
@@ -111,7 +136,7 @@
   };
 
   // https获取监测数据
-  let timer: null | NodeJS.Timeout = null;
+  let timer: any = null;
   function getMonitor(flag?) {
     if (Object.prototype.toString.call(timer) === '[object Null]') {
       timer = setTimeout(
@@ -132,23 +157,34 @@
     }
   }
 
+  const safetyMonitorData = ref<any[]>([]);
+  const fanlocalMonitorData = ref<any[]>([]);
+  const windowMonitorData = ref<any[]>([]);
+
   async function getDataSource(systemID) {
     const res = await list({ devicetype: 'sys', systemID });
     const result = res.msgTxt;
     result.forEach((item) => {
-      if (item.type === 'sys') {
-        // 硐室基本
-        // fiberDataSource.value = item.filter((data: any) => {
-        //   const readData = data.readData;
-        //   return Object.assign(data, readData);
-        // })
+      if (item.type.startsWith('safetymonitor')) {
+        safetyMonitorData.value = item.datalist;
+      }
+      if (item.type.startsWith('fanlocal')) {
+        item.datalist.forEach((e) => {
+          const f1Run = e.readData.Fan1StartStatus == '1';
+          e.FanfHz = f1Run ? e.readData.Fan1_Frequency : e.readData.Fan2_Frequency;
+          e.FanRun = f1Run ? '1#风机' : '2#风机';
+        });
+        fanlocalMonitorData.value = item.datalist;
+      }
+      if (item.type.startsWith('window')) {
+        windowMonitorData.value = item.datalist;
       }
     });
   }
 
   // 喷粉操作
-  function handleDust() {
-    //
+  function onSubmit() {
+    message.success('提交成功');
   }
 
   watch(
@@ -180,7 +216,6 @@
     destroy();
     if (timer) {
       clearTimeout(timer);
-      timer = undefined;
     }
   });
 </script>

+ 0 - 2
src/views/vent/monitorManager/safetyMonitor/index.vue

@@ -311,11 +311,9 @@
       if (deviceType.value == 'safetymonitor') {
         // 如果是安全监控的数据时需要过滤常见设备数据,根据设定的常用安全监控字典去匹配
         let dictCodes = getDictItemsByCode('safetynormal');
-        console.log(dictCodes, '111-----------');
         const searchForm = formData.getFieldsValue();
 
         if (searchForm && searchForm['dataTypeName'] && dictCodes && dictCodes.length > 0) {
-          console.log(searchForm, '000---------');
           const tempData = [];
           const tempData1 = [];
           for (let i = 0; i < dataArr.length; i++) {