Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 1 ngày trước cách đây
mục cha
commit
62ac373079

+ 33 - 33
src/hooks/system/useMethods.ts

@@ -57,40 +57,40 @@ export function useMethods() {
    * @param url
    */
   async function exportXlsPost(name, url, params, isXlsx = false) {
-     const key = 'updatable';
-     message.loading({ content: '正在导出,请稍等...', key });
-     defHttp
-       .post({ url: url, params: params, timeout: 1000 * 1000 }, { isTransformResponse: false })
-       .then((data) => {
-         debugger;
-         if (data.code == 200 && data.result) {
-           const messageArr = data.result.split('/');
-           const fileUrl = messageArr[messageArr.length - 1];
-           if (fileUrl) {
-             const baseApiUrl = glob.domainUrl;
-             // 下载文件
-             const a = document.createElement('a');
-             // 定义下载名称
-             a.download = name;
-             // 隐藏标签
-             a.style.display = 'none';
-             // 设置文件路径
-             a.href = `${baseApiUrl}/sys/common/static/${fileUrl}`;
-             // 将创建的标签插入dom
-             document.body.appendChild(a);
-             // 点击标签,执行下载
-             a.click();
-             // 将标签从dom移除
-             document.body.removeChild(a);
-             message.success({ content: '导出成功!', key, duration: 1 });
-           }
-         } else {
-           message.error({ content: '下载失败!', key, duration: 1 });
+    const key = 'updatable';
+    message.loading({ content: '正在导出,请稍等...', key });
+    defHttp
+      .post({ url: url, params: params, timeout: 1000 * 1000 }, { isTransformResponse: false })
+      .then((data) => {
+        debugger;
+        if (data.code == 200 && data.result) {
+          const messageArr = data.result.split('/');
+          const fileUrl = messageArr[messageArr.length - 1];
+          if (fileUrl) {
+            const baseApiUrl = glob.domainUrl;
+            // 下载文件
+            const a = document.createElement('a');
+            // 定义下载名称
+            a.download = name;
+            // 隐藏标签
+            a.style.display = 'none';
+            // 设置文件路径
+            a.href = `${baseApiUrl}/sys/common/static/${fileUrl}`;
+            // 将创建的标签插入dom
+            document.body.appendChild(a);
+            // 点击标签,执行下载
+            a.click();
+            // 将标签从dom移除
+            document.body.removeChild(a);
+            message.success({ content: '导出成功!', key, duration: 1 });
+          }
+        } else {
+          message.error({ content: '下载失败!', key, duration: 1 });
         }
-       })
-       .catch(() => {
-         message.error({ content: '下载失败!', key, duration: 1 });
-       });
+      })
+      .catch(() => {
+        message.error({ content: '下载失败!', key, duration: 1 });
+      });
   }
 
   async function exportXlsPost1(name, url, params, isXlsx = false) {

+ 93 - 33
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHomeBD.vue

@@ -89,7 +89,7 @@
         :visible="showModules"
       />
     </div>
-    <PasswordModal :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleResolve" @handle-cancel="handleReject" />
+    <PasswordModal z-index="2000" :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleResolve" @handle-cancel="handleReject" />
     <UpdatePassword @register="updatePwdRegister" @submit="handleChangePassword" />
     <!-- <BasicModal title="风门状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 20px" :show-ok-btn="false" @register="warnRegister2">
       {{ warnModalText2 }}
@@ -130,6 +130,7 @@
   import { getToken } from '/@/utils/auth';
   import { useUserStore } from '/@/store/modules/user';
   import { usePressControl } from '../hooks/useControl';
+  import dayjs from 'dayjs';
   // import { Config } from '../../../deviceManager/configurationTable/types';
 
   const props = defineProps({
@@ -282,21 +283,32 @@
   }
 
   let resolver: any = null;
+  let rejecter: any = null;
   function handleResolve(password) {
-    if (resolver) resolver(password);
+    if (resolver) {
+      resolver(password);
+    } else {
+      modalVisible.value = false;
+    }
     resolver = null;
+    rejecter = null;
   }
   function handleReject() {
-    modalVisible.value = false;
+    if (rejecter) {
+      rejecter();
+    } else {
+      modalVisible.value = false;
+    }
     resolver = null;
+    rejecter = null;
   }
 
   // const [warnRegister1, warnModal1] = useModal();
   // const [warnRegister2, warnModal2] = useModal();
   // const [warnRegister3, warnModal3] = useModal();
-  const warnModal1 = ref();
-  const warnModal2 = ref();
-  const warnModal3 = ref();
+  let warnModal1: { destroy: () => void } | null = null;
+  let warnModal2: { destroy: () => void } | null = null;
+  let warnModal3: { destroy: () => void } | null = null;
   // const warnModalText1 = ref('');
   // const warnModalText2 = ref('');
   // const warnModalText3 = ref('');
@@ -313,24 +325,49 @@
       if (data.cmd !== 'topic' || data.topic !== 'warn') return;
       if (!data.msgTxt) return;
 
-      const { info = '', type = '', avgPressLogId, date } = JSON.parse(data.msgTxt);
+      const { info = '', type = '', avgPressureLogId, date } = JSON.parse(data.msgTxt);
+      const datestr = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
       switch (type) {
         case 'o2':
-          if (warnModal1.value) break;
-          warnModal1.value = Modal.confirm({
+          // 如果已经存在报警模态框,则不需要处理
+          if (warnModal1) break;
+          warnModal1 = Modal.confirm({
             title: data.msgTitle,
-            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            content: h('div', { style: { color: '#fff' } }, [h('p', datestr), h('p', info)]),
             centered: true,
             okText: '下发调节指令',
             mask: true,
             class: 'balancePress',
-            async onOk() {
-              await autoControl(avgPressLogId);
-              warnModal1.value = null;
+            onOk() {
+              // 点击确定按钮后,执行调节指令。调节指令需要确认密码,所以需要先弹出密码框
+              return new Promise((resolve, reject) => {
+                modalVisible.value = true;
+                // 弹出密码框后,输入密码并验证成功则关闭密码弹窗和报警弹窗,失败则关闭密码弹窗但不关闭报警弹窗
+                resolver = (password) => {
+                  autoControl({ password, id: avePressSetting.value.id }, { avgPressLogId: avgPressureLogId })
+                    .then(() => {
+                      modalVisible.value = false;
+                      resolve(true);
+                      warnModal1?.destroy();
+                      warnModal1 = null;
+                    })
+                    .catch(() => {
+                      modalVisible.value = false;
+                      reject();
+                    });
+                };
+                // 弹出密码框取消操作则关闭密码弹窗但不关闭报警弹窗
+                rejecter = () => {
+                  modalVisible.value = false;
+                  reject();
+                };
+              });
             },
-            async onCancel() {
-              await cancelControl(avgPressLogId);
-              warnModal1.value = null;
+            onCancel() {
+              return cancelControl({}, { avgPressLogId: avgPressureLogId }).finally(() => {
+                warnModal1?.destroy();
+                warnModal1 = null;
+              });
             },
           });
           // warnModalText1.value = info;
@@ -340,49 +377,72 @@
         case 'pressure':
           // warnModalText1.value = info;
           // warnModal1.openModal();
-          if (warnModal1.value) break;
-          warnModal1.value = Modal.confirm({
+          if (warnModal1) break;
+          warnModal1 = Modal.confirm({
             title: data.msgTitle,
-            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            content: h('div', { style: { color: '#fff' } }, [h('p', datestr), h('p', info)]),
             centered: true,
             okText: '下发调节指令',
             mask: true,
             class: 'balancePress',
-            async onOk() {
-              await autoControl(avgPressLogId);
-              warnModal1.value = null;
+            onOk() {
+              // 点击确定按钮后,执行调节指令。调节指令需要确认密码,所以需要先弹出密码框
+              return new Promise((resolve, reject) => {
+                modalVisible.value = true;
+                // 弹出密码框后,输入密码并验证成功则关闭密码弹窗和报警弹窗,失败则关闭密码弹窗但不关闭报警弹窗
+                resolver = (password) => {
+                  autoControl({ password, id: avePressSetting.value.id }, { avgPressLogId: avgPressureLogId })
+                    .then(() => {
+                      modalVisible.value = false;
+                      resolve(true);
+                      warnModal1?.destroy();
+                      warnModal1 = null;
+                    })
+                    .catch(() => {
+                      modalVisible.value = false;
+                      reject();
+                    });
+                };
+                // 弹出密码框取消操作则关闭密码弹窗但不关闭报警弹窗
+                rejecter = () => {
+                  modalVisible.value = false;
+                  reject();
+                };
+              });
             },
-            async onCancel() {
-              await cancelControl(avgPressLogId);
-              warnModal1.value = null;
+            onCancel() {
+              return cancelControl({}, { avgPressLogId: avgPressureLogId }).finally(() => {
+                warnModal1?.destroy();
+                warnModal1 = null;
+              });
             },
           });
 
           break;
         case 'gate':
-          if (warnModal2.value) break;
-          warnModal2.value = Modal.warn({
+          if (warnModal2) break;
+          warnModal2 = Modal.warning({
             title: data.msgTitle,
             content: info,
-            showOkBtn: false,
             mask: true,
             class: 'balancePress',
             onOk: () => {
-              warnModal2.value = null;
+              warnModal2?.destroy();
+              warnModal2 = null;
             },
           });
           break;
         case 'fansys':
-          if (warnModal3.value) break;
-          warnModal3.value = Modal.warn({
+          if (warnModal3) break;
+          warnModal3 = Modal.warning({
             title: data.msgTitle,
             content: info,
-            showOkBtn: false,
             mask: true,
             class: 'balancePress',
             style: 'top: 700px',
             onOk: () => {
-              warnModal3.value = null;
+              warnModal3?.destroy();
+              warnModal3 = null;
             },
           });
 

+ 23 - 8
src/views/vent/monitorManager/balancePressMonitor/hooks/useControl.ts

@@ -106,23 +106,38 @@ export function usePressControl() {
       });
   }
 
-  function autoControl(avgPressLogId) {
-    return controlWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
+  function autoControl({ password, id }, { avgPressLogId }) {
+    return validPassword({
+      id,
+      password,
+    })
       .then(() => {
-        message.success('下发成功');
+        return controlWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
+          .then(() => {
+            message.success('预警已处理');
+          })
+          .catch((e) => {
+            message.error('下发失败');
+            throw e;
+          });
       })
-      .catch(() => {
-        message.error('下发失败');
+      .catch((e) => {
+        message.error(e);
+        throw e;
+      })
+      .finally(() => {
+        getAvePress();
       });
   }
 
-  function cancelControl(avgPressLogId) {
+  function cancelControl(___, { avgPressLogId }) {
     return cancelcontrolWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
       .then(() => {
-        message.success('下发成功');
+        message.success('已取消');
       })
-      .catch(() => {
+      .catch((e) => {
         message.error('下发失败');
+        throw e;
       });
   }
 

+ 531 - 0
src/views/vent/monitorManager/gateMonitor/gate.threejs.three.hsw.ts

@@ -0,0 +1,531 @@
+import * as THREE from 'three';
+import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
+import { getTextCanvas, renderVideo } from '/@/utils/threejs/util';
+import { drawHot } from '/@/utils/threejs/util';
+
+// import * as dat from 'dat.gui';
+// const gui = new dat.GUI();
+// gui.domElement.style = 'position:absolute;top:10px;right:10px;z-index:99999999999999';
+
+class FmHsw3 {
+  modelName = 'fmHsw3';
+  model; //
+  group;
+  isLRAnimation = true; // 是否开启左右摇摆动画
+  direction = 1; // 摇摆方向
+  animationTimer: NodeJS.Timeout | null = null; // 摇摆开启定时器
+  deviceDetailCSS3D;
+  playerStartClickTime1 = new Date().getTime();
+  playerStartClickTime2 = new Date().getTime();
+
+  fmClock = new THREE.Clock();
+  mixers: THREE.AnimationMixer | undefined;
+
+  clipActionArr = {
+    frontDoor: null as unknown as THREE.AnimationAction,
+    centerDoor: null as unknown as THREE.AnimationAction,
+    backDoor: null as unknown as THREE.AnimationAction,
+  };
+
+  constructor(model) {
+    this.model = model;
+  }
+
+  addLight() {
+    const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
+    directionalLight.position.set(-0.8, 23, 3.9);
+    this.group?.add(directionalLight);
+    directionalLight.target = this.group as THREE.Object3D;
+
+    // const pointLight2 = new THREE.PointLight(0xffeeee, 1, 310);
+    // pointLight2.position.set(-1.5, 2, -0.9);
+    // pointLight2.shadow.bias = 0.05;
+    // this.group?.add(pointLight2);
+
+    // const pointLight3 = new THREE.PointLight(0xffeeee, 1, 310);
+    // pointLight3.position.set(1.3, 2, -0.9);
+    // pointLight3.shadow.bias = 0.05;
+    // this.group?.add(pointLight3);
+
+    // const pointLight4 = new THREE.PointLight(0xffeeee, 1, 150);
+    // pointLight4.position.set(4.3, 1, -0.9);
+    // pointLight4.shadow.bias = 0.05;
+    // this.group?.add(pointLight4);
+
+    // const pointLight5 = new THREE.PointLight(0xffeeee, 1, 150);
+    // pointLight5.position.set(4.3, 1, -0.9);
+    // pointLight5.shadow.bias = 0.05;
+    // this.group?.add(pointLight5);
+
+    // const pointLight6 = new THREE.PointLight(0xffeeee, 1, 150);
+    // pointLight6.position.set(-4.4, 1, -0.9);
+    // pointLight6.shadow.bias = 0.05;
+    // this.group?.add(pointLight6);
+  }
+  // 重置摄像头
+  resetCamera() {
+    this.model.camera.far = 274;
+    this.model.orbitControls?.update();
+    this.model.camera.updateProjectionMatrix();
+  }
+  // 设置模型位置
+  setModalPosition() {
+    this.group?.scale.set(22, 22, 22);
+    this.group?.position.set(-20, 20, 9);
+  }
+
+  /* 添加监控数据 */
+  addMonitorText(selectData) {
+    if (!this.group) {
+      return;
+    }
+    const screenDownText = VENT_PARAM['modalText']
+      ? VENT_PARAM['modalText']
+      : History_Type['type'] == 'remote'
+      ? `国能神东煤炭集团监制`
+      : '煤炭科学技术研究院有限公司研制';
+
+    const screenDownTextX = 80 - (screenDownText.length - 11) * 6;
+    const textArr = [
+      {
+        text: `远程控制自动风门`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 120,
+        y: 100,
+      },
+      {
+        text: `净通行高度(m):`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 0,
+        y: 155,
+      },
+      {
+        text: `${selectData.fclearheight ? selectData.fclearheight : '-'}`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 290,
+        y: 155,
+      },
+      {
+        text: `净通行宽度(m): `,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 0,
+        y: 215,
+      },
+      {
+        text: ` ${selectData.fclearwidth ? selectData.fclearwidth : '-'}`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 280,
+        y: 215,
+      },
+      {
+        text: `故障诊断:`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 0,
+        y: 275,
+      },
+      {
+        text: `${selectData.warnLevel_str ? selectData.warnLevel_str : '-'}`,
+        font: 'normal 30px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: 280,
+        y: 275,
+      },
+      {
+        text: screenDownText,
+        font: 'normal 28px Arial',
+        color: '#00FF00',
+        strokeStyle: '#007400',
+        x: screenDownTextX,
+        y: 325,
+      },
+    ];
+
+    //
+    getTextCanvas(526, 346, textArr, '').then((canvas: HTMLCanvasElement) => {
+      const textMap = new THREE.CanvasTexture(canvas); // 关键一步
+      textMap.colorSpace = THREE.SRGBColorSpace;
+      const textMaterial = new THREE.MeshBasicMaterial({
+        // 关于材质并未讲解 实操即可熟悉                 这里是漫反射类似纸张的材质,对应的就有高光类似金属的材质.
+        map: textMap, // 设置纹理贴图
+        transparent: true,
+        side: THREE.FrontSide, // 这里是双面渲染的意思
+      });
+      textMaterial.blending = THREE.CustomBlending;
+      const monitorPlane = this.group.getObjectByName('monitorText');
+      if (monitorPlane) {
+        monitorPlane.material = textMaterial;
+      } else {
+        const planeGeometry = new THREE.PlaneGeometry(526, 346); // 平面3维几何体PlaneGeometry
+        const planeMesh = new THREE.Mesh(planeGeometry, textMaterial);
+        planeMesh.name = 'monitorText';
+        planeMesh.scale.set(0.002, 0.002, 0.002);
+        planeMesh.position.set(4.205, 0.09, -0.39);
+        this.group.add(planeMesh);
+      }
+    });
+  }
+
+  /** 添加热点 */
+  drawHots() {
+    const hotPositions = [
+      { x: -0.37, y: 0.26, z: -0.32 },
+      { x: 0.28, y: -0.2, z: -0.43 },
+      { x: 0.55, y: -0.22, z: -0.38 },
+    ];
+    for (let i = 0; i < 3; i++) {
+      const hotPoint = drawHot(0.1);
+      const position = hotPositions[i];
+      // hotPoint.scale.set(0.3, 0.3, 0.3);
+      hotPoint.position.set(position.x, position.y, position.z);
+      hotPoint.name = 'hotPoint' + i;
+      this.group?.add(hotPoint);
+    }
+  }
+
+  /* 风门动画 */
+  render() {
+    if (!this.model) {
+      return;
+    }
+
+    // 风门开关动画
+    if (this.mixers && this.fmClock.running) this.mixers.update(2);
+  }
+
+  /* 点击风窗,风窗全屏 */
+  mousedownModel(intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]) {
+    if (this.animationTimer) {
+      clearTimeout(this.animationTimer);
+      this.animationTimer = null;
+    }
+
+    // 判断是否点击到视频
+    intersects.find((intersect) => {
+      const mesh = intersect.object;
+      if (mesh.name === 'player1') {
+        if (new Date().getTime() - this.playerStartClickTime1 < 400) {
+          // model.orbitControls?.dispatchEvent.call(model.orbitControls, { type: 'end' })
+          // 双击,视频放大
+          // if (this.player1) {
+          //   this.player1.requestFullscreen();
+          // }
+        }
+        this.playerStartClickTime1 = new Date().getTime();
+        return true;
+      } else if (mesh.name === 'player2') {
+        if (new Date().getTime() - this.playerStartClickTime2 < 400) {
+          // model.orbitControls?.dispatchEvent.call(model.orbitControls, { type: 'end' })
+          // 双击,视频放大
+          // if (this.player2) {
+          //   this.player2.requestFullscreen();
+          // }
+        }
+        this.playerStartClickTime2 = new Date().getTime();
+        return true;
+      } else if (mesh.name.startsWith('hotPoint')) {
+        // if (this.deviceDetailCSS3D) {
+        //   this.deviceDetailCSS3D.position.set(mesh.position.x + 0.035, mesh.position.y + 0.66, mesh.position.z + 0.02);
+        //   console.log('[ deviceDetailCSS3D.position ] >', this.deviceDetailCSS3D.position);
+        //   this.deviceDetailCSS3D.visible = true;
+        //   return true;
+        // }
+      } else {
+        // this.deviceDetailCSS3D.visible = false;
+        console.log('[ 点击事件 ] >');
+      }
+      return false;
+    });
+  }
+
+  mouseUpModel() {}
+
+  /* 提取风门序列帧,初始化前后门动画 */
+  initAnimation() {
+    const fmHsw3 = this.group?.getObjectByName('fmHsw3');
+    const fmGroup = fmHsw3?.getObjectByName('fm');
+    if (fmGroup) {
+      const tracks = fmGroup.animations[0].tracks;
+      const fontTracks: any[] = [],
+        centerTracks: any[] = [],
+        backTracks: any[] = [];
+      for (let i = 0; i < tracks.length; i++) {
+        const track = tracks[i];
+        if (track.name.startsWith('qianmen')) {
+          fontTracks.push(track);
+        } else if (track.name.startsWith('zhongmen')) {
+          centerTracks.push(track);
+        } else if (track.name.startsWith('houmen')) {
+          backTracks.push(track);
+        }
+      }
+      this.mixers = new THREE.AnimationMixer(fmGroup);
+
+      const frontDoor = new THREE.AnimationClip('frontDoor', 4, fontTracks);
+      const frontClipAction = this.mixers.clipAction(frontDoor, fmGroup);
+      frontClipAction.clampWhenFinished = true;
+      frontClipAction.loop = THREE.LoopOnce;
+      this.clipActionArr.frontDoor = frontClipAction;
+
+      const backDoor = new THREE.AnimationClip('backDoor', 4, backTracks);
+
+      const backClipAction = this.mixers.clipAction(backDoor, fmGroup);
+      backClipAction.clampWhenFinished = true;
+      backClipAction.loop = THREE.LoopOnce;
+      this.clipActionArr.backDoor = backClipAction;
+
+      const centerDoor = new THREE.AnimationClip('centerDoor', 4, centerTracks);
+      const centerClipAction = this.mixers.clipAction(centerDoor, fmGroup);
+      centerClipAction.clampWhenFinished = true;
+      centerClipAction.loop = THREE.LoopOnce;
+      this.clipActionArr.centerDoor = centerClipAction;
+    }
+  }
+
+  deviceDetailCard(position = { x: 0, y: 0, z: 0 }) {
+    const element = document.getElementById('deviceCard') as HTMLElement;
+    this.deviceDetailCSS3D = new CSS2DObject(element);
+    this.deviceDetailCSS3D.name = 'deviceCard';
+    this.deviceDetailCSS3D.position.set(position.x, position.y, position.z);
+    this.deviceDetailCSS3D.visible = false;
+    // this.model.scene.add(this.deviceDetailCSS3D);
+    this.group.add(this.deviceDetailCSS3D);
+  }
+
+  // 播放动画
+  play(handlerState, timeScale = 0.01) {
+    if (this.clipActionArr.frontDoor && this.clipActionArr.backDoor) {
+      let handler = () => {};
+      switch (handlerState) {
+        case 1: // 打开前门
+          handler = () => {
+            this.clipActionArr.frontDoor.paused = true;
+            this.clipActionArr.frontDoor.reset();
+            this.clipActionArr.frontDoor.time = 1.2;
+            this.clipActionArr.frontDoor.timeScale = timeScale;
+            this.clipActionArr.frontDoor.clampWhenFinished = true;
+            this.clipActionArr.frontDoor.play();
+            this.fmClock.start();
+          };
+          break;
+        case 2: // 关闭前门
+          handler = () => {
+            this.clipActionArr.frontDoor.paused = true;
+            this.clipActionArr.frontDoor.reset(); //
+            this.clipActionArr.frontDoor.time = 4;
+            this.clipActionArr.frontDoor.timeScale = -timeScale;
+            this.clipActionArr.frontDoor.clampWhenFinished = true;
+            this.clipActionArr.frontDoor.play();
+            this.fmClock.start();
+          };
+          break;
+        case 3: // 打开后门
+          handler = () => {
+            this.clipActionArr.backDoor.paused = true;
+            this.clipActionArr.backDoor.reset();
+            this.clipActionArr.backDoor.time = 1.2;
+            this.clipActionArr.backDoor.timeScale = timeScale;
+            this.clipActionArr.backDoor.clampWhenFinished = true;
+            this.clipActionArr.backDoor.play();
+            this.fmClock.start();
+          };
+          break;
+        case 4: // 关闭后门
+          handler = () => {
+            this.clipActionArr.backDoor.paused = true;
+            this.clipActionArr.backDoor.reset();
+            this.clipActionArr.backDoor.time = 4;
+            this.clipActionArr.backDoor.timeScale = -timeScale;
+            this.clipActionArr.backDoor.clampWhenFinished = true;
+            this.clipActionArr.backDoor.play();
+            this.fmClock.start();
+          };
+          break;
+
+        case 8: // 打开后门
+          handler = () => {
+            this.clipActionArr.centerDoor.paused = true;
+            this.clipActionArr.centerDoor.reset();
+            this.clipActionArr.centerDoor.time = 1.2;
+            this.clipActionArr.centerDoor.timeScale = timeScale;
+            this.clipActionArr.centerDoor.clampWhenFinished = true;
+            this.clipActionArr.centerDoor.play();
+            this.fmClock.start();
+          };
+          break;
+        case 9: // 关闭后门
+          handler = () => {
+            this.clipActionArr.centerDoor.paused = true;
+            this.clipActionArr.centerDoor.reset();
+            this.clipActionArr.centerDoor.time = 4;
+            this.clipActionArr.centerDoor.timeScale = -timeScale;
+            this.clipActionArr.centerDoor.clampWhenFinished = true;
+            this.clipActionArr.centerDoor.play();
+            this.fmClock.start();
+          };
+          break;
+        // case 5: // 打开前后门
+        //   handler = () => {
+        //     this.clipActionArr.backDoor.paused = true;
+        //     this.clipActionArr.frontDoor.paused = true;
+
+        //     this.clipActionArr.frontDoor.reset();
+        //     this.clipActionArr.frontDoor.time = 0;
+        //     this.clipActionArr.frontDoor.timeScale = 0.01;
+        //     this.clipActionArr.frontDoor.clampWhenFinished = true;
+        //     this.clipActionArr.frontDoor.play();
+
+        //     this.clipActionArr.backDoor.reset();
+        //     this.clipActionArr.backDoor.time = 0;
+        //     this.clipActionArr.backDoor.timeScale = 0.01;
+        //     this.clipActionArr.backDoor.clampWhenFinished = true;
+        //     this.clipActionArr.backDoor.play();
+        //     this.fmClock.start();
+        //   };
+        //   break;
+        // case 6: // 关闭前后门
+        //   handler = () => {
+        //     this.clipActionArr.backDoor.paused = true;
+        //     this.clipActionArr.frontDoor.paused = true;
+
+        //     this.clipActionArr.frontDoor.reset();
+        //     this.clipActionArr.frontDoor.time = 4;
+        //     this.clipActionArr.frontDoor.timeScale = -0.01;
+        //     this.clipActionArr.frontDoor.clampWhenFinished = true;
+        //     this.clipActionArr.frontDoor.play();
+        //     this.clipActionArr.backDoor.reset();
+        //     this.clipActionArr.backDoor.time = 4;
+        //     this.clipActionArr.backDoor.timeScale = -0.01;
+        //     this.clipActionArr.backDoor.clampWhenFinished = true;
+        //     this.clipActionArr.backDoor.play();
+        //     this.fmClock.start();
+        //   };
+        //   break;
+        default:
+      }
+
+      handler();
+      // model.clock.start();
+      // const honglvdeng = group.getObjectByName('honglvdeng');
+      // const material = honglvdeng.material;
+      // setTimeout(() => {
+      //   if (handlerState === 2 || handlerState === 4 || handlerState === 6) {
+      //     material.color = new THREE.Color(0x00ff00);
+      //   } else {
+      //     material.color = new THREE.Color(0xff0000);
+      //   }
+      // }, 1000);
+    }
+  }
+
+  async initCamera(dom1?) {
+    const videoPlayer1 = dom1;
+    let monitorPlane: THREE.Mesh | null = null;
+    const canvas = await getTextCanvas(320, 180, '', 'noSinge.png');
+    const textMap = new THREE.CanvasTexture(canvas); // 关键一步
+    const textMaterial = new THREE.MeshBasicMaterial({
+      map: textMap, // 设置纹理贴图
+      transparent: true,
+      side: THREE.DoubleSide, // 这里是双面渲染的意思
+    });
+    textMaterial.blending = THREE.CustomBlending;
+    monitorPlane = this.group?.getObjectByName('noPlayer');
+    if (monitorPlane) {
+      monitorPlane.material = textMaterial;
+    } else {
+      const planeGeometry = new THREE.PlaneGeometry(100, 100); // 平面3维几何体PlaneGeometry
+      monitorPlane = new THREE.Mesh(planeGeometry, textMaterial);
+      textMaterial.dispose();
+      planeGeometry.dispose();
+    }
+    const videoPlayer = this.group.getObjectByName('player1');
+    if (videoPlayer) {
+      this.model.clearMesh(videoPlayer);
+      this.group.remove(videoPlayer);
+    }
+    const noPlayer1 = this.group.getObjectByName('noPlayer1');
+    if (noPlayer1) {
+      this.model.clearMesh(noPlayer1);
+      this.group.remove(noPlayer1);
+    }
+    if (!videoPlayer1 && videoPlayer1 === null) {
+      monitorPlane.name = 'noPlayer1';
+      monitorPlane.scale.set(0.0085, 0.0056, 0.012);
+      monitorPlane.position.set(-4.23, 0.02, -0.39);
+      this.group?.add(monitorPlane);
+    } else if (videoPlayer1) {
+      const mesh = renderVideo(this.group, videoPlayer1, 'player1');
+      if (mesh) {
+        mesh?.scale.set(-0.028, 0.0285, 1);
+        mesh?.position.set(-4.238, 0.02, -0.4);
+        mesh.rotation.y = -Math.PI;
+        this.group.add(mesh);
+      }
+    }
+  }
+  resetModal() {
+    const fmThreeBase = this.group.getObjectByName('fmThreeBase');
+    if (fmThreeBase) {
+      const screenObj1 = fmThreeBase.getObjectByName('对象192');
+      const screenObj2 = fmThreeBase.getObjectByName('对象231');
+      if (screenObj1) screenObj1.visible = false;
+      if (screenObj2) screenObj2.visible = false;
+    }
+  }
+
+  mountedThree() {
+    this.group = new THREE.Object3D();
+    this.group.name = this.modelName;
+    return new Promise((resolve) => {
+      this.model.setGLTFModel('fmHsw3').then((gltf) => {
+        const fmModal = gltf[0];
+        fmModal.name = 'fm';
+        this.group?.add(fmModal);
+        console.log('fmHsw3', this.group);
+        this.setModalPosition();
+        this.resetModal();
+        // 初始化左右摇摆动画;
+        this.initAnimation();
+        // this.drawHots();
+        this.addLight();
+        // this.deviceDetailCard();
+        this.model.animate();
+        if (this.model.camera && this.model.camera.layers.mask == -1) this.model.camera.layers.toggle(1);
+        resolve(null);
+        // this.initCamera(playerDom);
+      });
+    });
+  }
+
+  destroy() {
+    if (this.model) {
+      if (this.mixers) {
+        const fmGroup = this.group?.getObjectByName('fmThree');
+        this.mixers.uncacheClip(this.clipActionArr.frontDoor.getClip());
+        this.mixers.uncacheClip(this.clipActionArr.backDoor.getClip());
+        this.mixers.uncacheAction(this.clipActionArr.frontDoor.getClip(), fmGroup);
+        this.mixers.uncacheAction(this.clipActionArr.backDoor.getClip(), fmGroup);
+        this.mixers.uncacheRoot(fmGroup);
+
+        if (this.model.animations[0]) this.model.animations[0].tracks = [];
+      }
+      this.model.clearGroup(this.group);
+      this.clipActionArr.backDoor = undefined;
+      this.clipActionArr.frontDoor = undefined;
+      this.mixers = undefined;
+    }
+  }
+}
+export default FmHsw3;

+ 4 - 4
src/views/vent/monitorManager/gateMonitor/gate.threejs.three.tl.ts

@@ -7,8 +7,8 @@ import { drawHot } from '/@/utils/threejs/util';
 // const gui = new dat.GUI();
 // gui.domElement.style = 'position:absolute;top:10px;right:10px;z-index:99999999999999';
 
-class FmThreeTl {
-  modelName = 'fm2';
+class FmHsw3 {
+  modelName = 'fmHsw3';
   model; //
   group;
   isLRAnimation = true; // 是否开启左右摇摆动画
@@ -442,7 +442,7 @@ class FmThreeTl {
     this.group = new THREE.Object3D();
     this.group.name = this.modelName;
     return new Promise((resolve) => {
-      this.model.setGLTFModel(['fm-three-tl'], this.group).then(() => {
+      this.model.setGLTFModel(['fmHsw3'], this.group).then(() => {
         this.group.name = 'fm2';
         this.setModalPosition();
         this.resetModal();
@@ -493,4 +493,4 @@ class FmThreeTl {
     }
   }
 }
-export default FmThreeTl;
+export default FmHsw3;

+ 208 - 79
src/views/vent/monitorManager/gateMonitor/gate.threejs.ts

@@ -9,6 +9,9 @@ import FmThreeTl from './gate.threejs.three.tl';
 import FmDc from './gate.threejs.window';
 import FmDcHJG from './gate.threejs.window.hjg';
 import FmDcZHQ from './gate.threejs.window.zhq';
+import FmHsw3 from './gate.threejs.three.hsw';
+import FmYjXr from './gate.threejs.two.yj'; // 窑街行人
+import FmYj from './gate.threejs.yj'; // 窑街
 import { animateCamera } from '/@/utils/threejs/util';
 import useEvent from '../../../../utils/threejs/useEvent';
 import { getDictItemsByCode } from '/@/utils/dict';
@@ -25,6 +28,9 @@ let model,
   fmWindowHjg, // 带风窗
   fmWindowZhq, // 带风窗 沼和泉
   fmWindow, // 带风窗
+  fmHsw3, // 海石湾拱形三道风门
+  fmYjXr, // 窑街拱形行人风门
+  fmYj, // 窑街拱形行车风门
   group: THREE.Object3D,
   fmType = '',
   windowType = 'singleWindow';
@@ -67,6 +73,12 @@ const startAnimation = () => {
       fmWindowHjg.mouseUpModel();
     } else if (fmType === 'fmWindowZhq') {
       fmWindowZhq.mouseUpModel();
+    } else if (fmType === 'fmHsw3') {
+      fmHsw3.mouseUpModel();
+    } else if (fmType === 'fmYjXr') {
+      fmYjXr.mouseUpModel();
+    } else if (fmType === 'fmYj') {
+      fmYj.mouseUpModel();
     }
   });
 };
@@ -93,6 +105,12 @@ const mouseEvent = (event) => {
         fmWindowHjg.mousedownModel(intersects);
       } else if (fmType === 'fmWindowZhq' && fmWindowZhq) {
         fmWindowZhq.mousedownModel(intersects);
+      } else if (fmType === 'fmHsw3' && fmHsw3) {
+        fmHsw3.mousedownModel(intersects);
+      } else if (fmType === 'fmYjXr' && fmYjXr) {
+        fmYjXr.mousedownModel(intersects);
+      } else if (fmType === 'fmYj' && fmYj) {
+        fmYj.mousedownModel(intersects);
       }
     });
     console.log('摄像头控制信息', model.orbitControls, model.camera);
@@ -118,6 +136,12 @@ export const addMonitorText = (selectData) => {
     fmWindowHjg.addMonitorText(selectData);
   } else if (fmType === 'fmWindowZhq' && fmWindowZhq) {
     fmWindowZhq.addMonitorText(selectData);
+  } else if (fmType === 'fmHsw3' && fmHsw3) {
+    fmHsw3.addMonitorText(selectData);
+  } else if (fmType === 'fmYjXr' && fmYjXr) {
+    fmYjXr.addMonitorText(selectData);
+  } else if (fmType === 'fmYj' && fmYj) {
+    fmYj.addMonitorText(selectData);
   }
 };
 
@@ -151,7 +175,13 @@ export const play = (handlerState, flag?) => {
   } else if (fmType === 'fmTwoSs' && fmTwoSs) {
     return fmTwoSs.play.call(fmTwoSs, handlerState, flag);
   } else if (fmType === 'fmThreeTl') {
-    fmThreeTl?.play.call(fmThreeTl, handlerState, flag);
+    return fmThreeTl?.play.call(fmThreeTl, handlerState, flag);
+  } else if (fmType === 'fmHsw3') {
+    return fmHsw3?.play.call(fmHsw3, handlerState, flag);
+  } else if (fmType === 'fmYjXr') {
+    return fmYjXr?.play.call(fmYjXr, handlerState, flag);
+  } else if (fmType === 'fmYj') {
+    return fmYj?.play.call(fmYj, handlerState, flag);
   }
 };
 
@@ -508,6 +538,105 @@ export const setModelType = (type) => {
           0.8
         );
       }, 300);
+    } else if (fmType === 'fmHsw3' && fmHsw3 && fmHsw3.group) {
+      if (fmHsw3.clipActionArr.frontDoor && fmHsw3.clipActionArr.backDoor) {
+        fmHsw3.clipActionArr.frontDoor.reset();
+        fmHsw3.clipActionArr.frontDoor.time = 0.5;
+        fmHsw3.clipActionArr.backDoor.reset();
+        fmHsw3.clipActionArr.backDoor.time = 0.5;
+        fmHsw3.clipActionArr.frontDoor.stop();
+        fmHsw3.clipActionArr.backDoor.stop();
+      }
+
+      if (fmHsw3.frontDamperOpenMesh) fmHsw3.frontDamperOpenMesh.visible = false;
+      if (fmHsw3.frontDamperClosedMesh) fmHsw3.frontDamperClosedMesh.visible = true;
+      if (fmHsw3.backDamperOpenMesh) fmHsw3.backDamperOpenMesh.visible = false;
+      if (fmHsw3.backDamperClosedMesh) fmHsw3.backDamperClosedMesh.visible = true;
+
+      model.startAnimation = fmHsw3.render.bind(fmHsw3);
+      model.scene.remove(group);
+      group = fmHsw3.group;
+      group.rotation.y = 0;
+
+      const oldCameraPosition = { x: -1000, y: 100, z: 500 };
+      setTimeout(async () => {
+        resolve(null);
+        model.scene.add(fmHsw3.group);
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: 50.99, y: 69.32, z: 93.61 },
+          { x: -10.04, y: -14.38, z: -31.4 },
+          model,
+          0.8
+        );
+      }, 300);
+    } else if (fmType === 'fmYjXr' && fmYjXr && fmYjXr.group) {
+      if (fmYjXr.clipActionArr.frontDoor && fmYjXr.clipActionArr.backDoor) {
+        fmYjXr.clipActionArr.frontDoor.reset();
+        fmYjXr.clipActionArr.frontDoor.time = 0.5;
+        fmYjXr.clipActionArr.backDoor.reset();
+        fmYjXr.clipActionArr.backDoor.time = 0.5;
+        fmYjXr.clipActionArr.frontDoor.stop();
+        fmYjXr.clipActionArr.backDoor.stop();
+      }
+
+      if (fmYjXr.frontDamperOpenMesh) fmYjXr.frontDamperOpenMesh.visible = false;
+      if (fmYjXr.frontDamperClosedMesh) fmYjXr.frontDamperClosedMesh.visible = true;
+      if (fmYjXr.backDamperOpenMesh) fmYjXr.backDamperOpenMesh.visible = false;
+      if (fmYjXr.backDamperClosedMesh) fmYjXr.backDamperClosedMesh.visible = true;
+
+      model.startAnimation = fmYjXr.render.bind(fmYjXr);
+      model.scene.remove(group);
+      group = fmYjXr.group;
+      group.rotation.y = 0;
+
+      const oldCameraPosition = { x: -1000, y: 100, z: 500 };
+      setTimeout(async () => {
+        resolve(null);
+        model.scene.add(fmYjXr.group);
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: 50.99, y: 69.32, z: 93.61 },
+          { x: -10.04, y: -14.38, z: -31.4 },
+          model,
+          0.8
+        );
+      }, 300);
+    } else if (fmType === 'fmYj' && fmYj && fmYj.group) {
+      if (fmYj.clipActionArr.frontDoor && fmYj.clipActionArr.backDoor) {
+        fmYj.clipActionArr.frontDoor.reset();
+        fmYj.clipActionArr.frontDoor.time = 0.5;
+        fmYj.clipActionArr.backDoor.reset();
+        fmYj.clipActionArr.backDoor.time = 0.5;
+        fmYj.clipActionArr.frontDoor.stop();
+        fmYj.clipActionArr.backDoor.stop();
+      }
+
+      if (fmYj.frontDamperOpenMesh) fmYj.frontDamperOpenMesh.visible = false;
+      if (fmYj.frontDamperClosedMesh) fmYj.frontDamperClosedMesh.visible = true;
+      if (fmYj.backDamperOpenMesh) fmYj.backDamperOpenMesh.visible = false;
+      if (fmYj.backDamperClosedMesh) fmYj.backDamperClosedMesh.visible = true;
+
+      model.startAnimation = fmYj.render.bind(fmYj);
+      model.scene.remove(group);
+      group = fmYj.group;
+      group.rotation.y = 0;
+
+      const oldCameraPosition = { x: -1000, y: 100, z: 500 };
+      setTimeout(async () => {
+        resolve(null);
+        model.scene.add(fmYj.group);
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: 50.99, y: 69.32, z: 93.61 },
+          { x: -10.04, y: -14.38, z: -31.4 },
+          model,
+          0.8
+        );
+      }, 300);
     }
   });
 };
@@ -525,7 +654,7 @@ export const initCameraCanvas = async (playerVal1) => {
 };
 
 export const mountedThree = (playerDom) => {
-  const { sysOrgCode } = useGlobSetting();
+  // const { sysOrgCode } = useGlobSetting();
   debugger;
   // const sysOrgCode = 'gsgszdek';
   return new Promise(async (resolve) => {
@@ -533,84 +662,78 @@ export const mountedThree = (playerDom) => {
     model.setEnvMap('test1.hdr');
     model.renderer.toneMappingExposure = 0.9;
     model.camera.position.set(100, 0, 1000);
-    switch (sysOrgCode) {
-      case 'yjmdsankuang': //窑街三矿
-      case 'yjmdhswmk': //窑街海石湾
-      case 'yjmdjhmk': //窑街金河矿
-        const FmYj = await import('./gate.threejs.yj');
-        if (FmYj) fm3 = new FmYj.default(model);
-        if (fm3) fm3.mountedThree(playerDom);
-        const FmTwoYj = await import('./gate.threejs.two.yj');
-        if (FmTwoYj) fmTwoSs = new FmTwoYj.default(model);
-        fmTwoSs.mountedThree(playerDom);
-        fmXr = new FmXR(model);
-        fmXr.mountedThree(playerDom);
-        resolve(null);
-        break;
-      default:
-        // 根据字典加载模型
-        const dictCodes = getDictItemsByCode('gateStyle');
-        if (dictCodes && dictCodes.length > 0) {
-          for (let i = 0; i < dictCodes.length; i++) {
-            const dict = dictCodes[i];
-            switch (dict.value) {
-              case 'fmXr':
-                fmXr = new FmXR(model);
-                fmXr.mountedThree(playerDom);
-                break;
-              case 'fmYy':
-                fm1 = new Fm1(model);
-                fm1.mountedThree(playerDom);
-                break;
-              case 'gate_qd':
-                fm3 = new Fm3(model);
-                await fm3.mountedThree();
-                break;
-              case 'fmSs':
-                fmTwoSs = new FmTwoSs(model);
-                await fmTwoSs.mountedThree();
-                break;
-              case 'fmtl3':
-                fmThreeTl = new FmThreeTl(model);
-                await fmThreeTl.mountedThree();
-                break;
-              case 'fmSs3':
-                fm2 = new Fm2(model);
-                await fm2.mountedThree();
-                break;
-              case 'fm_fc_hjg':
-                fmWindowHjg = new FmDcHJG(model);
-                await fmWindowHjg.mountedThree();
-                break;
-              case 'fm_fc':
-                fmWindow = new FmDc(model);
-                await fmWindow.mountedThree();
-                break;
-              case 'fm_fc_zhq': //fmWindowZhq
-                fmWindowZhq = new FmDcZHQ(model);
-                await fmWindowZhq.mountedThree();
-                break;
-            }
-          }
-          resolve(null);
-        } else {
-          fm3 = new Fm3(model);
-          fm3.mountedThree(playerDom);
-          fmTwoSs = new FmTwoSs(model);
-          fmTwoSs.mountedThree(playerDom);
-          fm2 = new Fm2(model);
-          fm2.mountedThree(playerDom);
-          // 三道门
-          fmThreeTl = new FmThreeTl(model);
-          if (fmThreeTl) fmThreeTl.mountedThree(playerDom);
-          fmXr = new FmXR(model);
-          fmXr.mountedThree(playerDom);
-          // 液压风门
-          fm1 = new Fm1(model);
-          fm1.mountedThree(playerDom);
-          resolve(null);
-          break;
+    const dictCodes = getDictItemsByCode('gateStyle');
+    if (dictCodes && dictCodes.length > 0) {
+      for (let i = 0; i < dictCodes.length; i++) {
+        const dict = dictCodes[i];
+        switch (dict.value) {
+          case 'fmXr':
+            fmXr = new FmXR(model);
+            fmXr.mountedThree(playerDom);
+            break;
+          case 'fmYy':
+            fm1 = new Fm1(model);
+            fm1.mountedThree(playerDom);
+            break;
+          case 'gate_qd':
+            fm3 = new Fm3(model);
+            await fm3.mountedThree();
+            break;
+          case 'fmSs':
+            fmTwoSs = new FmTwoSs(model);
+            await fmTwoSs.mountedThree();
+            break;
+          case 'fmtl3':
+            fmThreeTl = new FmThreeTl(model);
+            await fmThreeTl.mountedThree();
+            break;
+          case 'fmSs3':
+            fm2 = new Fm2(model);
+            await fm2.mountedThree();
+            break;
+          case 'fm_fc_hjg':
+            fmWindowHjg = new FmDcHJG(model);
+            await fmWindowHjg.mountedThree();
+            break;
+          case 'fm_fc':
+            fmWindow = new FmDc(model);
+            await fmWindow.mountedThree();
+            break;
+          case 'fm_fc_zhq': //fmWindowZhq
+            fmWindowZhq = new FmDcZHQ(model);
+            await fmWindowZhq.mountedThree();
+            break;
+          case 'fmHsw3':
+            fmHsw3 = new FmHsw3(model);
+            await fmHsw3.mountedThree();
+            break;
+          case 'fmYjXr':
+            fmYjXr = new FmYjXr(model);
+            await fmYjXr.mountedThree();
+            break;
+          case 'fmYj':
+            fmYj = new FmYj(model);
+            await fmYj.mountedThree();
+            break;
         }
+      }
+      resolve(null);
+    } else {
+      fm3 = new Fm3(model);
+      fm3.mountedThree(playerDom);
+      fmTwoSs = new FmTwoSs(model);
+      fmTwoSs.mountedThree(playerDom);
+      fm2 = new Fm2(model);
+      fm2.mountedThree(playerDom);
+      // 三道门
+      fmThreeTl = new FmThreeTl(model);
+      if (fmThreeTl) fmThreeTl.mountedThree(playerDom);
+      fmXr = new FmXR(model);
+      fmXr.mountedThree(playerDom);
+      // 液压风门
+      fm1 = new Fm1(model);
+      fm1.mountedThree(playerDom);
+      resolve(null);
     }
 
     model.animate();
@@ -630,6 +753,9 @@ export const destroy = () => {
     if (fmWindowZhq) fmWindowZhq.destroy();
     if (fmWindow) fmWindow.destroy();
     if (fmThreeTl) fmThreeTl.destroy();
+    if (fmHsw3) fmHsw3.destroy();
+    if (fmYjXr) fmYjXr.destroy();
+    if (fmYj) fmYj.destroy();
     fm1 = null;
     fm2 = null;
     fm3 = null;
@@ -639,6 +765,9 @@ export const destroy = () => {
     fmWindowZhq = null;
     fmThreeTl = null;
     fmTwoSs = null;
+    fmHsw3 = null;
+    fmYjXr = null;
+    fmYj = null;
     group = null;
     model.mixers = [];
     model.destroy();

+ 2 - 2
src/views/vent/monitorManager/gateMonitor/gate.threejs.two.yj.ts

@@ -8,7 +8,7 @@ import { useAppStore } from '/@/store/modules/app';
 // const gui = new dat.GUI();
 // gui.domElement.style = 'position:absolute;top:100px;left:10px;z-index:99999999999999';
 
-class FmTwoYj {
+class FmYjXr {
   modelName = 'FmTwoYj';
   model; //
   group;
@@ -485,4 +485,4 @@ class FmTwoYj {
     }
   }
 }
-export default FmTwoYj;
+export default FmYjXr;

+ 783 - 754
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -310,8 +310,7 @@
                 :chartsColumns="chartsColumns"
                 device-type="gate"
                 :is-show-child-type="true"
-              >
-              </HistoryTableChart>
+              />
             </div>
           </a-tab-pane>
         </a-tabs>
@@ -341,838 +340,868 @@
 </template>
 
 <script setup lang="ts">
-import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref } from 'vue';
-import MonitorTable from '../comment/MonitorTable.vue';
-import HistoryTable from '../comment/HistoryTable.vue';
-import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
-import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
-import AlarmHistoryTableHj from './components/AlarmHistoryTableHj.vue';
-import HandleModal from './modal.vue';
-import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
-import { mountedThree, addMonitorText, play, destroy, setModelType, computePlay } from './gate.threejs';
-import { deviceControlApi } from '/@/api/vent/index';
-import { message } from 'ant-design-vue';
-import { list, getTableList, cameraList, cameraAddrList } from './gate.api';
-import { chartsColumns } from './gate.data';
-import lodash from 'lodash';
-import { setDivHeight } from '/@/utils/event';
-import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
-import { useRouter } from 'vue-router';
-import LivePlayer from '@liveqing/liveplayer-v3';
-import { useModal } from '/@/components/Modal';
-import { useCamera } from '/@/hooks/system/useCamera';
-import { usePermission } from '/@/hooks/web/usePermission';
-import { getDictItems } from '/@/api/common/api';
-import { render } from '/@/utils/common/renderUtils';
-import { useGlobSetting } from '/@/hooks/setting';
-import { getDictItemsByCode } from '/@/utils/dict';
-import { defHttp } from '/@/utils/http/axios';
-import BarAndLine from '/@/components/chart/BarAndLine.vue';
-import HistoryTableChart from '../comment/HistoryTableChart.vue';
-const { hasPermission } = usePermission();
-const { sysOrgCode } = useGlobSetting();
-const globalConfig = inject('globalConfig');
+  import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref } from 'vue';
+  import MonitorTable from '../comment/MonitorTable.vue';
+  import HistoryTable from '../comment/HistoryTable.vue';
+  import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
+  import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
+  import AlarmHistoryTableHj from './components/AlarmHistoryTableHj.vue';
+  import HandleModal from './modal.vue';
+  import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
+  import { mountedThree, addMonitorText, play, destroy, setModelType, computePlay } from './gate.threejs';
+  import { deviceControlApi } from '/@/api/vent/index';
+  import { message } from 'ant-design-vue';
+  import { list, getTableList, cameraList, cameraAddrList } from './gate.api';
+  import { chartsColumns } from './gate.data';
+  import lodash from 'lodash';
+  import { setDivHeight } from '/@/utils/event';
+  import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
+  import { useRouter } from 'vue-router';
+  import LivePlayer from '@liveqing/liveplayer-v3';
+  import { useModal } from '/@/components/Modal';
+  import { useCamera } from '/@/hooks/system/useCamera';
+  import { usePermission } from '/@/hooks/web/usePermission';
+  import { getDictItems } from '/@/api/common/api';
+  import { render } from '/@/utils/common/renderUtils';
+  import { useGlobSetting } from '/@/hooks/setting';
+  import { getDictItemsByCode } from '/@/utils/dict';
+  import { defHttp } from '/@/utils/http/axios';
+  import BarAndLine from '/@/components/chart/BarAndLine.vue';
+  import HistoryTableChart from '../comment/HistoryTableChart.vue';
+  const { hasPermission } = usePermission();
+  const { sysOrgCode } = useGlobSetting();
+  const globalConfig = inject('globalConfig');
 
-const { currentRoute } = useRouter();
-const MonitorDataTable = ref();
-let contrlValue = '';
-const playerRef = ref();
-const deviceType = ref('gate');
-const activeKey = ref('1'); // tab
-const loading = ref(false);
-const stationType = ref('plc1');
-const scroll = reactive({
-  y: 230,
-});
-const modelList = ref<{ text: string; value: string }[]>([]);
-const frontDoorIsOpen = ref(false); //前门是否开启
-const backDoorIsOpen = ref(false); //后门是否开启
-const midDoorIsOpen = ref(false); //中间门是否开启
+  const { currentRoute } = useRouter();
+  const MonitorDataTable = ref();
+  let contrlValue = '';
+  const playerRef = ref();
+  const deviceType = ref('gate');
+  const activeKey = ref('1'); // tab
+  const loading = ref(false);
+  const stationType = ref('plc1');
+  const scroll = reactive({
+    y: 230,
+  });
+  const modelList = ref<{ text: string; value: string }[]>([]);
+  const frontDoorIsOpen = ref(false); //前门是否开启
+  const backDoorIsOpen = ref(false); //后门是否开启
+  const midDoorIsOpen = ref(false); //中间门是否开启
 
-const modalIsShow = ref<boolean>(false); // 是否显示模态框
-const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
-const modalType = ref(''); // 模态框内容显示类型,设备操作类型
+  const modalIsShow = ref<boolean>(false); // 是否显示模态框
+  const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
+  const modalType = ref(''); // 模态框内容显示类型,设备操作类型
 
-const selectRowIndex = ref(-1); // 选中行
-const dataSource = ref([]);
-const sharedData = ref([]);
-const deviceBaseList = ref([]); // 设备基本信息
-const updateSharedData = (data) => {
-  sharedData.value = data;
-};
-const Option = {
-  grid: {
-    top: '20%',
-    left: '5%',
-    right: '5%',
-    bottom: '3%',
-    containLabel: true,
-  },
-  toolbox: {
-    feature: null,
-  },
-};
-const [registerModal, { openModal, closeModal }] = useModal();
+  const selectRowIndex = ref(-1); // 选中行
+  const dataSource = ref([]);
+  const sharedData = ref([]);
+  const deviceBaseList = ref([]); // 设备基本信息
+  const updateSharedData = (data) => {
+    sharedData.value = data;
+  };
+  const Option = {
+    grid: {
+      top: '20%',
+      left: '5%',
+      right: '5%',
+      bottom: '3%',
+      containLabel: true,
+    },
+    toolbox: {
+      feature: null,
+    },
+  };
+  const [registerModal, { openModal, closeModal }] = useModal();
 
-const { getCamera, removeCamera } = useCamera();
+  const { getCamera, removeCamera } = useCamera();
 
-const tabChange = (activeKeyVal) => {
-  activeKey.value = activeKeyVal;
-  if (activeKeyVal == 1) {
-    nextTick(() => {
-      if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
-    });
-  }
-};
+  const tabChange = (activeKeyVal) => {
+    activeKey.value = activeKeyVal;
+    if (activeKeyVal == 1) {
+      nextTick(() => {
+        if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
+      });
+    }
+  };
 
-const initData = {
-  deviceID: '',
-  deviceType: '',
-  strname: '',
-  frontRearDP: '-', //压差
-  // sourcePressure: '-', //气源压力
-  runRoRecondition: null,
-  autoRoManual: null,
-  netStatus: '0', //通信状态
-  frontGateOpen: '0',
-  frontGateClose: '1',
-  rearGateOpen: '0',
-  rearGateClose: '1',
-  midGateOpen: '0',
-  midGateClose: '1',
-  fault: '气源压力超限',
-  masterComputer: 0,
-  frontGateOpenCtrl: false,
-  rearGateOpenCtrl: false,
-  cameras: [],
-};
+  const initData = {
+    deviceID: '',
+    deviceType: '',
+    strname: '',
+    frontRearDP: '-', //压差
+    // sourcePressure: '-', //气源压力
+    runRoRecondition: null,
+    autoRoManual: null,
+    netStatus: '0', //通信状态
+    frontGateOpen: '0',
+    frontGateClose: '1',
+    rearGateOpen: '0',
+    rearGateClose: '1',
+    midGateOpen: '0',
+    midGateClose: '1',
+    fault: '气源压力超限',
+    masterComputer: 0,
+    frontGateOpenCtrl: false,
+    rearGateOpenCtrl: false,
+    cameras: [],
+  };
 
-// 监测数据
-const selectData = reactive(lodash.cloneDeep(initData));
+  // 监测数据
+  const selectData = reactive(lodash.cloneDeep(initData));
 
-const flvURL1 = () => {
-  // return ''
-  return `/video/gate.mp4`;
-};
+  const flvURL1 = () => {
+    // return ''
+    return `/video/gate.mp4`;
+  };
 
-function deviceEdit(e: Event, type: string, record) {
-  e.stopPropagation();
-  openModal(true, {
-    type,
-    deviceId: record['deviceID'],
-  });
-}
-// 获取设备基本信息列表
-function getDeviceBaseList() {
-  getTableList({ pageSize: 1000 }).then((res) => {
-    deviceBaseList.value = res.records;
-  });
-}
+  function deviceEdit(e: Event, type: string, record) {
+    e.stopPropagation();
+    openModal(true, {
+      type,
+      deviceId: record['deviceID'],
+    });
+  }
+  // 获取设备基本信息列表
+  function getDeviceBaseList() {
+    getTableList({ pageSize: 1000 }).then((res) => {
+      deviceBaseList.value = res.records;
+    });
+  }
 
-// https获取监测数据
-let timer: null | NodeJS.Timeout = null;
-async function getMonitor(flag?) {
-  if (Object.prototype.toString.call(timer) === '[object Null]') {
-    timer = await setTimeout(
-      async () => {
-        const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
-        if (res.msgTxt && res.msgTxt[0]) {
-          dataSource.value = res.msgTxt[0].datalist || [];
-          dataSource.value.forEach((data: any) => {
-            const readData = data.readData;
-            data = Object.assign(data, readData);
-          });
-          if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
-            // 初始打开页面
-            if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
-              MonitorDataTable.value.setSelectedRowKeys([currentRoute.value['query']['id']]);
-            } else {
-              MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
+  // https获取监测数据
+  let timer: null | NodeJS.Timeout = null;
+  async function getMonitor(flag?) {
+    if (Object.prototype.toString.call(timer) === '[object Null]') {
+      timer = await setTimeout(
+        async () => {
+          const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
+          if (res.msgTxt && res.msgTxt[0]) {
+            dataSource.value = res.msgTxt[0].datalist || [];
+            dataSource.value.forEach((data: any) => {
+              const readData = data.readData;
+              data = Object.assign(data, readData);
+            });
+            if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
+              // 初始打开页面
+              if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
+                MonitorDataTable.value.setSelectedRowKeys([currentRoute.value['query']['id']]);
+              } else {
+                MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
+              }
             }
+            Object.assign(selectData, dataSource.value[selectRowIndex.value]);
+            if (selectData.contrlMod == 'jnjhCtrl') {
+              selectData['autoRoManual'] = selectData['autoRoManual'] == 1 ? true : false;
+              selectData['autoRoManual1'] = selectData['autoRoManual1'] == 1 ? true : false;
+              selectData['autoRoManual2'] = selectData['autoRoManual2'] == 1 ? true : false;
+            }
+            addMonitorText(selectData);
+            monitorAnimation(selectData);
+            if (timer) {
+              timer = null;
+            }
+            getMonitor();
           }
-          Object.assign(selectData, dataSource.value[selectRowIndex.value]);
-          if (selectData.contrlMod == 'jnjhCtrl') {
-            selectData['autoRoManual'] = selectData['autoRoManual'] == 1 ? true : false;
-            selectData['autoRoManual1'] = selectData['autoRoManual1'] == 1 ? true : false;
-            selectData['autoRoManual2'] = selectData['autoRoManual2'] == 1 ? true : false;
-          }
-          addMonitorText(selectData);
-          monitorAnimation(selectData);
-          if (timer) {
-            timer = null;
-          }
-          getMonitor();
-        }
-      },
-      flag ? 0 : 1000
-    );
+        },
+        flag ? 0 : 1000
+      );
+    }
   }
-}
 
-// 切换检测数据
-async function getSelectRow(selectRow, index) {
-  if (!selectRow) return;
-  loading.value = true;
-  selectRowIndex.value = index;
+  // 切换检测数据
+  async function getSelectRow(selectRow, index) {
+    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);
-  isFrontOpenRunning = false; //开关门动作是否在进行
-  isRearOpenRunning = false; //开关门动作是否在进行
-  isMidOpenRunning = false; //开关门动作是否在进行
-  frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-  rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-  midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+    const baseData: any = deviceBaseList.value.find((baseData: any) => baseData.id === selectRow.deviceID);
+    Object.assign(selectData, initData, selectRow, baseData);
+    isFrontOpenRunning = false; //开关门动作是否在进行
+    isRearOpenRunning = false; //开关门动作是否在进行
+    isMidOpenRunning = false; //开关门动作是否在进行
+    frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+    rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+    midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
 
-  let type;
-  const dictCodes = getDictItemsByCode('gateStyle');
-  if (selectData && dictCodes && dictCodes.length > 0) {
-    const gateStyle = selectData['gateStyle'];
-    switch (gateStyle) {
-      case 'gate_qd':
-        type = 'fm3';
-        break;
-      case 'fmtl3':
+    let type;
+    const dictCodes = getDictItemsByCode('gateStyle');
+    if (selectData && dictCodes && dictCodes.length > 0) {
+      const gateStyle = selectData['gateStyle'];
+      switch (gateStyle) {
+        case 'gate_qd':
+          type = 'fm3';
+          break;
+        case 'fmtl3':
+          type = 'fmThreeTl';
+          break;
+        case 'fmSs':
+          type = 'fmTwoSs';
+          break;
+        case 'fm_fc':
+          type = 'fmWindow';
+          break;
+        case 'fmXr':
+          type = 'fmXr';
+          break;
+        case 'fmYy':
+          type = 'fm1';
+          break;
+        case 'fmSs3':
+          type = 'fm2';
+          break;
+        case 'fm_fc_hjg':
+          type = 'fmWindowHjg';
+          break;
+        case 'fm_fc_zhq':
+          type = 'fmWindowZhq';
+          break;
+        case 'fmHsw3':
+          type = 'fmHsw3';
+          break;
+        case 'fmYjXr':
+          type = 'fmYjXr';
+          break;
+        case 'fmYj':
+          type = 'fmYj';
+          break;
+      }
+    } else {
+      type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
+      if (selectData['doorUse'] == 2) {
+        type = 'fmXr';
+      } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
         type = 'fmThreeTl';
+      } else {
+        if (selectData.deviceType == 'gate_ss') {
+          type = 'fm2';
+          // type = 'fmWindow';
+        } else if (selectData.deviceType == 'gate_qd' || selectData.deviceType == 'gate_normal') {
+          type = 'fm3';
+        } else if (selectData.deviceType == 'gate_ss_two' || selectData.deviceType == 'gate_ss_two1') {
+          type = 'fmTwoSs';
+        } else if (selectData.deviceType == 'gate_tj') {
+          type = 'fmWindow';
+        } else {
+          type = 'fm1'; // 液压
+        }
+      }
+    }
+
+    debugger;
+    setModelType(type).then(async () => {
+      addMonitorText(selectData);
+      loading.value = false;
+    });
+    await getCamera(selectRow.deviceID, playerRef.value);
+  }
+
+  // 播放动画
+  function playAnimation(handlerState, data: any = null) {
+    const value = data;
+    switch (handlerState) {
+      case 1: // 打开前门
+        if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
+          modalTitle.value = '打开前门';
+          modalType.value = '1';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('前门已经打开或正在打开,请勿重新操作');
+          message.warning('没有监测到前门关到位,无法进行指令下发操作');
+        }
         break;
-      case 'fmSs':
-        type = 'fmTwoSs';
+      case 2: // 关闭前门
+        if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
+          modalTitle.value = '关闭前门';
+          modalType.value = '2';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('前门已经关闭或正在关闭,请勿重新操作');
+          message.warning('没有监测到前门开到位,无法进行指令下发操作');
+        }
         break;
-      case 'fm_fc':
-        type = 'fmWindow';
+      case 3: // 打开后门
+        if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+          modalTitle.value = '打开后门';
+          modalType.value = '3';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('后门已经打开或正在打开,请勿重新操作');
+          message.warning('没有监测到后门关到位,无法进行指令下发操作');
+        }
         break;
-      case 'fmXr':
-        type = 'fmXr';
+      case 4: // 关闭后门
+        if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+          modalTitle.value = '关闭后门';
+          modalType.value = '4';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('后门已经关闭或正在关闭,请勿重新操作');
+          message.warning('没有监测到后门开到位,无法进行指令下发操作');
+        }
         break;
-      case 'fmYy':
-        type = 'fm1';
+      case 8: // 打开中间门
+        if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
+          modalTitle.value = '打开中间门';
+          modalType.value = '8';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('后门已经打开或正在打开,请勿重新操作');
+          message.warning('没有监测到中间门关到位,无法进行指令下发操作');
+        }
         break;
-      case 'fmSs3':
-        type = 'fm2';
+      case 9: // 关闭中间门
+        if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
+          modalTitle.value = '关闭中间门';
+          modalType.value = '9';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('后门已经关闭或正在关闭,请勿重新操作');
+          message.warning('没有监测到中间门开到位,无法进行指令下发操作');
+        }
         break;
-      case 'fm_fc_hjg':
-        type = 'fmWindowHjg';
+      case 5: // 打开前后门
+        if (
+          selectData.frontGateOpen == '0' &&
+          selectData.frontGateClose == '1' &&
+          selectData.rearGateOpen == '0' &&
+          selectData.rearGateClose == '1'
+        ) {
+          modalTitle.value = '打开前后门';
+          modalType.value = '5';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('前后门已经打开或正在打开,请勿重新操作');
+          message.warning('没有监测到前门、后门关到位,无法进行指令下发操作');
+        }
         break;
-      case 'fm_fc_zhq':
-        type = 'fmWindowZhq';
+      case 6: // 关闭前后门
+        if (
+          selectData.frontGateOpen == '1' &&
+          selectData.frontGateClose == '0' &&
+          selectData.rearGateOpen == '1' &&
+          selectData.rearGateClose == '0'
+        ) {
+          modalTitle.value = '关闭前后门';
+          modalType.value = '6';
+          modalIsShow.value = true;
+        } else {
+          // message.warning('前后门已经关闭或正在关闭,请勿重新操作');
+          message.warning('没有监测到前门、后门开到位,无法进行指令下发操作');
+        }
         break;
-    }
-  } else {
-    type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
-    if (selectData['doorUse'] == 2) {
-      type = 'fmXr';
-    } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
-      type = 'fmThreeTl';
-    } else {
-      if (selectData.deviceType == 'gate_ss') {
-        type = 'fm2';
-        // type = 'fmWindow';
-      } else if (selectData.deviceType == 'gate_qd' || selectData.deviceType == 'gate_normal') {
-        type = 'fm3';
-      } else if (selectData.deviceType == 'gate_ss_two' || selectData.deviceType == 'gate_ss_two1') {
-        type = 'fmTwoSs';
-      } else if (selectData.deviceType == 'gate_tj') {
-        type = 'fmWindow';
-      } else {
-        type = 'fm1'; // 液压
-      }
-    }
-  }
-  debugger;
-  setModelType(type).then(async () => {
-    addMonitorText(selectData);
-    loading.value = false;
-  });
-  await getCamera(selectRow.deviceID, playerRef.value);
-}
 
-// 播放动画
-function playAnimation(handlerState, data: any = null) {
-  const value = data;
-  switch (handlerState) {
-    case 1: // 打开前门
-      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
-        modalTitle.value = '打开前门';
-        modalType.value = '1';
-        modalIsShow.value = true;
-      } else {
-        // message.warning('前门已经打开或正在打开,请勿重新操作');
-        message.warning('没有监测到前门关到位,无法进行指令下发操作');
-      }
-      break;
-    case 2: // 关闭前门
-      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
-        modalTitle.value = '关闭前门';
-        modalType.value = '2';
-        modalIsShow.value = true;
-      } else {
-        // message.warning('前门已经关闭或正在关闭,请勿重新操作');
-        message.warning('没有监测到前门开到位,无法进行指令下发操作');
-      }
-      break;
-    case 3: // 打开后门
-      if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-        modalTitle.value = '打开后门';
-        modalType.value = '3';
-        modalIsShow.value = true;
-      } else {
-        // message.warning('后门已经打开或正在打开,请勿重新操作');
-        message.warning('没有监测到后门关到位,无法进行指令下发操作');
-      }
-      break;
-    case 4: // 关闭后门
-      if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-        modalTitle.value = '关闭后门';
-        modalType.value = '4';
+      case 7: // 控制模式切换
+        modalTitle.value = '控制模式切换';
+        modalType.value = '7';
         modalIsShow.value = true;
-      } else {
-        // message.warning('后门已经关闭或正在关闭,请勿重新操作');
-        message.warning('没有监测到后门开到位,无法进行指令下发操作');
-      }
-      break;
-    case 8: // 打开中间门
-      if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
-        modalTitle.value = '打开中间门';
-        modalType.value = '8';
+        break;
+
+      case 10: // 风窗控制
+        modalTitle.value = 'A窗控制';
+        modalType.value = '10';
         modalIsShow.value = true;
-      } else {
-        // message.warning('后门已经打开或正在打开,请勿重新操作');
-        message.warning('没有监测到中间门关到位,无法进行指令下发操作');
-      }
-      break;
-    case 9: // 关闭中间门
-      if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
-        modalTitle.value = '关闭中间门';
-        modalType.value = '9';
+        break;
+
+      case 11: // 风窗控制
+        modalTitle.value = 'B窗控制';
+        modalType.value = '11';
         modalIsShow.value = true;
-      } else {
-        // message.warning('后门已经关闭或正在关闭,请勿重新操作');
-        message.warning('没有监测到中间门开到位,无法进行指令下发操作');
-      }
-      break;
-    case 5: // 打开前后门
-      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1' && selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-        modalTitle.value = '打开前后门';
-        modalType.value = '5';
+        break;
+      case 12: // 风窗控制
+        modalTitle.value = 'C窗控制';
+        modalType.value = '12';
         modalIsShow.value = true;
-      } else {
-        // message.warning('前后门已经打开或正在打开,请勿重新操作');
-        message.warning('没有监测到前门、后门关到位,无法进行指令下发操作');
-      }
-      break;
-    case 6: // 关闭前后门
-      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-        modalTitle.value = '关闭前后门';
-        modalType.value = '6';
+        break;
+      case 13: // 风窗控制
+        modalTitle.value = 'D窗控制';
+        modalType.value = '13';
         modalIsShow.value = true;
-      } else {
-        // message.warning('前后门已经关闭或正在关闭,请勿重新操作');
-        message.warning('没有监测到前门、后门开到位,无法进行指令下发操作');
-      }
-      break;
-
-    case 7: // 控制模式切换
-      modalTitle.value = '控制模式切换';
-      modalType.value = '7';
-      modalIsShow.value = true;
-      break;
-
-    case 10: // 风窗控制
-      modalTitle.value = 'A窗控制';
-      modalType.value = '10';
-      modalIsShow.value = true;
-      break;
-
-    case 11: // 风窗控制
-      modalTitle.value = 'B窗控制';
-      modalType.value = '11';
-      modalIsShow.value = true;
-      break;
-    case 12: // 风窗控制
-      modalTitle.value = 'C窗控制';
-      modalType.value = '12';
-      modalIsShow.value = true;
-      break;
-    case 13: // 风窗控制
-      modalTitle.value = 'D窗控制';
-      modalType.value = '13';
-      modalIsShow.value = true;
-      break;
-  }
+        break;
+    }
 
