Prechádzať zdrojové kódy

1. 保德新增一套防火门模型
2. 主风机添加远程就地控制模式
3. 大柳塔注氮bug修复

hongrunxia 1 týždeň pred
rodič
commit
166950286f

+ 11 - 8
src/views/vent/monitorManager/compressor/components/nitrogenHome_dltj.vue

@@ -586,15 +586,18 @@
       const airCompressor = { readTime: monitorData.value['readTime'].substring(11) };
       if (JSON.stringify(dataSoreDatas) === '{}') {
         airCompressor[`FluxTotal`] = monitorData.value['FluxTotal'] || 0;
-      } else {
-        airCompressor[`InputFlux`] = Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']) || null;
-        if (!airCompressor[`InputFlux`]) airCompressor[`InputFlux`] = monitorData.value['InputFlux'];
-        monitorData.value['RunTime31'] = (Number(monitorData.value['RunTime31']) / 24).toFixed(0);
-        monitorData.value['RunTime41'] = (Number(monitorData.value['RunTime41']) / 24).toFixed(0);
-        monitorData.value['RunTime32'] = (Number(monitorData.value['RunTime32']) / 24).toFixed(0);
-        monitorData.value['RunTime42'] = (Number(monitorData.value['RunTime42']) / 24).toFixed(0);
-        monitorData.value['FluxTotal'] = airCompressor[`InputFlux`];
       }
