Browse Source

[Feat 0000] 新增均压与低氧模型

hongrunxia 1 week ago
parent
commit
b5a2de9aa7

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
 #VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
-VITE_PROXY = [["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"]]
+VITE_PROXY = [["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/tun2D"]]
 # VITE_PROXY = [["/jeecgsystem","http://192.168.183.88:9999"],["/upload","http://192.168.183.88:9999/upload"],["/documents", "http://192.168.183.88:9050"],["/modelreq", "http://192.168.183.88:9999"],["/webRtc", "http://192.168.183.88:8051"]]
 # VITE_PROXY = [["/jeecgsystem","http://10.10.150.72:9999"],["/upload","http://localhost:3300/upload"],["/documents", "http://10.10.150.72:9050"],["/modelreq", "http://10.10.150.72:9999"],["/webRtc", "http://192.168.183.216:8051"]]
 #VITE_PROXY = [["/jeecgsystem","http://192.168.1.8:9999"],["/upload","http://localhost:3300/upload"]]

+ 195 - 208
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHome.vue

@@ -78,8 +78,8 @@
             <template #container>
               <div class="overflow-y-auto max-h-300px">
                 <template v-for="monitor in safetyMonitorData" :key="monitor.deviceId">
-                  <div class="parameter-title group-parameter-title">
-                    <SvgIcon class="icon" size="14" name="fiber-title" />
+                  <div class="parameter-title group-parameter-title"
+                    ><SvgIcon class="icon" size="14" name="fiber-title" />
                     <span>{{ monitor.strinstallpos }}</span>
                   </div>
                   <div class="input-box">
@@ -99,8 +99,8 @@
             <template #container>
               <div class="overflow-y-auto max-h-400px">
                 <template v-for="monitor in windowMonitorData" :key="monitor.deviceId">
-                  <div class="parameter-title group-parameter-title">
-                    <SvgIcon class="icon" size="14" name="fiber-title" />
+                  <div class="parameter-title group-parameter-title"
+                    ><SvgIcon class="icon" size="14" name="fiber-title" />
                     <span>风窗:{{ monitor.strinstallpos }}</span>
                   </div>
                   <div class="input-box">
@@ -112,8 +112,8 @@
                   </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" />
+                  <div class="parameter-title group-parameter-title"
+                    ><SvgIcon class="icon" size="14" name="fiber-title" />
                     <span>局扇:{{ monitor.strinstallpos }}</span>
                   </div>
                   <div class="input-box">
@@ -133,234 +133,221 @@
   </a-spin>
 </template>
 <script setup lang="ts">
-import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
-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, monitorParam, windrectParam } from '../balancePress.data';
-import { list, submit, subList } from '../balancePress.api';
-import { message } from 'ant-design-vue';
-import { get } from 'lodash-es';
+  import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
+  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, monitorParam, windrectParam } from '../balancePress.data';
+  import { list, submit, subList } from '../balancePress.api';
+  import { message } from 'ant-design-vue';
+  import { get } from 'lodash-es';
 
-const props = defineProps({
-  deviceId: {
-    type: String,
-    require: true,
-  },
-});
+  const props = defineProps({
+    deviceId: {
+      type: String,
+      require: true,
+    },
+  });
 
-const loading = ref(false);
+  const loading = ref(false);
 
-// 默认初始是第一行
-const isAutoControl = ref('1');
+  // 默认初始是第一行
+  const isAutoControl = ref('1');
 
-// 监测数据
-const selectData = reactive({
-  frontRearDP: '-',
-  sourcePressure: '-',
-  fault: '-',
-});
+  // 监测数据
+  const selectData = reactive({
+    frontRearDP: '-',
+    sourcePressure: '-',
+    fault: '-',
+  });
 
-const changeType = (isAutoControl) => {
-  isAutoControl;
-  //
-};
-const formData = ref({
-  coMaxStart: 0,
-  o2MinStart: 0,
-  coRiseStart: 0,
-  o2DownStart: 0,
-  windowAreaSetGrad: 0,
-  windowSetTime: 0,
-  windowMinArea: 0,
-  windowAreaDef: 0,
-  setMinTime: 0,
-  coEnd: 0,
-  coTimeEnd: 0,
-  o2End: 0,
-  o2TimeEnd: 0,
-});
-const safetyMonitorData = ref<any[]>([]);
-const fanlocalMonitorData = ref<any[]>([]);
-const windowMonitorData = ref<any[]>([]);
-const windrectMonitorData = ref<any[]>([]);
+  const changeType = (isAutoControl) => {
+    isAutoControl;
+    //
+  };
 