-  if (globalConfig?.simulatedPassword) {
-    handleOK('', handlerState + '');
+    if (globalConfig?.simulatedPassword) {
+      handleOK('', handlerState + '');
+    }
+    contrlValue = value;
   }
-  contrlValue = value;
-}
-// 保德缺打开状态
+  // 保德缺打开状态
 
-// function playAnimation(handlerState, data: any = null) {
-//   const value = data;
-//   switch (handlerState) {
-//     case 1: // 打开前门
-//       modalTitle.value = '打开前门';
-//       modalType.value = '1';
-//       modalIsShow.value = true;
-//       break;
-//     case 2: // 关闭前门
-//       modalTitle.value = '关闭前门';
-//       modalType.value = '2';
-//       modalIsShow.value = true;
-//       break;
-//     case 3: // 打开后门
-//       modalTitle.value = '打开后门';
-//       modalType.value = '3';
-//       modalIsShow.value = true;
-//       break;
-//     case 4: // 关闭后门
-//       modalTitle.value = '关闭后门';
-//       modalType.value = '4';
-//       modalIsShow.value = true;
-//       break;
-//     case 8: // 打开中间门
-//       modalTitle.value = '打开中间门';
-//       modalType.value = '8';
-//       modalIsShow.value = true;
-//       break;
-//     case 9: // 关闭中间门
-//       modalTitle.value = '关闭中间门';
-//       modalType.value = '9';
-//       modalIsShow.value = true;
-//       break;
-//     case 5: // 打开前后门
-//       modalTitle.value = '打开前后门';
-//       modalType.value = '5';
-//       modalIsShow.value = true;
-//       break;
-//     case 6: // 关闭前后门
-//       modalTitle.value = '关闭前后门';
-//       modalType.value = '6';
-//       modalIsShow.value = true;
-//       break;
+  // function playAnimation(handlerState, data: any = null) {
+  //   const value = data;
+  //   switch (handlerState) {
+  //     case 1: // 打开前门
+  //       modalTitle.value = '打开前门';
+  //       modalType.value = '1';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 2: // 关闭前门
+  //       modalTitle.value = '关闭前门';
+  //       modalType.value = '2';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 3: // 打开后门
+  //       modalTitle.value = '打开后门';
+  //       modalType.value = '3';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 4: // 关闭后门
+  //       modalTitle.value = '关闭后门';
+  //       modalType.value = '4';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 8: // 打开中间门
+  //       modalTitle.value = '打开中间门';
+  //       modalType.value = '8';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 9: // 关闭中间门
+  //       modalTitle.value = '关闭中间门';
+  //       modalType.value = '9';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 5: // 打开前后门
+  //       modalTitle.value = '打开前后门';
+  //       modalType.value = '5';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 6: // 关闭前后门
+  //       modalTitle.value = '关闭前后门';
+  //       modalType.value = '6';
+  //       modalIsShow.value = true;
+  //       break;
 