+      // airCompressor[`InputFlux`] = Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']) || null;
+      // if (!airCompressor[`InputFlux`]) {
+      //   airCompressor[`InputFlux`] = monitorData.value['InputFlux'];
+      // }
+      airCompressor[`InputFlux`] =
+        monitorData.value['InputFlux'] || Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']);
+      monitorData.value['RunTime31'] = (Number(monitorData.value['RunTime31']) / 24).toFixed(0);
+      monitorData.value['RunTime41'] = (Number(monitorData.value['RunTime41']) / 24).toFixed(0);
+      monitorData.value['RunTime32'] = (Number(monitorData.value['RunTime32']) / 24).toFixed(0);
+      monitorData.value['RunTime42'] = (Number(monitorData.value['RunTime42']) / 24).toFixed(0);
+      monitorData.value['FluxTotal'] = airCompressor[`InputFlux`];
       //图表数据
       if (dataArr.length <= 5) {
         dataArr.push(airCompressor);

+ 6 - 6
src/views/vent/monitorManager/fireDoorMonitor/fireDoor.threejs.fire.ts

@@ -78,13 +78,13 @@ class FireDoor {
 
   /* 提取风门序列帧,初始化前后门动画 */
   initAnimation() {
-    const fireGroup = this.group.children[0]?.getObjectByName('fire-door');
+    const fireGroup = this.group.children[0]?.getObjectByName('Fire-door');
     if (fireGroup) {
       const tracks = fireGroup.animations[0].tracks;
 
       this.mixers = new THREE.AnimationMixer(fireGroup);
 
-      const door = new THREE.AnimationClip('door', 22, tracks);
+      const door = new THREE.AnimationClip('door', 100, tracks);
       const frontClipAction = this.mixers.clipAction(door, fireGroup);
       frontClipAction.clampWhenFinished = true;
       frontClipAction.loop = THREE.LoopOnce;
@@ -101,8 +101,8 @@ class FireDoor {
           handler = () => {
             this.clipActionArr.door.paused = true;
             this.clipActionArr.door.reset();
-            this.clipActionArr.door.time = 1.2;
-            this.clipActionArr.door.timeScale = timeScale;
+            this.clipActionArr.door.time = 1.7;
+            this.clipActionArr.door.timeScale = -timeScale;
             // this.clipActionArr.door.clampWhenFinished = true;
             this.clipActionArr.door.play();
             this.fmClock.start();
@@ -115,8 +115,8 @@ class FireDoor {
           handler = () => {
             this.clipActionArr.door.paused = true;
             this.clipActionArr.door.reset(); //
-            this.clipActionArr.door.time = 4;
-            this.clipActionArr.door.timeScale = -timeScale;
+            this.clipActionArr.door.time = 0;
+            this.clipActionArr.door.timeScale = timeScale;
             // this.clipActionArr.door.clampWhenFinished = true;
             this.clipActionArr.door.play();
             this.fmClock.start();

+ 40 - 0
src/views/vent/monitorManager/fireDoorMonitor/fireDoor.threejs.ts

@@ -1,6 +1,7 @@
 import * as THREE from 'three';
 import UseThree from '../../../../utils/threejs/useThree';
 import FireDoor from './fireDoor.threejs.fire';
+import FireDoorF from './fireDoor.threejs.fireF';
 import { animateCamera } from '/@/utils/threejs/util';
 import useEvent from '../../../../utils/threejs/useEvent';
 import { useGlobSetting } from '/@/hooks/setting';
@@ -8,6 +9,7 @@ import { useGlobSetting } from '/@/hooks/setting';
 // 模型对象、 文字对象
 let model,
   fireDoor, //液压风门
+  fireDoorF, //液压风门
   group: THREE.Object3D,
   fmType = '';
 
@@ -23,6 +25,9 @@ const startAnimation = () => {
     if (fmType === 'fireDoor') {
       fireDoor?.mouseUpModel.call(fireDoor);
     }
+    if (fmType === 'fireDoorF') {
+      fireDoorF?.mouseUpModel.call(fireDoorF);
+    }
   });
 };
 
@@ -33,15 +38,22 @@ const mouseEvent = (event) => {
       if (fmType === 'fireDoor' && fireDoor) {
         fireDoor?.mousedownModel.call(fireDoor, intersects);
       }
+      if (fmType === 'fireDoorF' && fireDoorF) {
+        fireDoorF?.mousedownModel.call(fireDoorF, intersects);
+      }
     });
     // console.log('摄像头控制信息', model.orbitControls, model.camera);
   }
 };
 
 export const play = (handlerState, flag?) => {
+  debugger;
   if (fmType === 'fireDoor' && fireDoor) {
     return fireDoor.play.call(fireDoor, handlerState, flag);
   }
+  if (fmType === 'fireDoorF' && fireDoorF) {
+    return fireDoorF.play.call(fireDoorF, handlerState, flag);
+  }
 };
 
 // 切换风门类型
@@ -75,6 +87,29 @@ export const setModelType = (type) => {
           0.8
         );
       }, 300);
+    } else if (fmType === 'fireDoorF' && fireDoorF && fireDoorF.group) {
+      if (fireDoorF.clipActionArr.door) {
+        fireDoorF.clipActionArr.door.reset();
+        fireDoorF.clipActionArr.door.time = 0;
+        fireDoorF.clipActionArr.door.stop();
+      }
+      model.scene.remove(group);
+      model.startAnimation = fireDoorF.render.bind(fireDoorF);
+      group = fireDoorF.group;
+      group.rotation.y = 0;
+      const oldCameraPosition = { x: -1000, y: 100, z: 500 };
+      setTimeout(async () => {
+        resolve(null);
+        model.scene.add(fireDoorF.group);
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: -655.0169729333649, y: 47.24181078408825, z: -9.781926649842067 },
+          { x: -7.380506513422206, y: 47.24181078408821, z: -37.9244016972381 },
+          model,
+          0.8
+        );
+      }, 300);
     }
   });
 };