-// https获取监测数据
-let timer: any = null;
-function getMonitor(flag?) {
-  if (Object.prototype.toString.call(timer) === '[object Null]') {
-    timer = setTimeout(
-      async () => {
-        if (props.deviceId) {
-          const data = await getDataSource(props.deviceId);
-          Object.assign(selectData, data);
-          updateText(selectData);
-        }
-        if (timer) {
-          timer = null;
-        }
-        await getMonitor();
-        loading.value = false;
-      },
-      flag ? 0 : 1000
-    );
+  // https获取监测数据
+  let timer: any = null;
+  function getMonitor(flag?) {
+    if (Object.prototype.toString.call(timer) === '[object Null]') {
+      timer = setTimeout(
+        async () => {
+          if (props.deviceId) {
+            const data = await getDataSource(props.deviceId);
+            Object.assign(selectData, data);
+            updateText(selectData);
+          }
+          if (timer) {
+            timer = null;
+          }
+          await getMonitor();
+          loading.value = false;
+        },
+        flag ? 0 : 1000
+      );
+    }
   }
-}
-
-
 
-async function getDataSource(systemID) {
-  const res = await list({ devicetype: 'sys', systemID });
-  const result = res.msgTxt;
-  safetyMonitorData.value = [];
-  fanlocalMonitorData.value = [];
-  windowMonitorData.value = [];
-  windrectMonitorData.value = [];
-  result.forEach((item) => {
-    if (item.type.startsWith('safetymonitor') || item.type.startsWith('avgpressure_lowoxygen')) {
-      safetyMonitorData.value.push(...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.push(...item.datalist);
-    }
-    if (item.type.startsWith('window')) {
-      windowMonitorData.value.push(...item.datalist);
-    }
-    if (item.type.startsWith('windrect')) {
-      windrectMonitorData.value.push(...item.datalist);
-    }
-  });
-}
+  const safetyMonitorData = ref<any[]>([]);
+  const fanlocalMonitorData = ref<any[]>([]);
+  const windowMonitorData = ref<any[]>([]);
+  const windrectMonitorData = ref<any[]>([]);
 
-// 喷粉操作
-async function onSubmit() {
-  let res = await submit(formData.value)
-  if (res.code == 500) {
-    message.success(res.message);
-  } else {
-    initParamList()
-    message.success('提交成功');
+  async function getDataSource(systemID) {
+    const res = await list({ devicetype: 'sys', systemID });
+    const result = res.msgTxt;
+    safetyMonitorData.value = [];
+    fanlocalMonitorData.value = [];
+    windowMonitorData.value = [];
+    windrectMonitorData.value = [];
+    result.forEach((item) => {
+      if (item.type.startsWith('safetymonitor') || item.type.startsWith('avgpressure_lowoxygen')) {
+        safetyMonitorData.value.push(...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.push(...item.datalist);
+      }
+      if (item.type.startsWith('window')) {
+        windowMonitorData.value.push(...item.datalist);
+      }
+      if (item.type.startsWith('windrect')) {
+        windrectMonitorData.value.push(...item.datalist);
+      }
+    });
   }
-}
 
-//获取低氧参数监测返显列表
-async function initParamList() {
-  let res = await subList()
-  if (res && res.records.length != 0) {
-    formData.value = res.records[0]
+  // 喷粉操作
+  async function onSubmit() {
+    let res = await submit(formData.value);
+    if (res.code == 500) {
+      message.success(res.message);
+    } else {
+      initParamList();
+      message.success('提交成功');
+    }
   }
-}
 
-watch(
-  () => props.deviceId,
-  (newVal, oldVal) => {
-    if (newVal && oldVal != undefined) {
-      setModelType('balancePressBase');
+  //获取低氧参数监测返显列表
+  async function initParamList() {
+    let res = await subList();
+    if (res && res.records.length != 0) {
+      formData.value = res.records[0];
     }
-    loading.value = true;
-    //     loading.value = true;
   }
-);
 
+  watch(
+    () => props.deviceId,
+    (newVal, oldVal) => {
+      if (newVal && oldVal != undefined) {
+        setModelType('balancePressBase');
+      }
+      loading.value = true;
+    }
+  );
 
+  const formData = ref({
+    coMaxStart: 0,
+    o2MinStart: 0,
+    coRiseStart: 0,
+    o2DownStart: 0,
+    windowAreaSetGrad: 0,
+    windowSetTime: 0,
+    windowMinArea: 0,
+    windowAreaDef: 0,
+    setMinTime: 0,
+    coEnd: 0,
+    coTimeEnd: 0,
+    o2End: 0,
+    o2TimeEnd: 0,
+  });
 
-onBeforeMount(() => { });
+  onBeforeMount(() => {});
 
-onMounted(() => {
-  loading.value = true;
-  mountedThree().then(async () => {
-    await setModelType('balancePressTun'); //balancePressBase
-    loading.value = false;
-    timer = null;
-    await initParamList()
-    await getMonitor(true);
-    play('startSmoke', 'top', 30, 'open', 0);
+  onMounted(() => {
+    loading.value = true;
+    mountedThree().then(async () => {
+      await setModelType('balancePressTun'); //balancePressBase
+      loading.value = false;
+      timer = null;
+      await initParamList();
+      await getMonitor(true);
+      play('startSmoke', 'top', 30, 'open', 0);
+    });
   });
-});
 
-onUnmounted(() => {
-  destroy();
-  if (timer) {
-    clearTimeout(timer);
-  }
-});
+  onUnmounted(() => {
+    destroy();
+    if (timer) {
+      clearTimeout(timer);
+    }
+  });
 </script>
 <style lang="less" scoped>
-@import '/@/design/vent/modal.less';
-@import '../../comment/less/workFace.less';
-@ventSpace: zxm;
-
-.monitor-container {
-  margin-top: 60px;
-}
-
-.lr {
-  width: 340px !important;
-}
-
-.auto-control {
-  padding: 10px 8px;
-  margin: 0 4px 4px 4px;
-  border-radius: 4px;
-  border: 1px solid #ffffff05;
-  background-image: linear-gradient(to left, #39deff15, #3977e500, #39deff15);
-}
-
-.divider-line {
-  position: relative;
-  color: aqua;
-  padding-left: 20px;
-  font-size: 14px;
-
-  &::before {
-    position: absolute;
-    content: '';
-    display: block;
-    top: 10px;
-    left: 0;
-    height: 1px;
-    width: 15px;
-    background-color: #ffffff33;
+  @import '/@/design/vent/modal.less';
+  @import '../../comment/less/workFace.less';
+  @ventSpace: zxm;
+  .monitor-container {
+    margin-top: 60px;
   }
-
-  &::after {
-    position: absolute;
-    content: '';
-    display: block;
-    top: 10px;
-    right: 0;
-    height: 1px;
-    width: calc(100% - 85px);
-    background-color: #ffffff33;
+  .lr {
+    width: 340px !important;
   }
-}
-
-.input-value {
-  width: 120px !important;
-}
-
-.unit {
-  text-align: right;
-}
-
-.btn-box {
-  margin: 10px 4px;
-
-  .btn1 {
-    padding: 4px 0;
+  .auto-control {
+    padding: 10px 8px;
+    margin: 0 4px 4px 4px;
+    border-radius: 4px;
+    border: 1px solid #ffffff05;
+    background-image: linear-gradient(to left, #39deff15, #3977e500, #39deff15);
+  }
+  .divider-line {
+    position: relative;
+    color: aqua;
+    padding-left: 20px;
+    font-size: 14px;
+    &::before {
+      position: absolute;
+      content: '';
+      display: block;
+      top: 10px;
+      left: 0;
+      height: 1px;
+      width: 15px;
+      background-color: #ffffff33;
+    }
+    &::after {
+      position: absolute;
+      content: '';
+      display: block;
+      top: 10px;
+      right: 0;
+      height: 1px;
+      width: calc(100% - 85px);
+      background-color: #ffffff33;
+    }
+  }
+  .input-value {
+    width: 120px !important;
+  }
+  .unit {
+    text-align: right;
+  }
+  .btn-box {
+    margin: 10px 4px;
+    .btn1 {
+      padding: 4px 0;
+    }
   }
-}
 
-:deep(.@{ventSpace}-tabs-tabpane-active) {
-  overflow: auto;
-}
+  :deep(.@{ventSpace}-tabs-tabpane-active) {
+    overflow: auto;
+  }
 
-:deep(.@{ventSpace}-input-number) {
-  border-color: #ffffff88 !important;
-}
+  :deep(.@{ventSpace}-input-number) {
+    border-color: #ffffff88 !important;
+  }
 </style>

+ 15 - 7
src/views/vent/monitorManager/windowMonitor/components/modal.vue

@@ -5,48 +5,56 @@
         <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
         <div class="warning-text">您是否要进行{{ title }}操作?</div>
       </div>
-      <template v-if="type == '1' || type == '2' || type.startsWith('sameSetValue') || type.startsWith('middleSetValue')">
+      <template
+        v-if="type == '1' || type == '2' || type.startsWith('sameSetValue') || type.startsWith('middleSetValue') || type.startsWith('rearSetValue')"
+      >
         <div class="vent-flex-row input-box">
           <div class="label">{{ title.includes('角度') ? '风窗角度:' : '风窗面积:' }}</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type == '7'">
+      <template v-else-if="type == '7'">
         <div class="vent-flex-row input-box">
           <div class="label">风窗目标风量(m³/min):</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type == '8'">
+      <template v-else-if="type == '8'">
         <div class="vent-flex-row input-box">
           <div class="label">风窗目标风量(m³/min):</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type == 'ldkzStart'">
+      <template v-else-if="type == 'ldkzStart'">
         <div class="vent-flex-row input-box">
           <div class="label">瓦斯超限浓度(%):</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type.startsWith('frontSetValue')">
+      <template v-else-if="type.startsWith('frontSetValue')">
         <div class="vent-flex-row input-box">
           <div class="label">风窗角度:</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type.startsWith('air')">
+      <template v-else-if="type.startsWith('air')">
         <div class="vent-flex-row input-box">
           <div class="label">风窗过风量(m³/min):</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
-      <template v-if="type.startsWith('COTest')">
+      <template v-else-if="type.startsWith('COTest')">
         <div class="vent-flex-row input-box">
           <div class="label">一氧化碳(ppm):</div>
           <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
         </div>
       </template>
+      <template v-else>
+        <div class="vent-flex-row input-box">
+          <div class="label">{{ title }}:</div>
+          <a-input-number size="small" placeholder="0" :min="0" v-model:value="data" />
+        </div>
+      </template>
       <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
         <div class="label">操作密码:</div>
         <a-input size="small" type="password" v-model:value="passWord" />

+ 6 - 1
src/views/vent/monitorManager/windowMonitor/index.vue

@@ -50,7 +50,7 @@
           <div v-if="hasPermission('window:showAngleArea')" class="button-box" @click="setAngle(1)">设定风窗面积</div>
         </div>
         <div v-if="hasPermission('window:sameSet')" class="button-box" @click="setControl('sameSetValue', '风窗面积设置')">设定风窗面积</div>
-        <div v-if="hasPermission('window:COTest')" class="button-box" @click="setControl('COTest', 'CO调控预测')">CO调控预测</div>
+        <div class="button-box" @click="setControl('COTest', 'CO调控预测')">CO调控预测</div>
       </div>
       <div class="top-right row">
         <div v-if="hasPermission('window:zhldkz')" class="button-box" @click="setControl('autoRun', '开启自主调控')">开启自主调控</div>
@@ -569,10 +569,15 @@
             content: `一氧化碳超限,可能存在火灾隐患,是否开启${selectData.value.strinstallpos},使有毒烟气短路?`,
             onOk: () => {
               message.success('指令已下发成功!');
+              handleCancel();
             },
             onCancel: () => handleCancel(),
           });
           return;
+        } else {
+          message.success('一氧化碳在正常范围内,无需操作!');
+          handleCancel();
+          return;
         }
       } else {
         data.paramcode = handlerState;