-//     case 7: // 控制模式切换
-//       modalTitle.value = '控制模式切换';
-//       modalType.value = '7';
-//       modalIsShow.value = true;
-//       break;
-//     case 10: // 风窗控制
-//       modalTitle.value = '风窗控制';
-//       modalType.value = '10';
-//       modalIsShow.value = true;
-//       break;
-//   }
+  //     case 7: // 控制模式切换
+  //       modalTitle.value = '控制模式切换';
+  //       modalType.value = '7';
+  //       modalIsShow.value = true;
+  //       break;
+  //     case 10: // 风窗控制
+  //       modalTitle.value = '风窗控制';
+  //       modalType.value = '10';
+  //       modalIsShow.value = true;
+  //       break;
+  //   }
 
-//   if (globalConfig?.simulatedPassword) {
-//     handleOK('', handlerState + '');
-//   }
-//   contrlValue = value;
-// }
+  //   if (globalConfig?.simulatedPassword) {
+  //     handleOK('', handlerState + '');
+  //   }
+  //   contrlValue = value;
+  // }
 
-function handleOK(passWord, handlerState, value?) {
-  if (!passWord && !globalConfig?.simulatedPassword) {
-    message.warning('请输入密码');
-    return;
-  }
-  if (isOpenRunning) {
-    message.warning('风门正在运行。。。');
-    modalIsShow.value = false;
-    return;
-  }
-  const data = {
-    deviceid: selectData.deviceID,
-    devicetype: selectData.deviceType,
-    paramcode: '',
-    value: contrlValue,
-    password: passWord || globalConfig?.simulatedPassword,
-    masterComputer: selectData.masterComputer,
-  };
-  let handler = () => {};
-  debugger;
+  function handleOK(passWord, handlerState, value?) {
+    if (!passWord && !globalConfig?.simulatedPassword) {
+      message.warning('请输入密码');
+      return;
+    }
+    if (isOpenRunning) {
+      message.warning('风门正在运行。。。');
+      modalIsShow.value = false;
+      return;
+    }
+    const data = {
+      deviceid: selectData.deviceID,
+      devicetype: selectData.deviceType,
+      paramcode: '',
+      value: contrlValue,
+      password: passWord || globalConfig?.simulatedPassword,
+      masterComputer: selectData.masterComputer,
+    };
+    let handler = () => {};
+    debugger;
 
-  switch (handlerState) {
-    case '1': // 打开前门
-      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
-        handler = () => {
-          frontDoorIsOpen.value = true;
-        };
-        data.paramcode = 'frontGateOpen_S';
-      } else {
-        message.warning('前门已打开。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '2': // 关闭前门
-      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
-        handler = () => {
-          frontDoorIsOpen.value = false;
-        };
-        data.paramcode = 'frontGateClose_S';
-      } else {
-        message.warning('前门已关闭。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '3': // 打开后门
-      if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-        handler = () => {
-          backDoorIsOpen.value = true;
-        };
-        data.paramcode = 'rearGateOpen_S';
-      } else {
-        message.warning('后门已打开。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '4': // 关闭后门
-      if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-        handler = () => {
-          backDoorIsOpen.value = false;
-        };
-        data.paramcode = 'rearGateClose_S';
-      } else {
-        message.warning('后门已关闭。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '8': // 打开中间门
-      if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
-        handler = () => {
-          midDoorIsOpen.value = true;
-        };
-        data.paramcode = 'midGateOpen_S';
-      } else {
-        message.warning('中间风门已打开。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '9': // 关闭中间门
-      if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
-        handler = () => {
-          midDoorIsOpen.value = false;
-        };
-        data.paramcode = 'midGateClose_S';
-      } else {
-        message.warning('中间风门已关闭。。。');
-        modalIsShow.value = false;
-      }
-      break;
-    case '5': // 打开前后门
-      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1' && selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-        handler = () => {
-          frontDoorIsOpen.value = true;
-          backDoorIsOpen.value = true;
-        };
-        data.paramcode = 'sameTimeOpen';
-      }
-      break;
-    case '6': // 关闭前后门
-      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-        handler = () => {
-          frontDoorIsOpen.value = false;
-          backDoorIsOpen.value = false;
-        };
-        data.paramcode = 'sameTimeClose';
-      }
-      break;
-    case '7': // 远程与就地
-      if (selectData.contrlMod == 'codeCtrl') {
-        if (contrlValue == '1') {
-          data.paramcode = 'autoRoManualControl1';
-        } else if (contrlValue == '0') {
-          data.paramcode = 'autoRoManualControl2';
+    switch (handlerState) {
+      case '1': // 打开前门
+        if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
+          handler = () => {
+            frontDoorIsOpen.value = true;
+          };
+          data.paramcode = 'frontGateOpen_S';
         } else {
-          data.paramcode = 'autoRoManualControl0';
+          message.warning('前门已打开。。。');
+          modalIsShow.value = false;
         }
-        data.value = '';
-        selectData.autoRoManual = null;
-      } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
-        data.paramcode = 'autoRoManualControl';
-        data.value = '';
-        selectData.autoRoManual = null;
-      } else {
-        data.paramcode = 'autoRoManualControl';
-        data.value = contrlValue;
-        selectData.autoRoManual = null;
-      }
-      break;
-    case '10': // 前(A)窗控制
-      data.paramcode = 'frontSetValue1';
-      data.value = value;
-      break;
-    case '11': // 后(B)窗控制
-      data.paramcode = 'frontSetValue2';
-      data.value = value;
-      break;
-    case '12': // 后(B)窗控制
-      data.paramcode = 'rearSetValue1';
-      data.value = value;
-      break;
-    case '13': // 后(B)窗控制
-      data.paramcode = 'rearSetValue2';
-      data.value = value;
-      break;
-  }
+        break;
+      case '2': // 关闭前门
+        if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
+          handler = () => {
+            frontDoorIsOpen.value = false;
+          };
+          data.paramcode = 'frontGateClose_S';
+        } else {
+          message.warning('前门已关闭。。。');
+          modalIsShow.value = false;
+        }
+        break;
+      case '3': // 打开后门
+        if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+          handler = () => {
+            backDoorIsOpen.value = true;
+          };
+          data.paramcode = 'rearGateOpen_S';
+        } else {
+          message.warning('后门已打开。。。');
+          modalIsShow.value = false;
+        }
+        break;
+      case '4': // 关闭后门
+        if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+          handler = () => {
+            backDoorIsOpen.value = false;
+          };
+          data.paramcode = 'rearGateClose_S';
+        } else {
+          message.warning('后门已关闭。。。');
+          modalIsShow.value = false;
+        }
+        break;
+      case '8': // 打开中间门
+        if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
+          handler = () => {
+            midDoorIsOpen.value = true;
+          };
+          data.paramcode = 'midGateOpen_S';
+        } else {
+          message.warning('中间风门已打开。。。');
+          modalIsShow.value = false;
+        }
+        break;
+      case '9': // 关闭中间门
+        if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
+          handler = () => {
+            midDoorIsOpen.value = false;
+          };
+          data.paramcode = 'midGateClose_S';
+        } else {
+          message.warning('中间风门已关闭。。。');
+          modalIsShow.value = false;
+        }
+        break;
+      case '5': // 打开前后门
+        if (
+          selectData.frontGateOpen == '0' &&
+          selectData.frontGateClose == '1' &&
+          selectData.rearGateOpen == '0' &&
+          selectData.rearGateClose == '1'
+        ) {
+          handler = () => {
+            frontDoorIsOpen.value = true;
+            backDoorIsOpen.value = true;
+          };
+          data.paramcode = 'sameTimeOpen';
+        }
+        break;
+      case '6': // 关闭前后门
+        if (
+          selectData.frontGateOpen == '1' &&
+          selectData.frontGateClose == '0' &&
+          selectData.rearGateOpen == '1' &&
+          selectData.rearGateClose == '0'
+        ) {
+          handler = () => {
+            frontDoorIsOpen.value = false;
+            backDoorIsOpen.value = false;
+          };
+          data.paramcode = 'sameTimeClose';
+        }
+        break;
+      case '7': // 远程与就地
+        if (selectData.contrlMod == 'codeCtrl') {
+          if (contrlValue == '1') {
+            data.paramcode = 'autoRoManualControl1';
+          } else if (contrlValue == '0') {
+            data.paramcode = 'autoRoManualControl2';
+          } else {
+            data.paramcode = 'autoRoManualControl0';
+          }
+          data.value = '';
+          selectData.autoRoManual = null;
+        } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
+          data.paramcode = 'autoRoManualControl';
+          data.value = '';
+          selectData.autoRoManual = null;
+        } else {
+          data.paramcode = 'autoRoManualControl';
+          data.value = contrlValue;
+          selectData.autoRoManual = null;
+        }
+        break;
+      case '10': // 前(A)窗控制
+        data.paramcode = 'frontSetValue1';
+        data.value = value;
+        break;
+      case '11': // 后(B)窗控制
+        data.paramcode = 'frontSetValue2';
+        data.value = value;
+        break;
+      case '12': // 后(B)窗控制
+        data.paramcode = 'rearSetValue1';
+        data.value = value;
+        break;
+      case '13': // 后(B)窗控制
+        data.paramcode = 'rearSetValue2';
+        data.value = value;
+        break;
+    }
 