@@ -82,6 +117,8 @@ export const setModelType = (type) => {
 export const initCameraCanvas = async (playerVal1) => {
   if (fmType === 'fireDoor' && fireDoor) {
     return await fireDoor.initCamera.call(fireDoor, playerVal1);
+  } else if (fmType === 'fireDoorF' && fireDoorF) {
+    return await fireDoorF.initCamera.call(fireDoorF, playerVal1);
   }
 };
 const setControls = () => {
@@ -102,6 +139,9 @@ export const mountedThree = () => {
     model.camera.position.set(100, 0, 1000);
     fireDoor = new FireDoor(model);
     fireDoor.mountedThree();
+
+    fireDoorF = new FireDoorF(model);
+    fireDoorF.mountedThree();
     resolve(null);
     setControls();
     model.animate();

+ 20 - 15
src/views/vent/monitorManager/fireDoorMonitor/index.vue

@@ -205,7 +205,8 @@
   const MonitorDataTable = ref();
   let contrlValue = '';
   const playerRef = ref();
-  const deviceType = ref('door');
+  // const deviceType = ref('door');
+  const deviceType = ref('firedoor');
   const activeKey = ref('1'); // tab
   const loading = ref(false);
 
@@ -312,15 +313,18 @@
     if (!selectRow) return;
     loading.value = true;
     selectRowIndex.value = index;
-
     const baseData: any = deviceBaseList.value.find((baseData: any) => baseData.id === selectRow.deviceID);
     Object.assign(selectData, initData, selectRow, baseData);
-    isdoorOpenRunning = false; //开关门动作是否在进行
-    doorDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+    doorDeviceState = 1; //记录设备状态,为了与下一次监测数据做比较
     let type = 'fireDoor';
-    setModelType(type).then(async () => {
-      loading.value = false;
-    });
+    if (selectData.deviceType == 'door_fire') {
+      type = 'fireDoor';
+    } else if (selectData.deviceType == 'door_fire_h') {
+      type = 'fireDoorF';
+    }
+    await setModelType(type);
+    loading.value = false;
+    isdoorOpenRunning = true; //开关门动作是否在进行
     await getCamera(selectRow.deviceID, playerRef.value);
   }
 
@@ -369,12 +373,12 @@
     switch (handlerState) {
       case '1': // 打开前门
         if (selectData.doorOpen == '0' && selectData.doorClose == '1') {
-          data.paramcode = 'doorOpenCtr';
+          data.paramcode = 'frontGateOpen_S';
         }
         break;
       case '2': // 关闭前门
         if (selectData.doorOpen == '1' && selectData.doorClose == '0') {
-          data.paramcode = 'doorCloseCtr';
+          data.paramcode = 'frontGateClose_S';
         }
         break;
       case '7': // 远程与就地
@@ -404,11 +408,12 @@
   let isdoorOpenRunning = false; //开关门动作是否在进行
   // let isMidCloseRunning = false; //中间门动作是否在进行
   // 0 关闭 1 正在打开 2 打开 3正在关闭
-  let doorDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  let doorDeviceState = 1; //记录设备状态,为了与下一次监测数据做比较
   function monitorAnimation(selectData) {
     const timeScale = 0.005;
-
-    if (selectData.doorOpen == '1' && selectData.doorClose == '0' && !isdoorOpenRunning) {
+    debugger;
+    // 打开
+    if (selectData.frontGateOpen == '1' && !isdoorOpenRunning) {
       isdoorOpenRunning = true;
       if (doorDeviceState != 1) {
         // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
@@ -417,9 +422,9 @@
         doorIsOpen.value = true;
       }
     }
-
-    if (selectData.doorOpen == '0' && selectData.doorClose == '1' && !isdoorOpenRunning) {
-      isdoorOpenRunning = true;
+    // 关闭
+    if (selectData.frontGateOpen == '0' && isdoorOpenRunning) {
+      isdoorOpenRunning = false;
       if (doorDeviceState != 0) {
         // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
         play(2, timeScale);

+ 57 - 7
src/views/vent/monitorManager/mainFanMonitor/index.vue

@@ -94,6 +94,23 @@
     <div id="main3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
     <FanEchrats id="fan-echarts" :chartData="selectData" style="position: absolute; z-index: -1" />
   </div>
+  <!-- v-if="hasPermission('btn:remote')" -->
+  <div class="top-right">
+    <div class="control-title">控制模式:</div>
+    <a-radio-group v-model:value="selectData.autoRoManual">
+      <template v-for="(item, index) in modelList" :key="index">
+        <a-radio :value="item.value" :disabled="true">{{ item.text }}</a-radio>
+      </template>
+    </a-radio-group>
+    <!-- <div class="button-box" v-for="(item, index) in modelList" @click="handleOk('remote', item.value)" :key="index">{{ item.text }}</div> -->
+    <div
+      class="button-box"
+      v-for="(item, index) in modelList"
+      @click="showModal({ key: 'remote', value: '控制模式', ctrlValue: item.value })"
+      :key="index"
+      >{{ item.text }}</div
+    >
+  </div>
 
   <div class="scene-box" style="z-index: 999">
     <div class="title-text" style="position: absolute; z-index: 9999; width: 100%; text-align: center">{{
@@ -106,6 +123,7 @@
       </template>
       <!-- <div class="button-box" v-for="(item, index) in modalTypeArr.centerBtnArr" :key="index" @click="showModal(item)">{{ item.value }}</div> -->
     </div>
+    <!-- 控制模式 -->
 
     <div v-if="!faultShow" class="data-show-box">
       <div class="data-item">
@@ -150,7 +168,7 @@
           </div>
         </div>
       </div>
-      <div class="data-item">
+      <div class="data-item" style="margin-top: 8px">
         <div class="item-header">设备报警</div>
         <div class="item-container">
           <div class="tab">
@@ -576,6 +594,7 @@
   import { useGlobSetting } from '/@/hooks/setting';
   import { usePermission } from '/@/hooks/web/usePermission';
   import { cloneDeep } from 'lodash-es';
+  import { getDictItems } from '/@/api/common/api';
 
   const globalConfig = inject('globalConfig');
   const HistoryTable =
@@ -593,6 +612,8 @@
   const scroll = reactive({
     y: 180,
   });
+  const modelList = ref<{ text: string; value: string }[]>([]);
+  let modeValue: null | string | number = null;
   const playerRef = ref();
   const isSimulation = true; // 是否模拟状态
   const MonitorDataTable = ref();
@@ -633,6 +654,7 @@
     Fan2FanPre: '-',
     Fan1FanPre: '-',
     otherInfo: '',
+    autoRoManual: null,
   });
 
   const deviceType = ref(selectData.deviceType);
@@ -961,14 +983,18 @@
         backMonitorIsShow.value = true;
         frontMonitorIsShow.value = false;
       }
-    }
-    if (modalType.value == 'frequency') {
+    } else if (modalType.value == 'frequency') {
       if (selectData['Fan1StartStatus'] == 1 && selectData['Fan2StartStatus'] == 0) {
         frequencyVal.value = selectData['Fan1FreqHz'];
       }
       if (selectData['Fan2StartStatus'] == 1 && selectData['Fan1StartStatus'] == 0) {
         frequencyVal.value = selectData['Fan2FreqHz'];
       }
+    } else if (modalType.value == 'remote') {
+      // 控制模式
+      if (obj['ctrlValue']) {
+        modeValue = obj['ctrlValue'];
+      }
     }
   };
 
@@ -985,7 +1011,7 @@
     }
   };
 
-  const handleOk = (flag?) => {
+  const handleOk = () => {
     if (passWord.value == '') {
       createMessage.warning('请输入密码!');
       return;
@@ -1240,6 +1266,15 @@
         start('CtrlFanReset').catch((err) => {
           createMessage.error(err.message);
         });
+      } else if (modalType.value == 'remote') {
+        // 远程就地控制
+        start('autoRoManualControl', modeValue)
+          .then(() => {
+            createMessage.success('指令下发成功');
+          })
+          .catch((err) => {
+            createMessage.error(err.message);
+          });
       }
     };
   };
@@ -1286,9 +1321,9 @@
     getDeviceBaseList();
   });
 
-  onMounted(() => {
+  onMounted(async () => {
     loading.value = true;
-
+    modelList.value = await getDictItems('mainFanModel');
     mountedThree(player1.value).then(async () => {
       // await setModelType('mainWindRect');
       getMonitor(true);
@@ -1406,7 +1441,15 @@
       }
     }
   }
-
+  .top-right {
+    position: absolute;
+    display: flex;
+    right: 0px;
+    top: 55px;
+    align-items: center;
+    color: #fff;
+    z-index: 1;
+  }
   .data-show-box {
     position: relative;
     display: flex;
@@ -1904,6 +1947,13 @@
     }
   }
 
+  :deep(.zxm-radio-disabled + span) {
+    color: #fff !important;
+  }
+  :deep(.zxm-radio-disabled .zxm-radio-inner::after) {
+    background-color: #127cb5 !important;
+  }
+
   ::v-deep(#LivePlayerBox) {
     display: flex;
     flex-direction: row;