-  if (data.paramcode) {
-    deviceControlApi(data).then((res) => {
-      // 模拟时开启
-      if (res.success) {
-        modalIsShow.value = false;
-        if (globalConfig.History_Type == 'remote') {
-          message.success('指令已下发至生产管控平台成功!');
+    if (data.paramcode) {
+      deviceControlApi(data).then((res) => {
+        // 模拟时开启
+        if (res.success) {
+          modalIsShow.value = false;
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!');
+          } else {
+            message.success('指令已下发成功!');
+          }
         } else {
-          message.success('指令已下发成功!');
+          message.error(res.message);
         }
-      } else {
-        message.error(res.message);
-      }
-    });
+      });
+    }
   }
-}
-let isOpenRunning = false; //开关门动作是否在进行
-/** 开关门动画调用 */
-let isFrontOpenRunning = false; //开关门动作是否在进行
-// let isFrontCloseRunning = false; //开关门动作是否在进行
-let isRearOpenRunning = false; //开关门动作是否在进行
-// let isRearCloseRunning = false; //开关门动作是否在进行
-let isMidOpenRunning = false; //中间门动作是否在进行
-// let isMidCloseRunning = false; //中间门动作是否在进行
-// 0 关闭 1 正在打开 2 打开 3正在关闭
-let frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-let rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-let midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-function monitorAnimation(selectData) {
-  const timeScale = 0.005;
-  // 带风窗 风窗动画
-  if (selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')) playWindowAnimation(selectData);
+  let isOpenRunning = false; //开关门动作是否在进行
+  /** 开关门动画调用 */
+  let isFrontOpenRunning = false; //开关门动作是否在进行
+  // let isFrontCloseRunning = false; //开关门动作是否在进行
+  let isRearOpenRunning = false; //开关门动作是否在进行
+  // let isRearCloseRunning = false; //开关门动作是否在进行
+  let isMidOpenRunning = false; //中间门动作是否在进行
+  // let isMidCloseRunning = false; //中间门动作是否在进行
+  // 0 关闭 1 正在打开 2 打开 3正在关闭
+  let frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  let rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  let midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  function monitorAnimation(selectData) {
+    const timeScale = 0.005;
+    // 带风窗 风窗动画
+    if (selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')) playWindowAnimation(selectData);
 
-  if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
-    isFrontOpenRunning = true;
-    if (frontDeviceState != 1) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
-      play(1, timeScale);
-      frontDeviceState = 1;
-      frontDoorIsOpen.value = false;
-      backDoorIsOpen.value = true;
+    if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
+      isFrontOpenRunning = true;
+      if (frontDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
+        play(1, timeScale);
+        frontDeviceState = 1;
+        frontDoorIsOpen.value = false;
+        backDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
-    isFrontOpenRunning = true;
-    if (frontDeviceState != 1) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
-      play(1, timeScale);
-      frontDeviceState = 1;
-      frontDoorIsOpen.value = false;
-      backDoorIsOpen.value = true;
+    if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
+      isFrontOpenRunning = true;
+      if (frontDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
+        play(1, timeScale);
+        frontDeviceState = 1;
+        frontDoorIsOpen.value = false;
+        backDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
-    isFrontOpenRunning = false;
-    if (frontDeviceState != 0) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
-      play(2, timeScale);
-      frontDeviceState = 0;
-      frontDoorIsOpen.value = false;
-      // backDoorIsOpen.value = false
+    if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
+      isFrontOpenRunning = false;
+      if (frontDeviceState != 0) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
+        play(2, timeScale);
+        frontDeviceState = 0;
+        frontDoorIsOpen.value = false;
+        // backDoorIsOpen.value = false
+      }
     }
-  }
-  if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
-    isRearOpenRunning = true;
+    if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+      isRearOpenRunning = true;
 
-    if (rearDeviceState != 1) {
-      rearDeviceState = 1;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(3, timeScale);
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (rearDeviceState != 1) {
+        rearDeviceState = 1;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(3, timeScale);
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
-  if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
-    isRearOpenRunning = true;
+    if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+      isRearOpenRunning = true;
 
-    if (rearDeviceState != 1) {
-      rearDeviceState = 1;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(3, timeScale);
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (rearDeviceState != 1) {
+        rearDeviceState = 1;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(3, timeScale);
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
-    isRearOpenRunning = false;
-    if (rearDeviceState != 0) {
-      rearDeviceState = 0;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-      play(4, timeScale);
-      backDoorIsOpen.value = false;
+    if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
+      isRearOpenRunning = false;
+      if (rearDeviceState != 0) {
+        rearDeviceState = 0;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+        play(4, timeScale);
+        backDoorIsOpen.value = false;
+      }
     }
-  }
 
-  if (selectData.midGateOpen == '1' && selectData.midGateClose == '0' && !isMidOpenRunning) {
-    isMidOpenRunning = true;
+    if (selectData.midGateOpen == '1' && selectData.midGateClose == '0' && !isMidOpenRunning) {
+      isMidOpenRunning = true;
 
-    if (midDeviceState != 1) {
-      midDeviceState = 1;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(8, timeScale);
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (midDeviceState != 1) {
+        midDeviceState = 1;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(8, timeScale);
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.midGateOpen == '0' && selectData.midGateClose == '0' && !isMidOpenRunning) {
-    isMidOpenRunning = true;
+    if (selectData.midGateOpen == '0' && selectData.midGateClose == '0' && !isMidOpenRunning) {
+      isMidOpenRunning = true;
 
-    if (midDeviceState != 1) {
-      midDeviceState = 1;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(8, timeScale);
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (midDeviceState != 1) {
+        midDeviceState = 1;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(8, timeScale);
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
-    isMidOpenRunning = false;
-    if (midDeviceState != 0) {
-      midDeviceState = 0;
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-      play(9, timeScale);
-      backDoorIsOpen.value = false;
+    if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
+      isMidOpenRunning = false;
+      if (midDeviceState != 0) {
+        midDeviceState = 0;
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+        play(9, timeScale);
+        backDoorIsOpen.value = false;
+      }
     }
   }
-}
 
-function playWindowAnimation(data, maxarea = 90, isFirst = false) {
-  computePlay(data, maxarea, isFirst);
-}
+  function playWindowAnimation(data, maxarea = 90, isFirst = false) {
+    computePlay(data, maxarea, isFirst);
+  }
 
-function handleCancel() {
-  modalIsShow.value = false;
-  modalTitle.value = '';
-  modalType.value = '';
-}
+  function handleCancel() {
+    modalIsShow.value = false;
+    modalTitle.value = '';
+    modalType.value = '';
+  }
 
-// // 远程、就地切换
-// function changeType() {
-//   const data = {
-//     deviceid: selectData.deviceID,
-//     devicetype: selectData.deviceType,
-//     paramcode: 'autoRoManualControl',
-//     value: selectData.autoRoManual,
-//   };
-//   deviceControlApi(data).then(() => {
-//     if (globalConfig.History_Type == 'remote') {
-//       message.success('指令已下发至生产管控平台成功!');
-//     } else {
-//       message.success('指令已下发成功!');
-//     }
-//   });
-// }
+  // // 远程、就地切换
+  // function changeType() {
+  //   const data = {
+  //     deviceid: selectData.deviceID,
+  //     devicetype: selectData.deviceType,
+  //     paramcode: 'autoRoManualControl',
+  //     value: selectData.autoRoManual,
+  //   };
+  //   deviceControlApi(data).then(() => {
+  //     if (globalConfig.History_Type == 'remote') {
+  //       message.success('指令已下发至生产管控平台成功!');
+  //     } else {
+  //       message.success('指令已下发成功!');
+  //     }
+  //   });
+  // }
 
-// async function getDataSource() {
-//   dataSource.value = [];
-//   const params = await resetFormParam();
-//   if (stationType.value !== 'redis') {
-//     const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
-//     if (result['datalist']['records'].length > 0) {
-//       dataSource.value = result['datalist']['records'].map((item: any) => {
-//         return Object.assign(item, item['readData']);
-//       });
-//     } else {
-//       dataSource.value = [];
-//     }
-//   } else {
-//     const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
-//     dataSource.value = result['records'] || [];
-//   }
-// }
-onMounted(async () => {
-  const { query } = unref(currentRoute);
-  if (query['deviceType']) deviceType.value = query['deviceType'] as string;
-  modelList.value = await getDictItems('gateModel');
-  loading.value = true;
-  const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
-  debugger;
-  mountedThree(playerDom)
-    .then(async () => {
-      if (sysOrgCode != 'zmhjhzmy') {
-        await getMonitor(true);
-        loading.value = false;
-      } else {
-        // 韩咀无风门设备,只有报警历史数据,无其他数据
-        setModelType('fm1').then(async () => {
+  // async function getDataSource() {
+  //   dataSource.value = [];
+  //   const params = await resetFormParam();
+  //   if (stationType.value !== 'redis') {
+  //     const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
+  //     if (result['datalist']['records'].length > 0) {
+  //       dataSource.value = result['datalist']['records'].map((item: any) => {
+  //         return Object.assign(item, item['readData']);
+  //       });
+  //     } else {
+  //       dataSource.value = [];
+  //     }
+  //   } else {
+  //     const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
+  //     dataSource.value = result['records'] || [];
+  //   }
+  // }
+  onMounted(async () => {
+    const { query } = unref(currentRoute);
+    if (query['deviceType']) deviceType.value = query['deviceType'] as string;
+    modelList.value = await getDictItems('gateModel');
+    loading.value = true;
+    const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
+    debugger;
+    mountedThree(playerDom)
+      .then(async () => {
+        if (sysOrgCode != 'zmhjhzmy') {
+          await getMonitor(true);
           loading.value = false;
-          dataSource.value = [];
-          addMonitorText(selectData);
-        });
-      }
-    })
-    .catch(() => {
-      debugger;
-    });
-});
+        } else {
+          // 韩咀无风门设备,只有报警历史数据,无其他数据
+          setModelType('fm1').then(async () => {
+            loading.value = false;
+            dataSource.value = [];
+            addMonitorText(selectData);
+          });
+        }
+      })
+      .catch(() => {
+        debugger;
+      });
+  });
 
-onBeforeUnmount(() => {
-  getDeviceBaseList();
-});
+  onBeforeUnmount(() => {
+    getDeviceBaseList();
+  });
 
-onUnmounted(() => {
-  removeCamera();
-  if (timer) {
-    clearTimeout(timer);
-    timer = undefined;
-  }
-  destroy();
-});
+  onUnmounted(() => {
+    removeCamera();
+    if (timer) {
+      clearTimeout(timer);
+      timer = undefined;
+    }
+    destroy();
+  });
 </script>
 ,
 <style lang="less" scoped>
-@import '/@/design/theme.less';
-@import '/@/design/vent/modal.less';
-.scene-box {
-  .bottom-tabs-box {
-    height: 350px;
+  @import '/@/design/theme.less';
+  @import '/@/design/vent/modal.less';
+  .scene-box {
+    .bottom-tabs-box {
+      height: 350px;
+    }
   }
-}
-.button-box {
-  border: none !important;
-  height: 34px !important;
+  .button-box {
+    border: none !important;
+    height: 34px !important;
 
-  &:hover {
-    background: var(--vent-device-manager-control-btn-hover) !important;
-  }
+    &:hover {
+      background: var(--vent-device-manager-control-btn-hover) !important;
+    }
 
-  &::before {
-    height: 27px !important;
-    background: var(--vent-device-manager-control-btn) !important;
-  }
+    &::before {
+      height: 27px !important;
+      background: var(--vent-device-manager-control-btn) !important;
+    }
 
-  &::after {
-    top: 35px !important;
+    &::after {
+      top: 35px !important;
+    }
   }
-}
 
-:deep(.@{ventSpace}-tabs-tabpane-active) {
-  height: 100%;
-}
+  :deep(.@{ventSpace}-tabs-tabpane-active) {
+    height: 100%;
+  }
 
-::-webkit-scrollbar-thumb {
-  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
-  background: #4288a444;
-}
-:deep(.zxm-radio-disabled + span) {
-  color: var(--vent-font-color) !important;
-}
-:deep(.zxm-radio-disabled .zxm-radio-inner::after) {
-  background-color: #127cb5 !important;
-}
-:deep(.@{ventSpace}-picker-datetime-panel) {
-  height: 200px !important;
-  overflow-y: auto !important;
-}
+  ::-webkit-scrollbar-thumb {
+    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+    background: #4288a444;
+  }
+  :deep(.zxm-radio-disabled + span) {
+    color: var(--vent-font-color) !important;
+  }
+  :deep(.zxm-radio-disabled .zxm-radio-inner::after) {
+    background-color: #127cb5 !important;
+  }
+  :deep(.@{ventSpace}-picker-datetime-panel) {
+    height: 200px !important;
+    overflow-y: auto !important;
+  }
 </style>