Browse Source

[Feat 0000] 接入龙华光纤测温详情

hongrunxia 2 days ago
parent
commit
b4c3a9235a

+ 3 - 8
.editorconfig

@@ -1,14 +1,9 @@
 root = true
 
 [*]
-charset=utf-8
-end_of_line=lf
-insert_final_newline=true
-indent_style=space
-indent_size=2
-max_line_length = 100
-
-[*.{yml,yaml,json}]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
 indent_style = space
 indent_size = 2
 

+ 1 - 1
.env.development

@@ -32,5 +32,5 @@ VITE_GLOB_API_URL_PREFIX=
 # VITE_APP_SUB_APP = [["micro-vent-3dModal", "//192.168.183.154:8091/", "micro-vent-3dModal"], ["micro-need-air", "//192.168.183.88:8093/", "micro-need-air"], ["micro-fire-front", "//localhost:8097/", "fire-Micro"]]
 # VITE_APP_SUB_APP = [["micro-vent-3dModal", "//192.168.1.16:8091/", "micro-vent-3dModal"], ["micro-need-air", "//192.168.183.88:8093/", "micro-need-air"], ["micro-fire-front", "//localhost:8097/", "fire-Micro"]]
 # VITE_APP_SUB_APP = [["micro-vent-3dModal", "//182.92.126.35:8091", "micro-vent-3dModal"],["micro-vent-2dModal", "//localhost:8088", "micro-vent-2dModal"],["micro-vent-doc", "//localhost:5173", "micro-vent-doc"],["micro-need-air", "//182.92.126.35:8093", "micro-need-air"], ["micro-fire-front", "//182.92.126.35:8097", "fire-Micro"]]
-VITE_APP_SUB_APP = [["micro-vent-3dModal", "//192.168.1.16:8091", "micro-vent-3dModal"],["micro-vent-2dModal", "//localhost:8088", "micro-vent-2dModal"],["micro-vent-doc", "//localhost:5173", "micro-vent-doc"],["micro-need-air", "//182.92.126.35:8093", "micro-need-air"], ["micro-fire-front", "//182.92.126.35:8097", "fire-Micro"]]
+VITE_APP_SUB_APP = [["micro-vent-3dModal", "//192.168.1.23:8091", "micro-vent-3dModal"],["micro-vent-2dModal", "//localhost:8088", "micro-vent-2dModal"],["micro-vent-doc", "//localhost:5173", "micro-vent-doc"],["micro-need-air", "//192.168.1.21:8099", "micro-need-air"], ["micro-fire-front", "//182.92.126.35:8097", "fire-Micro"]]
 # VITE_APP_SUB_APP = [["micro-vent-3dModal", "//localhost:8091/"], ["micro-need-air", "//localhost:8099/"], ["micro-fire-front", "//localhost:8090/"]]

+ 32 - 16
index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="zh_CN" id="htmlRoot">
   <head>
     <meta charset="UTF-8" />
@@ -25,9 +25,9 @@
         }
         const remoteUrl = window.location.hostname === 'localhost' ? '182.92.126.35' : window.location.hostname;
         var script = document.createElement('script');
-          script.type = 'text/javascript';
-          script.src = 'http://'+remoteUrl+':9050/web-apps/apps/api/documents/api.js';
-          document.head.appendChild(script);
+        script.type = 'text/javascript';
+        script.src = 'http://' + remoteUrl + ':9050/web-apps/apps/api/documents/api.js';
+        document.head.appendChild(script);
       })();
     </script>
     <div id="app">
@@ -43,8 +43,8 @@
           background-color: none;
           background-image: url('./src/assets/images/themify/deepblue/loading-bg.png');
         }
-        body{
-          background-color: var(--vent-base-color)
+        body {
+          background-color: var(--vent-base-color);
         }
         .app-loading {
           display: flex;
@@ -273,35 +273,51 @@
         @keyframes before {
           0% {
             width: 0.5em;
-            box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
+            box-shadow:
+              1em -0.5em rgba(225, 20, 98, 0.75),
+              -1em 0.5em rgba(111, 202, 220, 0.75);
           }
           35% {
             width: 2.5em;
-            box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75), 0 0.5em rgba(111, 202, 220, 0.75);
+            box-shadow:
+              0 -0.5em rgba(225, 20, 98, 0.75),
+              0 0.5em rgba(111, 202, 220, 0.75);
           }
           70% {
             width: 0.5em;
-            box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75), 1em 0.5em rgba(111, 202, 220, 0.75);
+            box-shadow:
+              -1em -0.5em rgba(225, 20, 98, 0.75),
+              1em 0.5em rgba(111, 202, 220, 0.75);
           }
           100% {
-            box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
+            box-shadow:
+              1em -0.5em rgba(225, 20, 98, 0.75),
+              -1em 0.5em rgba(111, 202, 220, 0.75);
           }
         }
         @keyframes after {
           0% {
             height: 0.5em;
-            box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
+            box-shadow:
+              0.5em 1em rgba(61, 184, 143, 0.75),
+              -0.5em -1em rgba(233, 169, 32, 0.75);
           }
           35% {
             height: 2.5em;
-            box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75), -0.5em 0 rgba(233, 169, 32, 0.75);
+            box-shadow:
+              0.5em 0 rgba(61, 184, 143, 0.75),
+              -0.5em 0 rgba(233, 169, 32, 0.75);
           }
           70% {
             height: 0.5em;
-            box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75), -0.5em 1em rgba(233, 169, 32, 0.75);
+            box-shadow:
+              0.5em -1em rgba(61, 184, 143, 0.75),
+              -0.5em 1em rgba(233, 169, 32, 0.75);
           }
           100% {
-            box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
+            box-shadow:
+              0.5em 1em rgba(61, 184, 143, 0.75),
+              -0.5em -1em rgba(233, 169, 32, 0.75);
           }
         }
       </style>
@@ -323,11 +339,11 @@
             <div class="child-common child9"></div>
             <div class="child-common child10"></div>
           </div>
-          <div class="app-loading-title"><%= title %></div>
+          <div class="app-loading-title">正在加载</div>
         </div>
       </div>
     </div>
-    
+
     <script type="module" src="/src/main.ts"></script>
     <script>
       // var _hmt = _hmt || [];

+ 16 - 1
package.json

@@ -19,7 +19,8 @@
     "gen:icon": "esno ./build/generate/icon/index.ts",
     "batch:prettier": "prettier --write  \"./src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
     "upgrade:log": "conventional-changelog -p angular -i CHANGELOG.md -s",
-    "husky:install": "husky install"
+    "husky:install": "husky install",
+    "prepare": "husky install"
   },
   "dependencies": {
     "@ant-design/colors": "^7.0.0",
@@ -191,6 +192,20 @@
   "engines": {
     "node": "^12 || >=14"
   },
+  "lint-staged": {
+    "*.{js,jsx,ts,tsx,vue}": [
+      "prettier --write",
+      "eslint --fix",
+      "stylelint --fix"
+    ],
+    "*.{css,less,scss}": [
+      "prettier --write",
+      "stylelint --fix"
+    ],
+    "*.{html,json,md}": [
+      "prettier --write"
+    ]
+  },
   "vite": {
     "optimizeDeps": {
       "include": [

+ 22 - 10
prettier.config.js

@@ -1,20 +1,32 @@
 module.exports = {
+  // 行宽
   printWidth: 150,
+  // 缩进
   tabWidth: 2,
   useTabs: false,
-  semi: true, //语句末尾使用分号
-  vueIndentScriptAndStyle: true,
-  singleQuote: true, // 使用单引号
+  // 分号
+  semi: true,
+  // 引号
+  singleQuote: true,
+  jsxSingleQuote: false,
   quoteProps: 'as-needed',
-  bracketSpacing: true,
+  // 尾逗号
   trailingComma: 'es5',
-  jsxBracketSameLine: false,
-  jsxSingleQuote: false,
+  // 括号空格
+  bracketSpacing: true,
+  bracketSameLine: false,
+  // 箭头函数括号
   arrowParens: 'always',
-  insertPragma: false,
-  requirePragma: false,
-  proseWrap: 'never',
+  // Vue
+  vueIndentScriptAndStyle: true,
+  // 换行符 — 与 .editorconfig 保持统一
+  endOfLine: 'lf',
+  // HTML 空白
   htmlWhitespaceSensitivity: 'strict',
-  endOfLine: 'auto',
+  // Markdown
+  proseWrap: 'never',
+  // 范围 / pragma
   rangeStart: 0,
+  insertPragma: false,
+  requirePragma: false,
 };

+ 1 - 1
public/js/config.js

@@ -17,11 +17,11 @@ const VENT_PARAM = {
   modalText: '煤科通安(北京)智控科技有限公司研制', //国家能源集团沙吉海煤矿 //三维模型电子屏底部文字配置
   productionCrlPlatformUrl: '', // 神东要求主扇的控制功能改回跳转至生产管控平台,这里填写上生产管控地址后(例如填写:"https://www.baidu.com/"),就可以跳转了
   safetyCrlPlatformUrl: '', // 神东要求安全监控跳转至安全监控管控平台,这里填写上生产管控地址后(例如填写:"https://www.baidu.com/"),就可以跳转了
-  gasControlMock: false, // 项目关于瓦斯自主调控,是否模拟演示, true: 真实调控; false 模拟调控
   historyIsMultiple: false, // 设备历史数据是否支持多选
   isShowQy: true, // 是否显示气压
   is2DModel: false, // 是否尽最大可能使用2D模型
   isLoginByCode: false, // 登录页面是否有验证码
   loadText: '智能通风管控系统',
+  gasControlMock: false, // 项目关于瓦斯自主调控,是否模拟演示, true: 真实调控; false 模拟调控
   fanSwitchoverSimulation: false, // 不停风倒机模拟功能: true=启用模拟演示, false=使用实际控制
 }

+ 8 - 0
src/api/vent/index.ts

@@ -1,10 +1,12 @@
 import { defHttp } from '/@/utils/http/axios';
 import { AesEncryption } from '/@/utils/cipher';
 import { loginCipher } from '/@/settings/encryptionSetting';
+import { useVentStore } from '/@/store/modules/vent';
 
 enum Api {
   DEVICE_CONTROL = '/safety/ventanalyMonitorData/devicecontrol', // 开关控制
   SPRAY_CONTROL = '/ventanaly-device/safety/ventanalyMonitorData/batchDevicecontrol', // 皮带三级防灭火批量控制
+  modalNameList = '/ventanaly-device/safety/modelAlarmInfo/getAllModelFileJson',
 }
 
 // Get personal center-basic settings
@@ -33,3 +35,9 @@ export const sprayControlApi = (data) => {
     return defHttp.put({ url: Api.SPRAY_CONTROL, data });
   }
 };
+
+export const getModalType = async () => {
+  const res = await defHttp.get({ url: Api.modalNameList });
+  // 处理文件名称
+  debugger;
+};

+ 0 - 410
src/hooks/core/useThree copy.ts

@@ -1,410 +0,0 @@
-import * as THREE from 'three';
-import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
-// 导入轨道控制器
-import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
-
-import gsap from 'gsap';
-
-import ResourceTracker from '/@/utils/threejs/ResourceTracker';
-const resourceTracker = new ResourceTracker();
-const track = resourceTracker.track.bind(resourceTracker);
-
-class UseThree {
-  container: HTMLCanvasElement;
-  camera: THREE.PerspectiveCamera | null = null;
-  scene: THREE.Scene | null = null;
-  renderer: THREE.WebGLRenderer | null = null;
-  orbitControls: OrbitControls | null = null;
-  giftLoader: THREE.Object3D | null = null;
-  animationMixer: THREE.AnimationMixer | null = null;
-  animationAction: THREE.AnimationAction | null = null;
-  clock: THREE.Clock = new THREE.Clock(); // 计时器
-  timeoutId: NodeJS.Timeout | null = null;
-  animationId: number = 0;
-
-  constructor(selector) {
-    this.animationId = 0;
-    this.container = document.querySelector(selector);
-    //初始化
-    this.init();
-    this.animate();
-    window.addEventListener('resize', this.resizeRenderer.bind(this));
-    // 添加滚动事件,鼠标滚动模型执行动画
-    // window.addEventListener('wheel', this.wheelRenderer.bind(this));
-  }
-  init() {
-    // 初始化场景
-    this.initScene();
-    // 初始化环境光
-    this.initLight();
-    // 初始化相机
-    this.initCamera();
-    //初始化渲染器
-    this.initRenderer();
-    // 初始化控制器
-    this.initControles();
-  }
-
-  initScene() {
-    this.scene = new THREE.Scene();
-    const axesHelper = new THREE.AxesHelper(5);
-    // this.scene.add(axesHelper);
-  }
-  initLight() {
-    const light = new THREE.AmbientLight(0xfafafa, 1);
-    light.position.set(0, 200, 200);
-    (this.scene as THREE.Scene).add(light);
-  }
-  initCamera() {
-    this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 100);
-    this.camera.position.set(0, 0.2, 0.3);
-  }
-  initRenderer() {
-    this.renderer = new THREE.WebGLRenderer({ antialias: true });
-    // 设置屏幕像素比
-    this.renderer.setPixelRatio(window.devicePixelRatio);
-    // 设置渲染的尺寸
-    this.renderer.setSize(window.innerWidth, window.innerHeight);
-    // 色调映射
-    this.renderer.toneMapping = THREE.ACESFilmicToneMapping;
-    // 曝光程度
-    this.renderer.toneMappingExposure = 3;
-    this.container.appendChild(this.renderer.domElement);
-  }
-
-  initControles() {
-    this.orbitControls = new OrbitControls(this.camera as THREE.Camera, this.renderer?.domElement);
-  }
-
-  test() {
-    //
-    const planeGeometry = new THREE.PlaneGeometry(1, 1);
-    const meshStandardMaterial = new THREE.MeshStandardMaterial();
-    const mesh = new THREE.Mesh(planeGeometry, meshStandardMaterial);
-    mesh.position.set(0, -0.2, 0);
-    mesh.rotation.z = Math.PI / 4;
-    this.scene?.add(mesh);
-  }
-
-  setGLTFModel(modalName) {
-    const a = new Date().getTime() / 1000;
-    return new Promise(async (resolve, reject) => {
-      try {
-        const db = window['CustomDB'];
-        const modalArr = await db.modal.where('modalName').equals(modalName).toArray();
-        if (modalArr.length > 0) {
-          const modalValue = modalArr[0].modalVal;
-          new THREE.ObjectLoader().parse(modalValue, (e) => {
-            const group = e.children[0];
-
-            const cityMaterial = new THREE.MeshBasicMaterial({
-              color: new THREE.Color(0x0c016f),
-            });
-            group?.traverse((item: THREE.Mesh) => {
-              if (item.type === 'Mesh') {
-                item.material = cityMaterial;
-                this.setMaterial(item);
-              }
-            });
-            this.scene?.add(e.children[0]);
-            console.log(new Date().getTime() / 1000 - a + ' s');
-            resolve(this.scene);
-          });
-        }
-      } catch (error) {
-        reject('加载模型出错');
-      }
-    });
-  }
-
-  setMaterial(obj) {
-    obj.geometry.computeBoundingBox();
-    const { max, min } = obj.geometry.boundingBox;
-    const distance = max.y - min.y + 2;
-
-    obj.material.onBeforeCompile = (shader) => {
-      shader.uniforms.uDistance = {
-        value: distance,
-      };
-      shader.uniforms.uTopColor = {
-        value: new THREE.Color(0xaaaeff),
-      };
-      this.addGrad(shader);
-      this.addRadiusSpread(shader);
-      this.addLineSpread(shader);
-      this.addToSpread(shader);
-    };
-  }
-  addGrad(shader) {
-    shader.vertexShader = shader.vertexShader.replace(
-      '#include <common>',
-      `
-
-      #include <common>
-      varying vec3 vPosition;
-    `
-    );
-    shader.vertexShader = shader.vertexShader.replace(
-      '#include <fog_vertex>',
-      `
-
-      #include <fog_vertex>
-      vPosition = position;
-     `
-    );
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '#include <common>',
-      `
-      #include <common>
-      uniform vec3 uTopColor;
-      uniform float uDistance;
-      varying vec3 vPosition;
-  
-      `
-    );
-
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '#include <dithering_fragment>',
-      `
-      #include <dithering_fragment>
-
-      vec4 distGradColor = gl_FragColor;
-      // 设置混合的百分比
-      float gradMix = (vPosition.y + (uDistance / 2.0)) / uDistance / 5.0;
-      // 设置混合颜色
-      vec3 colorMix = mix(distGradColor.xyz, uTopColor, gradMix);
-      gl_FragColor = vec4(colorMix, 1.0);
-      //#end#
-      `
-    );
-  }
-
-  addRadiusSpread(shader) {
-    // 设置扩散中心店
-    shader.uniforms.uRadiusSpreadCenter = {
-      value: new THREE.Vector2(0, 0),
-    };
-    // 扩散时间
-    shader.uniforms.uRadiusSpreadTime = {
-      value: 0,
-    };
-
-    shader.uniforms.uRadiusSpreadWidth = {
-      value: 20,
-    };
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '#include <common>',
-      `
-      #include <common>
-      uniform vec2 uRadiusSpreadCenter;
-      uniform float uRadiusSpreadTime;
-      uniform float uRadiusSpreadWidth;
-
-      `
-    );
-
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '//#end#',
-      `
-      float spreadRadius = distance(vPosition.xz + vec2(-720, -550), uRadiusSpreadCenter);
-      // 扩散范围
-      float spreadIndex = -(spreadRadius - uRadiusSpreadTime) * (spreadRadius - uRadiusSpreadTime ) + uRadiusSpreadWidth;
-      if(spreadIndex > 0.0){
-        gl_FragColor = mix(gl_FragColor, vec4(1.0, 1.0, 1.0, 1.0), spreadIndex / uRadiusSpreadWidth );
-      }
-      //#end#
-      `
-    );
-    gsap.to(shader.uniforms.uRadiusSpreadTime, {
-      value: 250,
-      duration: 1,
-      ease: 'none',
-      repeat: -1,
-    });
-  }
-
-  addLineSpread(shader) {
-    // 设置扩散中心店
-    shader.uniforms.uLineSpreadCenter = {
-      value: new THREE.Vector2(0, 0),
-    };
-    // 扩散时间
-    shader.uniforms.uLineSpreadTime = {
-      value: 0,
-    };
-
-    shader.uniforms.uLineSpreadWidth = {
-      value: 20,
-    };
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '#include <common>',
-      `
-      #include <common>
-      uniform vec2 uLineSpreadCenter;
-      uniform float uLineSpreadTime;
-      uniform float uLineSpreadWidth;
-
-      `
-    );
-
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '//#end#',
-      `
-      float spreadLine = vPosition.x - 400.0;
-      // 扩散范围
-      float spreadLineIndex = -(spreadLine - uLineSpreadTime * 5.0) * (spreadLine - uLineSpreadTime * 5.0) + uLineSpreadWidth;
-      if(spreadLineIndex > 0.0){
-        gl_FragColor = mix(gl_FragColor, vec4(1.0, 1.0, 1.0, 1.0), spreadLineIndex / uLineSpreadWidth );
-      }
-      //#end#
-      `
-    );
-    gsap.to(shader.uniforms.uLineSpreadTime, {
-      value: 150,
-      duration: 2,
-      ease: 'none',
-      repeat: -1,
-    });
-  }
-
-  addToSpread(shader) {
-    // 设置扩散中心店
-    shader.uniforms.uTopSpreadCenter = {
-      value: new THREE.Vector2(0, 0),
-    };
-    // 扩散时间
-    shader.uniforms.uTopSpreadTime = {
-      value: 0,
-    };
-
-    shader.uniforms.uTopSpreadWidth = {
-      value: 20,
-    };
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '#include <common>',
-      `
-      #include <common>
-      uniform vec2 uTopSpreadCenter;
-      uniform float uTopSpreadTime;
-      uniform float uTopSpreadWidth;
-
-      `
-    );
-
-    shader.fragmentShader = shader.fragmentShader.replace(
-      '//#end#',
-      `
-      float spreadTopLine = vPosition.y * 2.0;
-      // 扩散范围uTopSpreadWidth
-      float spreadTopIndex = -(spreadTopLine - uTopSpreadTime) * (spreadTopLine - uTopSpreadTime) + uTopSpreadWidth;
-      if(spreadTopIndex > 0.0){
-        gl_FragColor = mix(gl_FragColor, vec4(0.0, 1.0, 1.0, 1.0), spreadTopIndex / uTopSpreadWidth / uTopSpreadTime * 2.0);
-      }
-      //#end#
-      `
-    );
-    gsap.to(shader.uniforms.uTopSpreadTime, {
-      value: 200,
-      duration: 5,
-      ease: 'none',
-      repeat: -1,
-    });
-  }
-
-  addLine(geometry) {
-    const edges = new THREE.EdgesGeometry(geometry);
-    const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0xff0000 }));
-    (this.scene as THREE.Scene).add(line);
-    // console.log(line);
-  }
-
-  /* 场景环境背景 */
-  setEnvMap(hdr) {
-    new RGBELoader().setPath('/public/model/hdr/').load(hdr + '.hdr', (texture) => {
-      texture.mapping = THREE.EquirectangularReflectionMapping;
-      (this.scene as THREE.Scene).background = texture;
-      (this.scene as THREE.Scene).environment = texture;
-    });
-  }
-
-  render() {
-    const delta = this.clock.getDelta();
-    this.renderer?.render(this.scene as THREE.Object3D, this.camera as THREE.Camera);
-    this.animationMixer?.update(delta);
-  }
-
-  animate() {
-    // this.renderer?.setAnimationLoop(this.render.bind(this));
-    if (this.animationId != -1) {
-      this.render();
-      this.animationId = requestAnimationFrame(this.animate.bind(this));
-    }
-  }
-  resizeRenderer() {
-    // 更新相机比例
-    (this.camera as THREE.PerspectiveCamera).aspect = window.innerWidth / window.innerHeight;
-    // 刷新相机矩阵
-    this.camera?.updateProjectionMatrix();
-    // 设置场景尺寸
-    this.renderer?.setSize(window.innerWidth, window.innerHeight);
-  }
-  wheelRenderer(e: WheelEvent) {
-    const timeScale = e.deltaY > 0 ? 1 : -1;
-    this.animationAction?.setEffectiveTimeScale(timeScale);
-    (this.animationAction as THREE.AnimationAction).paused = false;
-    this.animationAction?.play();
-    if (this.timeoutId) {
-      clearTimeout(this.timeoutId);
-    }
-    this.timeoutId = setTimeout(() => {
-      this.animationAction?.halt(0.5);
-    }, 500);
-  }
-  clearScene() {
-    this.scene?.children.forEach((obj: any) => {
-      if (obj.type === 'Group') {
-        obj.traverse(function (item: any) {
-          if (item.type === 'Mesh') {
-            item.geometry.dispose();
-            item.material.dispose();
-            !!item.clear && item.clear();
-          }
-        });
-      } else if (obj.material) {
-        obj.material.dispose();
-      } else if (obj.geometry) {
-        obj.geometry.dispose();
-      }
-      this.scene?.remove(obj);
-      !!obj.clear ?? obj.clear();
-      obj = null;
-    });
-    const gl = this.renderer?.domElement.getContext('webgl');
-    gl && gl?.getExtension('WEBGL_lose_context')?.loseContext();
-
-    this.renderer?.forceContextLoss();
-    this.renderer?.dispose();
-    this.camera = null;
-    this.orbitControls = null;
-    this.renderer.domElement = null;
-    this.renderer = null;
-
-    // css3dRender.domElement = null;
-    // css3dRender = null;
-    // model3D.innerHTML = '';
-    // css3D.innerHTML = '';
-    // model3D = null
-    // css3D = null
-
-    !!this.scene?.clear ?? this.scene?.clear();
-    cancelAnimationFrame(this.animationId);
-    this.animationId = -1;
-    // this.stats = null
-    // scene = null
-
-    THREE.Cache.clear();
-    console.log('3D环境已清理干净');
-  }
-}
-
-export default UseThree;

+ 84 - 110
src/hooks/vent/useThree.ts

@@ -166,7 +166,6 @@ class UseThree {
 
   setGLTFModel(modalNames, group = null, isBlender = false) {
     window['startTime'] = new Date().getTime();
-    const modelStore = useModelStore();
     return new Promise(async (resolve, reject) => {
       try {
         const gltfLoader = new GLTFLoader();
@@ -186,15 +185,12 @@ class UseThree {
             try {
               // 解析模型
               const modalNameStr = modalNameArr[i];
-              const data = modelStore.modelArr.get(modalNameStr) || null;
               let modalValue;
-              if (!data) {
-                const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
-                if (modalArr.length > 0) {
-                  modalValue = modalArr[0].modalVal;
-                }
-              } else {
-                modalValue = data.modalVal;
+              const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
+              if (modalArr.length > 0 && modalArr[0].modalVal.byteLength > 0) {
+                modalValue = modalArr[0].modalVal;
+              } else if (modalArr.length > 0) {
+                db.modal.delete(modalArr[0].id);
               }
               if (modalValue) {
                 gltfLoader.parse(
@@ -202,7 +198,6 @@ class UseThree {
                   '/model/glft/',
                   (gltf) => {
                     let object: THREE.Object3D = gltf.scene;
-                    // setModalCenter(object);
                     object.traverse((obj) => {
                       if (obj instanceof THREE.Mesh) {
                         obj.material.emissiveIntensity = 1;
@@ -233,35 +228,98 @@ class UseThree {
                         // obj.renderOrder = 1;
                       }
                     });
-
-                    if (object.children.length == 0) {
+                    if (isBlender) {
                       object = object.children[0];
                     }
                     object.animations = gltf.animations;
                     object.name = modalNameStr;
-                    group?.add(object);
+                    if (group) group.add(object);
                     childResolve(object);
                   },
                   (err) => {
                     console.log(err);
+                    childResolve(null);
                   }
                 );
               } else {
                 // 开启线程下载
-                gltfLoader.load(`${baseApiUrl}/sys/common/static/webfile/${modalNameStr}.glb`, async (glft) => {
-                  if (glft) {
-                    const object = glft.scene;
-                    object.name = modalNameStr;
-                    if (glft.animations.length > 0) {
-                      object.animations = glft.animations;
-                    }
-                    group?.add(object);
-                    childResolve(object);
-                    const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
-                    if (modalArr.length < 1) {
-                      saveModel(modalNameStr, `webfile/${modalNameStr}.glb`, 1);
+
+                const result = (await getList({ fileName: modalNameStr })) || [];
+                const file = result['records'][0];
+                debugger;
+                console.log('需要开启线程下载模型资源。。。。。');
+
+                // 如果是常村时
+                const token = getToken();
+                fetch(`${baseApiUrl}/sys/common/static/webfile/${modalNameStr}.glb`, {
+                  method: 'GET',
+                  cache: 'no-cache',
+                  headers: {
+                    'Content-Type': 'application/force-download',
+                    Authorization: token,
+                    'X-Access-Token': token,
+                    token: token,
+                  },
+                }).then(async (data) => {
+                  const arrayBuffer = await data.arrayBuffer();
+                  // 将资源存放到db
+                  const fileName = modalNameStr;
+                  const model = {
+                    modalName: fileName,
+                    modalVal: arrayBuffer,
+                    versionStr: fileName,
+                  };
+                  db.open();
+                  await db.modal.add(model);
+                  gltfLoader.parse(
+                    arrayBuffer,
+                    '/model/glft/',
+                    (gltf) => {
+                      let object: THREE.Object3D = gltf.scene;
+                      // setModalCenter(object);
+                      object.traverse((obj) => {
+                        if (obj instanceof THREE.Mesh) {
+                          obj.material.emissiveIntensity = 1;
+                          obj.material.emissiveMap = obj.material.map;
+                          obj.material.blending = THREE.CustomBlending;
+
+                          if (obj.material.opacity < 1) {
+                            obj.material.transparent = true;
+                          }
+                          if (obj.material.map) {
+                            obj.material.map.colorSpace = THREE.SRGBColorSpace;
+                            obj.material.map.flipY = false;
+                            obj.material.map.anisotropy = 1;
+                          }
+                          if (obj.material.emissiveMap) {
+                            obj.material.emissiveMap.colorSpace = THREE.SRGBColorSpace;
+                            obj.material.emissiveMap.flipY = false;
+                          }
+
+                          if (obj.material.map || obj.material.emissiveMap) {
+                            obj.material.needsUpdate = true;
+                          }
+
+                          // if (envMap) {
+                          //   obj.material.envMap = envMap;
+                          //   obj.material.envMapIntensity = 1;
+                          // }
+                          // obj.renderOrder = 1;
+                        }
+                      });
+                      if (isBlender) {
+                        object = object.children[0];
+                      }
+                      object.animations = gltf.animations;
+                      object.name = modalNameStr;
+                      if (group) group.add(object);
+                      childResolve(object);
+                    },
+                    (err) => {
+                      console.log(err);
+                      childResolve(null);
                     }
-                  }
+                  );
                 });
               }
             } catch (error) {
@@ -280,90 +338,6 @@ class UseThree {
     });
   }
 
-  // setFBXModel(modalNames, group = null) {
-  //   window['startTime'] = new Date().getTime();
-  //   const modelStore = useModelStore();
-  //   return new Promise(async (resolve, reject) => {
-  //     try {
-  //       const fbxLoader = new FBXLoader();
-
-  //       fbxLoader.setPath('/model/fbx/');
-
-  //       const db = window['CustomDB'];
-  //       const resolvePromise: Promise<any>[] = [];
-
-  //       let modalNameArr = Object.prototype.toString.call(modalNames) === '[object Array]' ? modalNames : [modalNames];
-  //       let len = modalNameArr.length;
-
-  //       for (let i = 0; i < len; i++) {
-  //         resolvePromise[i] = new Promise(async (childResolve, reject) => {
-  //           try {
-  //             // 解析模型
-  //             let modalValue;
-  //             const modalNameStr = modalNameArr[i];
-  //             let data = modelStore.modelArr.get(modalNameStr) || null;
-  //             if (!data) {
-  //               const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
-  //               if (modalArr.length > 0) modalValue = modalArr[0].modalVal;
-  //             } else {
-  //               modalValue = data.modalVal;
-  //             }
-  //             if (modalValue) {
-  //               const object = fbxLoader.parse(modalValue, '/model/fbx/');
-  //               // const object = fbx.scene;
-  //               // setModalCenter(object);
-  //               if (object) {
-  //                 object.traverse((obj) => {
-  //                   if (obj instanceof THREE.Mesh) {
-  //                     obj.material.emissiveIntensity = 1;
-  //                     obj.material.emissiveMap = obj.material.map;
-  //                     obj.material.blending = THREE.CustomBlending;
-  //                     if (obj.material.opacity < 1) {
-  //                       obj.material.transparent = true;
-  //                     }
-  //                     if (obj.material.map) {
-  //                       obj.material.map.encoding = THREE.sRGBEncoding;
-  //                       obj.material.map.flipY = false;
-  //                       obj.material.map.anisotropy = 1;
-  //                     }
-  //                     if (obj.material.emissiveMap) {
-  //                       obj.material.emissiveMap.encoding = THREE.sRGBEncoding;
-  //                       obj.material.emissiveMap.flipY = false;
-  //                     }
-
-  //                     if (obj.material.map || obj.material.emissiveMap) {
-  //                       obj.material.needsUpdate = true;
-  //                     }
-
-  //                     // if (envMap) {
-  //                     //   obj.material.envMap = envMap;
-  //                     //   obj.material.envMapIntensity = 1;
-  //                     // }
-  //                     // obj.renderOrder = 1;
-  //                   }
-  //                 });
-  //                 object.animations = object.animations;
-  //                 object.name = modalNameStr;
-  //                 group?.add(object);
-  //                 childResolve(object);
-  //               }
-  //             }
-  //           } catch (error) {
-  //             console.log(error);
-  //             reject();
-  //           }
-  //         });
-  //       }
-
-  //       Promise.all(resolvePromise).then((objects) => {
-  //         resolve(objects);
-  //       });
-  //     } catch (error) {
-  //       reject('加载模型出错');
-  //     }
-  //   });
-  // }
-
   setTestPlane() {
     const plane = new THREE.Mesh(new THREE.PlaneGeometry(10, 10), new THREE.MeshPhongMaterial({ color: 0x999999, specular: 0x101010 }));
     plane.rotation.x = -Math.PI / 2;

+ 9 - 1
src/qiankun/apps.ts

@@ -35,6 +35,14 @@ for (const key in import.meta.env) {
       _apps.push(obj);
     });
   }
-  prefetchApps([..._apps]);
+  // prefetchApps([..._apps]);
+  // 延迟预取子应用资源到浏览器空闲时,避免启动时与首屏关键请求竞争带宽
+  const schedulePrefetch = window.requestIdleCallback || ((cb) => setTimeout(cb, 200));
+  schedulePrefetch(
+    () => {
+      prefetchApps([..._apps]);
+    },
+    { timeout: 3000 } as IdleRequestOptions
+  );
 }
 export const apps = _apps;

+ 6 - 0
src/store/modules/permission.ts

@@ -24,6 +24,8 @@ import { useMessage } from '/@/hooks/web/useMessage';
 import { PageEnum } from '/@/enums/pageEnum';
 // import { cloneDeep } from 'lodash-es';
 import { useGlobSetting } from '/@/hooks/setting';
+import { useVentStore } from '/@/store/modules/vent';
+import { getModalType } from '/@/api/vent/index';
 
 // 系统权限
 interface AuthItem {
@@ -136,6 +138,7 @@ export const usePermissionStore = defineStore({
     async buildRoutesAction(): Promise<AppRouteRecordRaw[]> {
       const userStore = useUserStore();
       const appStore = useAppStoreWithOut();
+      const ventStore = useVentStore();
 
       let routes: AppRouteRecordRaw[] = [];
       const roleList = toRaw(userStore.getRoleList) || [];
@@ -294,6 +297,9 @@ export const usePermissionStore = defineStore({
 
       routes.push(ERROR_LOG_ROUTE);
       patchHomeAffix(routes);
+
+      /** 查询系统模型 */
+      await getModalType();
       return routes;
     },
     setAuthData(systemPermission) {

+ 1 - 0
src/store/modules/vent.ts

@@ -7,6 +7,7 @@ export const useVentStore = defineStore({
     return {
       allTableHeaderColumns: null,
       resultWebSocket: null,
+      modalTypes: null,
     };
   },
   getters: {

+ 5 - 11
src/utils/threejs/useThree.ts

@@ -197,7 +197,6 @@ class UseThree {
 
   setGLTFModel(modalNames, group = null, isBlender = false) {
     window['startTime'] = new Date().getTime();
-    const modelStore = useModelStore();
     return new Promise(async (resolve, reject) => {
       try {
         const gltfLoader = new GLTFLoader();
@@ -217,15 +216,12 @@ class UseThree {
             try {
               // 解析模型
               const modalNameStr = modalNameArr[i];
-              const data = modelStore.modelArr.get(modalNameStr) || null;
               let modalValue;
-              if (!data) {
-                const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
-                if (modalArr.length > 0) {
-                  modalValue = modalArr[0].modalVal;
-                }
-              } else {
-                modalValue = data.modalVal;
+              const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
+              if (modalArr.length > 0 && modalArr[0].modalVal.byteLength > 0) {
+                modalValue = modalArr[0].modalVal;
+              } else if (modalArr.length > 0) {
+                db.modal.delete(modalArr[0].id);
               }
               if (modalValue) {
                 gltfLoader.parse(
@@ -233,7 +229,6 @@ class UseThree {
                   '/model/glft/',
                   (gltf) => {
                     let object: THREE.Object3D = gltf.scene;
-                    // setModalCenter(object);
                     object.traverse((obj) => {
                       if (obj instanceof THREE.Mesh) {
                         obj.material.emissiveIntensity = 1;
@@ -282,7 +277,6 @@ class UseThree {
 
                 const result = (await getList({ fileName: modalNameStr })) || [];
                 const file = result['records'][0];
-                debugger;
                 console.log('需要开启线程下载模型资源。。。。。');
 
                 // 如果是常村时

+ 377 - 377
src/views/vent/home/configurable/belt/belt-new.vue

@@ -48,366 +48,320 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, ref, watch, nextTick, computed, onUnmounted, provide } from 'vue';
-import customHeader from './components/customHeader-belt.vue';
-import { useInitConfigs, useInitPage } from '../hooks/useInit';
-import { testBeltNew, testYjkf, testSpary } from './configurable.data';
-import ModuleCommon from './components/ModuleCommon.vue';
-import ModuleCommonDual from './components/ModuleCommonDual.vue';
-import Three3D from '/@/views/vent/home/configurable/components/three3D.vue';
-import BeltNav from './components/BeltNav.vue';
-import { useRouter, useRoute } from 'vue-router';
-import { getSystem, getMonitorAndAlertBelt, getWarnInfo, getDevice, getDataHome, getWarnResult, getStaffInfo } from './configurable.api';
-import { modalAnimate, destroy } from './threejs/belt.threejs';
-// 初始化配置
-const { configs, fetchConfigs } = useInitConfigs();
-const cfgs = computed(() => configs.value.filter((_, index) => index !== 2 && index !== 3));
-const cfgA = computed<any>(() => configs.value[2]);
-const cfgB = computed<any>(() => configs.value[3]);
-const { updateEnhancedConfigs, updateData, data } = useInitPage('矿井全域皮带巷三级防灭火系统');
-const isInitModal = ref(false);
-const pageCache = ref({
-  fire_risk_warn: { configs: testBeltNew },
-  emergencyControl: { configs: testYjkf },
-  sprayControl: { configs: testSpary },
-});
-let timer = null,
-  modal = null;
-const pageType = ref('fire_risk_warn');
-const route = useRoute();
-const modalMonitorData = ref({});
-// 下拉框选项
-/** 场景选项 */
-const options = ref([]);
-const optionValue = ref('');
-const isRefreshing = ref(false); // 防止重复刷新
-async function getSysDataSource() {
-  const res = await getDataHome({ dataList: 'risk_evaluator' }).catch(() => {});
-  options.value = res.risk_evaluator || [];
-  await nextTick();
-  if (options.value.length > 0 && !optionValue.value) {
-    const firstId = options.value[0].sys_id;
-    changeSelectRow(firstId);
-  }
-}
-// 切换检测数据
-function changeSelectRow(deviceID) {
-  optionValue.value = deviceID;
-  refresh();
-}
-// 预警等级映射
-const warnTypeMap = {
-  '102': '黄色预警(较大风险)',
-  '103': '橙色预警(重大风险)',
-  '104': '红色预警(特别重大风险)',
-};
-// 处理接口返回数据
-interface WarnResult {
-  warnName: string;
-  coRange?: string;
-  coTrend?: string;
-  tempRange?: string;
-  tempTrend?: string;
-  hclRange?: string;
-  warnCtrl?: string;
-}
-// 处理预警指标展示数据格式
-function groupWarnByType(data: any) {
-  const result: WarnResult[] = [];
-  // 遍历 102、103、104...
-  Object.keys(data).forEach((warnKey) => {
-    const list = data[warnKey] || [];
-    const warnName = warnTypeMap[warnKey as keyof typeof warnTypeMap];
-    function getWarnCtrlByWarnName(warnName) {
-      if (warnName === '黄色预警(较大风险)') return '预警';
-      if (warnName === '橙色预警(重大风险)') return '报警启动喷淋';
-      if (warnName === '红色预警(特别重大风险)') return '启动喷淋与排烟';
-      return '';
+  import { onMounted, ref, watch, nextTick, computed, onUnmounted, provide } from 'vue';
+  import customHeader from './components/customHeader-belt.vue';
+  import { useInitConfigs, useInitPage } from '../hooks/useInit';
+  import { testBeltNew, testYjkf, testSpary } from './configurable.data';
+  import ModuleCommon from './components/ModuleCommon.vue';
+  import ModuleCommonDual from './components/ModuleCommonDual.vue';
+  import Three3D from '/@/views/vent/home/configurable/components/three3D.vue';
+  import BeltNav from './components/BeltNav.vue';
+  import { useRouter, useRoute } from 'vue-router';
+  import { getSystem, getMonitorAndAlertBelt, getWarnInfo, getDevice, getDataHome, getWarnResult, getStaffInfo } from './configurable.api';
+  import { modalAnimate, destroy } from './threejs/belt.threejs';
+  // 初始化配置
+  const { configs, fetchConfigs } = useInitConfigs();
+  const cfgs = computed(() => configs.value.filter((_, index) => index !== 2 && index !== 3));
+  const cfgA = computed<any>(() => configs.value[2]);
+  const cfgB = computed<any>(() => configs.value[3]);
+  const { updateEnhancedConfigs, updateData, data } = useInitPage('矿井全域皮带巷三级防灭火系统');
+  const isInitModal = ref(false);
+  const pageCache = ref({
+    fire_risk_warn: { configs: testBeltNew },
+    emergencyControl: { configs: testYjkf },
+    sprayControl: { configs: testSpary },
+  });
+  let timer = null,
+    modal = null;
+  const pageType = ref('fire_risk_warn');
+  const route = useRoute();
+  const modalMonitorData = ref({});
+  // 下拉框选项
+  /** 场景选项 */
+  const options = ref([]);
+  const optionValue = ref('');
+  const isRefreshing = ref(false); // 防止重复刷新
+  async function getSysDataSource() {
+    const res = await getDataHome({ dataList: 'risk_evaluator' }).catch(() => {});
+    options.value = res.risk_evaluator || [];
+    await nextTick();
+    if (options.value.length > 0 && !optionValue.value) {
+      const firstId = options.value[0].sys_id;
+      changeSelectRow(firstId);
     }
-    // 构建当前预警对象
-    const warnObj: WarnResult = { warnName };
-    warnObj.warnCtrl = getWarnCtrlByWarnName(warnName);
-    list.forEach((item: any) => {
-      const { deviceType, fmin, fmax, trendMin, trendMax, trendCxTimeUnit } = item;
-      // CO
-      if (deviceType === 'modelsensor_co') {
-        if (fmin != null && fmax != null) {
-          warnObj.coRange = `${fmin} - ${fmax}`;
-        } else if (fmin != null && fmax == null) {
-          warnObj.coRange = `> ${fmin}`;
-        }
-        // 处理变化率
-        else if (trendMin != null && trendMax != null) {
-          if (warnName === '黄色预警(较大风险)') {
-            warnObj.coTrend = `加速上升(${trendMin} - ${trendMax})`;
-          } else if (warnName === '橙色预警(重大风险)') {
-            warnObj.coTrend = `急剧上升(${trendMin} - ${trendMax})`;
-          } else if (warnName === '红色预警(特别重大风险)') {
-            warnObj.coTrend = `极端上升(${trendMin} - ${trendMax})`;
+  }
+  // 切换检测数据
+  function changeSelectRow(deviceID) {
+    optionValue.value = deviceID;
+    refresh();
+  }
+  // 预警等级映射
+  const warnTypeMap = {
+    '102': '黄色预警(较大风险)',
+    '103': '橙色预警(重大风险)',
+    '104': '红色预警(特别重大风险)',
+  };
+  // 处理接口返回数据
+  interface WarnResult {
+    warnName: string;
+    coRange?: string;
+    coTrend?: string;
+    tempRange?: string;
+    tempTrend?: string;
+    hclRange?: string;
+    warnCtrl?: string;
+  }
+  // 处理预警指标展示数据格式
+  function groupWarnByType(data: any) {
+    const result: WarnResult[] = [];
+    // 遍历 102、103、104...
+    Object.keys(data).forEach((warnKey) => {
+      const list = data[warnKey] || [];
+      const warnName = warnTypeMap[warnKey as keyof typeof warnTypeMap];
+      function getWarnCtrlByWarnName(warnName) {
+        if (warnName === '黄色预警(较大风险)') return '预警';
+        if (warnName === '橙色预警(重大风险)') return '报警启动喷淋';
+        if (warnName === '红色预警(特别重大风险)') return '启动喷淋与排烟';
+        return '';
+      }
+      // 构建当前预警对象
+      const warnObj: WarnResult = { warnName };
+      warnObj.warnCtrl = getWarnCtrlByWarnName(warnName);
+      list.forEach((item: any) => {
+        const { deviceType, fmin, fmax, trendMin, trendMax, trendCxTimeUnit } = item;
+        // CO
+        if (deviceType === 'modelsensor_co') {
+          if (fmin != null && fmax != null) {
+            warnObj.coRange = `${fmin} - ${fmax}`;
+          } else if (fmin != null && fmax == null) {
+            warnObj.coRange = `> ${fmin}`;
+          }
+          // 处理变化率
+          else if (trendMin != null && trendMax != null) {
+            if (warnName === '黄色预警(较大风险)') {
+              warnObj.coTrend = `加速上升(${trendMin} - ${trendMax})`;
+            } else if (warnName === '橙色预警(重大风险)') {
+              warnObj.coTrend = `急剧上升(${trendMin} - ${trendMax})`;
+            } else if (warnName === '红色预警(特别重大风险)') {
+              warnObj.coTrend = `极端上升(${trendMin} - ${trendMax})`;
+            }
+          } else if (trendMin != null && trendMax == null) {
+            warnObj.coTrend = `极端上升>${trendMin}`;
           }
-        } else if (trendMin != null && trendMax == null) {
-          warnObj.coTrend = `极端上升>${trendMin}`;
         }
-      }
-      // 温度(带单位)
-      else if (deviceType === 'modelsensor_temperature') {
-        if (fmin != null && fmax != null) {
-          warnObj.tempRange = `${fmin} - ${fmax}℃`;
-        } else if (fmin != null && fmax == null) {
-          warnObj.tempRange = `≥ ${fmin}℃(持续高温)`;
-        } else if (trendMin != null) {
-          let unit = '';
-          if (trendCxTimeUnit === 0) unit = '分钟';
-          if (trendCxTimeUnit === 1) unit = '小时';
-          warnObj.tempTrend = `>+${trendMin}℃ /${unit}`;
+        // 温度(带单位)
+        else if (deviceType === 'modelsensor_temperature') {
+          if (fmin != null && fmax != null) {
+            warnObj.tempRange = `${fmin} - ${fmax}℃`;
+          } else if (fmin != null && fmax == null) {
+            warnObj.tempRange = `≥ ${fmin}℃(持续高温)`;
+          } else if (trendMin != null) {
+            let unit = '';
+            if (trendCxTimeUnit === 0) unit = '分钟';
+            if (trendCxTimeUnit === 1) unit = '小时';
+            warnObj.tempTrend = `>+${trendMin}℃ /${unit}`;
+          }
         }
-      }
-      // HCL
-      else if (deviceType === 'modelsensor_hcl') {
-        if (fmin != null && fmax != null) {
-          warnObj.hclRange = `${fmin} - ${fmax}`;
-        } else if (fmin != null && fmax == null) {
-          warnObj.hclRange = `≥ ${fmin}`;
+        // HCL
+        else if (deviceType === 'modelsensor_hcl') {
+          if (fmin != null && fmax != null) {
+            warnObj.hclRange = `${fmin} - ${fmax}`;
+          } else if (fmin != null && fmax == null) {
+            warnObj.hclRange = `≥ ${fmin}`;
+          }
         }
-      }
+      });
+      result.push(warnObj);
     });
-    result.push(warnObj);
-  });
 
-  return result;
-}
-// 刷新数据
-async function refresh() {
-  // 由于模型中需要用到风门的监测数据,这里进行公共调用(后期精确调用风门)
-  const modalRes = {};
-  const systemParams = {
-    devicetype: 'sys',
-    systemID: optionValue.value,
-  };
-  const resSys = await getSystem(systemParams);
-  const params = {
-    sysId: optionValue.value,
-    monitorType: 2,
-  };
-  const warnInfo = await getWarnInfo(params);
-  const staffInfo = await getStaffInfo({ sysId: optionValue.value });
-  Object.assign(modalRes, resSys);
-  if (pageType.value == 'fire_risk_warn') {
-    configs.value = [...testBeltNew];
-    const params = {
-      sysId: optionValue.value,
-      dataList: 'fire_risk_warn,warn_result,vehicle_co_correlate',
-      alarmLevel: '102,103,104',
+    return result;
+  }
+  // 刷新数据
+  async function refresh() {
+    // 由于模型中需要用到风门的监测数据,这里进行公共调用(后期精确调用风门)
+    const modalRes = {};
+    const systemParams = {
+      devicetype: 'sys',
+      systemID: optionValue.value,
     };
-    const resWarn = await getMonitorAndAlertBelt(params);
-    resWarn.warnInfo = groupWarnByType(warnInfo);
-    resWarn.staffInfo = staffInfo;
-    updateData(resWarn);
-    Object.assign(modalRes, resWarn);
-  } else if (pageType.value == 'emergencyControl') {
-    updateData(resSys);
-    configs.value = [...testYjkf];
-    const alarmParams = {
+    const resSys = await getSystem(systemParams);
+    const params = {
       sysId: optionValue.value,
-      alarmLevel: '104',
+      monitorType: 2,
     };
-    const alarmRes = await getWarnResult(alarmParams);
-    if (alarmRes.warn_result) {
-      data.value.warn_result = alarmRes.warn_result;
+    const warnInfo = await getWarnInfo(params);
+    const staffInfo = await getStaffInfo({ sysId: optionValue.value });
+    Object.assign(modalRes, resSys);
+    if (pageType.value == 'fire_risk_warn') {
+      configs.value = [...testBeltNew];
+      const params = {
+        sysId: optionValue.value,
+        dataList: 'fire_risk_warn,warn_result,vehicle_co_correlate',
+        alarmLevel: '102,103,104',
+      };
+      const resWarn = await getMonitorAndAlertBelt(params);
+      resWarn.warnInfo = groupWarnByType(warnInfo);
+      resWarn.staffInfo = staffInfo;
+      updateData(resWarn);
+      Object.assign(modalRes, resWarn);
+    } else if (pageType.value == 'emergencyControl') {
+      updateData(resSys);
+      configs.value = [...testYjkf];
+      const alarmParams = {
+        sysId: optionValue.value,
+        alarmLevel: '104',
+      };
+      const alarmRes = await getWarnResult(alarmParams);
+      if (alarmRes.warn_result) {
+        data.value.warn_result = alarmRes.warn_result;
+      }
+      data.value.warnInfo = groupWarnByType(warnInfo);
+      data.value.staffInfo = staffInfo;
+      updateData(data.value);
+    } else if (pageType.value == 'sprayControl') {
+      updateData(resSys);
+      const params1 = {
+        sysId: optionValue.value,
+        alarmLevel: '103,104',
+      };
+      const sprayData = [];
+      const dustData = [];
+      if (data.value?.deviceInfo) {
+        // 遍历对象的所有 value
+        Object.values(data.value.deviceInfo).forEach((item) => {
+          const hasSprayAuto = item.type && item.type.toLowerCase().includes('spray');
+          if (hasSprayAuto) {
+            sprayData.push({ ...item, ...item.readData });
+          }
+        });
+        Object.values(data.value.deviceInfo).forEach((item) => {
+          const hasDustAuto = item.type && item.type.toLowerCase().includes('dustdev');
+          if (hasDustAuto) {
+            dustData.push({ ...item, ...item.readData });
+          }
+        });
+      }
+      data.value.sprayData = sprayData;
+      data.value.dustData = dustData;
+      data.value.warnInfo = groupWarnByType(warnInfo);
+      data.value.staffInfo = staffInfo;
+      const alarmRes = await getWarnResult(params1);
+      if (alarmRes.warn_result) {
+        data.value.warn_result = alarmRes.warn_result;
+      }
+      configs.value = [...testSpary];
+    } else {
+      configs.value = testBeltNew;
     }
-    data.value.warnInfo = groupWarnByType(warnInfo);
-    data.value.staffInfo = staffInfo;
-    updateData(data.value);
-  } else if (pageType.value == 'sprayControl') {
-    updateData(resSys);
-    const params1 = {
-      sysId: optionValue.value,
-      alarmLevel: '103,104',
-    };
-    const sprayData = [];
-    const dustData = [];
-    if (data.value?.deviceInfo) {
-      // 遍历对象的所有 value
-      Object.values(data.value.deviceInfo).forEach((item) => {
-        const hasSprayAuto = item.type && item.type.toLowerCase().includes('spray');
-        if (hasSprayAuto) {
-          sprayData.push({ ...item, ...item.readData });
-        }
-      });
-      Object.values(data.value.deviceInfo).forEach((item) => {
-        const hasDustAuto = item.type && item.type.toLowerCase().includes('dustdev');
-        if (hasDustAuto) {
-          dustData.push({ ...item, ...item.readData });
-        }
-      });
+    modalMonitorData.value = modalRes;
+  }
+
+  provide('refreshDeviceData', async () => {
+    if (isRefreshing.value) {
+      return;
     }
-    data.value.sprayData = sprayData;
-    data.value.dustData = dustData;
-    data.value.warnInfo = groupWarnByType(warnInfo);
-    data.value.staffInfo = staffInfo;
-    const alarmRes = await getWarnResult(params1);
-    if (alarmRes.warn_result) {
-      data.value.warn_result = alarmRes.warn_result;
+    isRefreshing.value = true;
+    try {
+      await refresh();
+    } catch (error) {
+    } finally {
+      isRefreshing.value = false;
     }
-    configs.value = [...testSpary];
-  } else {
-    configs.value = testBeltNew;
+  });
+  // 定时刷新
+  function initInterval() {
+    if (timer) clearInterval(timer);
+    timer = setInterval(() => {
+      refresh();
+    }, 5000);
   }
-  modalMonitorData.value = modalRes;
-}
 
-provide('refreshDeviceData', async () => {
-  if (isRefreshing.value) {
-    return;
-  }
-  isRefreshing.value = true;
-  try {
+  async function changePage(pageTypeStr) {
+    const target = pageTypeStr || route.query.pageType || 'fire_risk_warn';
+    if (pageType.value === target) return;
+    pageType.value = target;
+    configs.value = pageCache.value[target]?.configs || testBeltNew;
+    await nextTick();
     await refresh();
-  } catch (error) {
-  } finally {
-    isRefreshing.value = false;
   }
-});
-// 定时刷新
-function initInterval() {
-  if (timer) clearInterval(timer);
-  timer = setInterval(() => {
-    refresh();
-  }, 5000);
-}
 
-async function changePage(pageTypeStr) {
-  const target = pageTypeStr || route.query.pageType || 'fire_risk_warn';
-  if (pageType.value === target) return;
-  pageType.value = target;
-  configs.value = pageCache.value[target]?.configs || testBeltNew;
-  await nextTick();
-  await refresh();
-}
-
-function initModalAnimate(modal3D) {
-  modal = modal3D;
-  modal.isRender = true;
-  modalAnimate(modal, modalMonitorData);
-}
-
-function clearTimer() {
-  if (timer) {
-    clearInterval(timer);
-    timer = null;
+  function initModalAnimate(modal3D) {
+    modal = modal3D;
+    modal.isRender = true;
+    modalAnimate(modal, modalMonitorData);
   }
-}
 
-watch(
-  () => route.query.pageType,
-  (newQueryType) => {
-    if (newQueryType) {
-      changePage(newQueryType as string);
+  function clearTimer() {
+    if (timer) {
+      clearInterval(timer);
+      timer = null;
     }
-  },
-  { immediate: true } // 初始化立刻执行
-);
+  }
 
-watch(
-  () => modalMonitorData.value,
-  (newData, oldData) => {
-    if (newData && !Object.keys(oldData).length) {
-      isInitModal.value = true;
+  watch(
+    () => route.query.pageType,
+    (newQueryType) => {
+      if (newQueryType) {
+        changePage(newQueryType as string);
+      }
+    },
+    { immediate: true } // 初始化立刻执行
+  );
+
+  watch(
+    () => modalMonitorData.value,
+    (newData, oldData) => {
+      if (newData && !Object.keys(oldData).length) {
+        isInitModal.value = true;
+      }
     }
-  }
-);
+  );
 
-onMounted(async () => {
-  await getSysDataSource();
-  await refresh();
-  initInterval();
-});
+  onMounted(async () => {
+    await getSysDataSource();
+    await refresh();
+    initInterval();
+  });
 
-onUnmounted(() => {
-  clearTimer();
-  destroy(modal);
-  modal?.destroy();
-});
+  onUnmounted(() => {
+    clearTimer();
+    destroy(modal);
+    modal?.destroy();
+  });
 </script>
 
 <style lang="less" scoped>
-.company-home {
-  background: url('/@/assets/images/beltFire/baseMap.png') no-repeat center;
-  width: 100%;
-  height: 100%;
-  color: @white;
-  position: relative;
-  font-family: 'Microsoft YaHei', sans-serif;
-  .top-bg {
-    width: 100%;
-    height: 56px;
-    position: absolute;
-    margin-top: 10px;
-    z-index: 1;
-  }
-  .header-container {
-    position: absolute;
-    top: 20px;
-    left: 20px;
-    z-index: 10;
-  }
-
-  .border {
-    width: 100%;
-    height: 94%;
-    background: url('/@/assets/images/beltFire/mainbj.png') no-repeat;
-    background-size: 100% 100%;
-    position: relative;
-    width: 100%;
-  }
-}
-
-.center-warning-container {
-  position: absolute;
-  left: 50%;
-  transform: translateX(-50%);
-  top: 50%;
-  width: 600px;
-  height: 200px;
-  background-color: rgba(0, 0, 0, 0.7);
-  border-radius: 10px;
-  padding: 15px;
-  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
-  z-index: 5;
-  color: #fff;
-
-  .warning-header {
-    font-size: 18px;
-    font-weight: bold;
-    margin-bottom: 10px;
-    color: #ff6b6b;
-  }
-
-  .warning-list {
+  .company-home {
+    background: url('/@/assets/images/beltFire/baseMap.png') no-repeat center;
     width: 100%;
     height: 100%;
-    overflow-y: auto;
-    display: flex;
-    flex-direction: column;
-    gap: 8px;
-  }
-
-  .warning-item {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 8px;
-    background-color: rgba(0, 0, 0, 0.5);
-    border-radius: 5px;
-    border-left: 4px solid #ff6b6b;
+    color: @white;
+    position: relative;
+    font-family: 'Microsoft YaHei', sans-serif;
+    .top-bg {
+      width: 100%;
+      height: 56px;
+      position: absolute;
+      margin-top: 10px;
+      z-index: 1;
+    }
+    .header-container {
+      position: absolute;
+      top: 20px;
+      left: 20px;
+      z-index: 10;
+    }
 
-    .warning-time {
-      font-size: 14px;
-      color: #ccc;
+    .border {
+      width: 100%;
+      height: 94%;
+      background: url('/@/assets/images/beltFire/mainbj.png') no-repeat;
+      background-size: 100% 100%;
+      position: relative;
+      width: 100%;
     }
   }
 
-  // 中间预警结果区
   .center-warning-container {
     position: absolute;
     left: 50%;
@@ -451,67 +405,113 @@ onUnmounted(() => {
         font-size: 14px;
         color: #ccc;
       }
+    }
 
-      .warning-level {
-        font-size: 14px;
+    // 中间预警结果区
+    .center-warning-container {
+      position: absolute;
+      left: 50%;
+      transform: translateX(-50%);
+      top: 50%;
+      width: 600px;
+      height: 200px;
+      background-color: rgba(0, 0, 0, 0.7);
+      border-radius: 10px;
+      padding: 15px;
+      box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
+      z-index: 5;
+      color: #fff;
+
+      .warning-header {
+        font-size: 18px;
         font-weight: bold;
-        padding: 4px 8px;
-        border-radius: 4px;
-        &.level-critical {
-          background-color: #ff6b6b;
-          color: white;
-        }
-        &.level-high {
-          background-color: #ffcc00;
-          color: black;
-        }
-        &.level-normal {
-          background-color: #66cc66;
-          color: white;
-        }
+        margin-bottom: 10px;
+        color: #ff6b6b;
+      }
+
+      .warning-list {
+        width: 100%;
+        height: 100%;
+        overflow-y: auto;
+        display: flex;
+        flex-direction: column;
+        gap: 8px;
       }
 
-      .warning-action {
-        .btn-start-spray {
-          background-color: #00e1ff;
-          color: #000;
-          border: none;
-          padding: 4px 10px;
+      .warning-item {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 8px;
+        background-color: rgba(0, 0, 0, 0.5);
+        border-radius: 5px;
+        border-left: 4px solid #ff6b6b;
+
+        .warning-time {
+          font-size: 14px;
+          color: #ccc;
+        }
+
+        .warning-level {
+          font-size: 14px;
+          font-weight: bold;
+          padding: 4px 8px;
           border-radius: 4px;
-          cursor: pointer;
-          font-size: 12px;
-          transition: all 0.3s;
-          &:hover {
-            background-color: #00c3e6;
+          &.level-critical {
+            background-color: #ff6b6b;
+            color: white;
+          }
+          &.level-high {
+            background-color: #ffcc00;
+            color: black;
+          }
+          &.level-normal {
+            background-color: #66cc66;
+            color: white;
+          }
+        }
+
+        .warning-action {
+          .btn-start-spray {
+            background-color: #00e1ff;
+            color: #000;
+            border: none;
+            padding: 4px 10px;
+            border-radius: 4px;
+            cursor: pointer;
+            font-size: 12px;
+            transition: all 0.3s;
+            &:hover {
+              background-color: #00c3e6;
+            }
           }
         }
       }
     }
-  }
 
-  // 巷道示意图
-  .belt-diagram {
-    position: absolute;
-    left: 50%;
-    transform: translateX(-50%);
-    bottom: 50px;
-    width: 800px;
-    height: 100px;
-    display: flex;
-    justify-content: center;
-    align-items: center;
+    // 巷道示意图
+    .belt-diagram {
+      position: absolute;
+      left: 50%;
+      transform: translateX(-50%);
+      bottom: 50px;
+      width: 800px;
+      height: 100px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
 
-    img {
-      width: 100%;
-      height: 100%;
-      object-fit: contain;
+      img {
+        width: 100%;
+        height: 100%;
+        object-fit: contain;
+      }
     }
   }
-}
-.modal-box {
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  z-index: 1;
-}
-</style>
+  .modal-box {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    z-index: 1;
+  }
+</style>

+ 1 - 0
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -74,6 +74,7 @@ export function getMonitorComponent() {
     case 'sdmtjtswmk': //上湾
     case 'zmhjhzmy': // 韩咀
     case 'dttzjymy': //东泰金源
+    case 'sxmyhgjtlhky': //龙华
       FiberModal = defineAsyncComponent(() => import('./modal/fiber.modal.sw.vue'));
       break;
     case 'sdmtjtwlmlmk': //乌兰木伦

+ 24 - 25
src/views/vent/monitorManager/deviceMonitor/components/device/modal/fiber.modal.sw.vue

@@ -45,8 +45,8 @@
               <SvgIcon class="icon-style" size="38" name="risk-level" />
             </div>
             <div class="item-container">
-              <div class="title">风险等级</div>
-              <div class="warning-value">低风险</div>
+              <div class="title">故障诊断</div>
+              <div class="warning-value">{{ posMonitor.alam_str || '--' }}</div>
             </div>
           </div>
         </div>
@@ -182,18 +182,18 @@
 </script>
 <style lang="less" scoped>
   .fiber-modal {
-    width: 100%;
-    height: 650px;
     display: flex;
     flex-direction: row;
     justify-content: space-between;
+    width: 100%;
+    height: 650px;
 
     .modal-left {
       width: 200px;
       height: 100%;
-      overflow-y: auto;
-      background: #ffffff11;
       padding: 5px;
+      background: #fff1;
+      overflow-y: auto;
       border-radius: 5px;
 
       .active-device-title {
@@ -211,15 +211,15 @@
         }
 
         &::after {
-          content: '';
           position: absolute;
+          top: 12px;
+          left: 10px;
           display: block;
           width: 8px;
           height: 8px;
-          top: 12px;
-          left: 10px;
-          transform: rotateZ(45deg) skew(10deg, 10deg);
           background: #45d3fd;
+          transform: rotateZ(45deg) skew(10deg, 10deg);
+          content: '';
         }
       }
     }
@@ -234,14 +234,14 @@
         padding-left: 20px;
 
         &::after {
-          content: '';
           position: absolute;
+          top: 4px;
+          left: 10px;
           display: block;
           width: 4px;
           height: 12px;
-          top: 4px;
-          left: 10px;
           background: #45d3fd;
+          content: '';
           border-radius: 4px;
         }
       }
@@ -253,14 +253,14 @@
         margin-bottom: 10px;
 
         .top-item {
-          width: 200px;
-          height: 80px;
           display: flex;
           flex-direction: row;
           justify-content: center;
-          border: 1px solid rgba(25, 237, 255, 0.4);
-          box-shadow: inset 0 0 10px rgba(0, 197, 255, 0.6);
-          background: rgba(0, 0, 0, 0.06666666666666667);
+          width: 200px;
+          height: 80px;
+          border: 1px solid rgb(25 237 255 / 40%);
+          background: rgb(0 0 0 / 6.67%);
+          box-shadow: inset 0 0 10px rgb(0 197 255 / 60%);
           padding-top: 16px;
 
           .icon {
@@ -270,10 +270,10 @@
           }
 
           .item-container {
-            width: 100px;
             display: flex;
             flex-direction: column;
             justify-content: center;
+            width: 100px;
 
             div {
               text-align: center;
@@ -284,17 +284,16 @@
             }
 
             .value {
-              text-shadow: 0 0 25px #00fbfe;
+              position: relative;
+              top: -8px;
               background: linear-gradient(0deg, #45d3fd, #45d3fd, #61ddb1, #61ddb1);
+              text-shadow: 0 0 25px #00fbfe;
               font-style: normal;
               background-size: cover;
               font-family: electronicFont;
               font-size: 30px;
-              -webkit-background-clip: text;
               background-clip: text;
               -webkit-text-fill-color: transparent;
-              position: relative;
-              top: -8px;
 
               span {
                 font-family: Arial, Helvetica, sans-serif;
@@ -306,7 +305,7 @@
         }
 
         .warning-box {
-          padding-top: 0px;
+          padding-top: 0;
 
           .icon {
             margin-top: 20px;
@@ -376,7 +375,7 @@
   }
 
   :deep(.zxm-table-body) {
-    border: 1px solid rgba(57, 232, 255, 0.2) !important;
+    border: 1px solid rgb(57 232 255 / 20%) !important;
 
     .zxm-table-tbody > tr > td {
       border: none !important;

+ 24 - 25
src/views/vent/monitorManager/deviceMonitor/components/device/modal/fiber.modal.yjl.vue

@@ -45,8 +45,8 @@
               <SvgIcon class="icon-style" size="38" name="risk-level" />
             </div>
             <div class="item-container">
-              <div class="title">风险等级</div>
-              <div class="warning-value">低风险</div>
+              <div class="title">故障诊断</div>
+              <div class="warning-value">{{ posMonitor.alam_str }}</div>
             </div>
           </div>
         </div>
@@ -199,18 +199,18 @@
 </script>
 <style lang="less" scoped>
   .fiber-modal {
-    width: 100%;
-    height: 650px;
     display: flex;
     flex-direction: row;
     justify-content: space-between;
+    width: 100%;
+    height: 650px;
 
     .modal-left {
       width: 200px;
       height: 100%;
-      overflow-y: auto;
-      background: #ffffff11;
       padding: 5px;
+      background: #fff1;
+      overflow-y: auto;
       border-radius: 5px;
 
       .active-device-title {
@@ -228,15 +228,15 @@
         }
 
         &::after {
-          content: '';
           position: absolute;
+          top: 12px;
+          left: 10px;
           display: block;
           width: 8px;
           height: 8px;
-          top: 12px;
-          left: 10px;
-          transform: rotateZ(45deg) skew(10deg, 10deg);
           background: #45d3fd;
+          transform: rotateZ(45deg) skew(10deg, 10deg);
+          content: '';
         }
       }
     }
@@ -251,14 +251,14 @@
         padding-left: 20px;
 
         &::after {
-          content: '';
           position: absolute;
+          top: 4px;
+          left: 10px;
           display: block;
           width: 4px;
           height: 12px;
-          top: 4px;
-          left: 10px;
           background: #45d3fd;
+          content: '';
           border-radius: 4px;
         }
       }
@@ -270,14 +270,14 @@
         margin-bottom: 10px;
 
         .top-item {
-          width: 200px;
-          height: 80px;
           display: flex;
           flex-direction: row;
           justify-content: center;
-          border: 1px solid rgba(25, 237, 255, 0.4);
-          box-shadow: inset 0 0 10px rgba(0, 197, 255, 0.6);
-          background: rgba(0, 0, 0, 0.06666666666666667);
+          width: 200px;
+          height: 80px;
+          border: 1px solid rgb(25 237 255 / 40%);
+          background: rgb(0 0 0 / 6.67%);
+          box-shadow: inset 0 0 10px rgb(0 197 255 / 60%);
           padding-top: 16px;
 
           .icon {
@@ -287,10 +287,10 @@
           }
 
           .item-container {
-            width: 100px;
             display: flex;
             flex-direction: column;
             justify-content: center;
+            width: 100px;
 
             div {
               text-align: center;
@@ -301,17 +301,16 @@
             }
 
             .value {
-              text-shadow: 0 0 25px #00fbfe;
+              position: relative;
+              top: -8px;
               background: linear-gradient(0deg, #45d3fd, #45d3fd, #61ddb1, #61ddb1);
+              text-shadow: 0 0 25px #00fbfe;
               font-style: normal;
               background-size: cover;
               font-family: electronicFont;
               font-size: 30px;
-              -webkit-background-clip: text;
               background-clip: text;
               -webkit-text-fill-color: transparent;
-              position: relative;
-              top: -8px;
 
               span {
                 font-family: Arial, Helvetica, sans-serif;
@@ -323,7 +322,7 @@
         }
 
         .warning-box {
-          padding-top: 0px;
+          padding-top: 0;
 
           .icon {
             margin-top: 20px;
@@ -393,7 +392,7 @@
   }
 
   :deep(.zxm-table-body) {
-    border: 1px solid rgba(57, 232, 255, 0.2) !important;
+    border: 1px solid rgb(57 232 255 / 20%) !important;
 
     .zxm-table-tbody > tr > td {
       border: none !important;

+ 524 - 524
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -367,21 +367,21 @@
     v-if="renderPlayer"
     ref="playerRef"
     style="
-      z-index: 1;
       position: absolute;
       top: 100px;
-      right: 0px;
+      right: 0;
+      z-index: 1;
+      flex-direction: column;
       width: 100%;
       height: 800px;
       pointer-events: none;
       overflow-y: auto;
-      flex-direction: column;
     "
   >
   </div>
   <LivePlayer
     id="fm-player1"
-    style="height: 220px; width: 300px; position: absolute; top: 0px; z-index: -1"
+    style="position: absolute; top: 0; z-index: -1; width: 300px; height: 220px"
     ref="player1"
     :videoUrl="flvURL1()"
     muted
@@ -401,589 +401,589 @@
 </template>
 
 <script setup lang="ts">
-import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref, defineAsyncComponent, provide } 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 WindDoorFaultTable from './components/WindDoorFaultTable.vue';
-import CarDamageTable from './components/CarDamageTable.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, getOrderByCount, getCarList } from './gate.api';
-import { chartsColumns, getModelComponent } from './gate.data';
-import { cloneDeep } from 'lodash-es';
-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 HistoryTableChart from '../comment/HistoryTableChart.vue';
-
-const { hasPermission } = usePermission();
-const { sysOrgCode } = useGlobSetting();
-const globalConfig = inject<any>('globalConfig');
-
-const modelRef = ref();
-/** 模型对应的组件,根据实际情况分为二维三维 */
-const modelComponent = getModelComponent(globalConfig.is2DModel);
-
-const { currentRoute } = useRouter();
-const gateId = ref(''); //风门ID
-const MonitorDataTable = ref();
-let contrlValue = '';
-const playerRef = ref();
-const deviceType = ref('gate');
-const activeKey = ref('1'); // tab
-const loading = ref(false);
-const renderPlayer = ref(true);
-// 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 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,
-  },
-};
-
-/** 封装通用的模态框打开方法(setControl 模式:点位code直接传参) */
-const openGateControlModal = (paramcode: string, title: string) => {
-  modalType.value = paramcode;
-  modalTitle.value = title;
-  modalIsShow.value = true;
-
-  // 模拟密码模式下直接执行操作
-  if (globalConfig?.simulatedPassword) {
-    handleOK('', paramcode);
-  }
-};
+  import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref, defineAsyncComponent, provide } 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 WindDoorFaultTable from './components/WindDoorFaultTable.vue';
+  import CarDamageTable from './components/CarDamageTable.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, getOrderByCount, getCarList } from './gate.api';
+  import { chartsColumns, getModelComponent } from './gate.data';
+  import { cloneDeep } from 'lodash-es';
+  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 HistoryTableChart from '../comment/HistoryTableChart.vue';
+
+  const { hasPermission } = usePermission();
+  const { sysOrgCode } = useGlobSetting();
+  const globalConfig = inject<any>('globalConfig');
+
+  const modelRef = ref();
+  /** 模型对应的组件,根据实际情况分为二维三维 */
+  const modelComponent = getModelComponent(globalConfig.is2DModel);
+
+  const { currentRoute } = useRouter();
+  const gateId = ref(''); //风门ID
+  const MonitorDataTable = ref();
+  let contrlValue = '';
+  const playerRef = ref();
+  const deviceType = ref('gate');
+  const activeKey = ref('1'); // tab
+  const loading = ref(false);
+  const renderPlayer = ref(true);
+  // 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 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,
+    },
+  };
 
-/** 统一控制入口:点位code + 标题 直接传参(与 windowMonitor 的 setControl 模式一致) */
-const setControl = (paramcode: string, title: string) => {
-  openGateControlModal(paramcode, title);
-};
+  /** 封装通用的模态框打开方法(setControl 模式:点位code直接传参) */
+  const openGateControlModal = (paramcode: string, title: string) => {
+    modalType.value = paramcode;
+    modalTitle.value = title;
+    modalIsShow.value = true;
 
-/** 控制模式切换(paramcode 需根据 contrlMod + contrlValue 动态决定) */
-const setControlMode = (value?: string) => {
-  contrlValue = value;
-  openGateControlModal('modeSwitch', '控制模式切换');
-};
+    // 模拟密码模式下直接执行操作
+    if (globalConfig?.simulatedPassword) {
+      handleOK('', paramcode);
+    }
+  };
 
-const [registerModal, { openModal, closeModal }] = useModal();
+  /** 统一控制入口:点位code + 标题 直接传参(与 windowMonitor 的 setControl 模式一致) */
+  const setControl = (paramcode: string, title: string) => {
+    openGateControlModal(paramcode, title);
+  };
 
-const { getCamera, removeCamera } = useCamera();
+  /** 控制模式切换(paramcode 需根据 contrlMod + contrlValue 动态决定) */
+  const setControlMode = (value?: string) => {
+    contrlValue = value;
+    openGateControlModal('modeSwitch', '控制模式切换');
+  };
 
-const tabChange = (activeKeyVal) => {
-  activeKey.value = activeKeyVal;
-  if (activeKeyVal == 1) {
-    nextTick(() => {
-      if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
+  const [registerModal, { openModal, closeModal }] = useModal();
+
+  const { getCamera, removeCamera } = useCamera();
+
+  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 selectData = reactive(cloneDeep(initData));
+
+  const flvURL1 = () => {
+    // return ''
+    return `/video/gate.mp4`;
+  };
+
+  function deviceEdit(e: Event, type: string, record) {
+    e.stopPropagation();
+    openModal(true, {
+      type,
+      deviceId: record['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 selectData = reactive(cloneDeep(initData));
-
-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;
-  });
-}
-
-// 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']]);
+  // 获取设备基本信息列表
+  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']]);
+              }
             }
+            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
-    );
-  }
-}
-
-// 切换检测数据
-async function getSelectRow(selectRow, index) {
-  if (!selectRow) return;
-  loading.value = true;
-  selectRowIndex.value = index;
-  gateId.value = selectRow.deviceID;
-  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':
-        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;
-      default:
-        type = gateStyle;
+        },
+        flag ? 0 : 1000
+      );
     }
-  } else {
-    type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
-    if (selectData['doorUse'] == 2) {
-      type = 'fmXr';
-    } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
-      type = 'fmThreeTl';
+  }
+
+  // 切换检测数据
+  async function getSelectRow(selectRow, index) {
+    if (!selectRow) return;
+    loading.value = true;
+    selectRowIndex.value = index;
+    gateId.value = selectRow.deviceID;
+    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':
+          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;
+        default:
+          type = gateStyle;
+      }
     } else {
-      if (selectData.deviceType == 'gate_ss') {
-        type = 'fm2';
-      } 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';
+      type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
+      if (selectData['doorUse'] == 2) {
+        type = 'fmXr';
+      } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
+        type = 'fmThreeTl';
       } else {
-        type = 'fm1'; // 液压
+        if (selectData.deviceType == 'gate_ss') {
+          type = 'fm2';
+        } 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'; // 液压
+        }
       }
     }
-  }
 
-  await setSVGModelType(type);
-  await setModelType(type);
-  addMonitorText(selectData);
-  // playAnimation(selectRow, selectData.value.maxarea, true);
-  loading.value = false;
-  await getCamera(selectRow.deviceID, playerRef, renderPlayer);
-}
-
-/** 检修切换 */
-const changeOverhaul = (e) => {
-  // 检修值需要在打开模态框前设置(handleOK 中按 toggle 逻辑计算下发值)
-  openGateControlModal('overhaul', '检修控制');
-  contrlValue = e;
-};
-
-/** 统一下发控制指令(仿 windowMonitor 模式:handlerState 即点位code,特殊情况单独判断) */
-function handleOK(passWord, handlerState, value?) {
-  if (!passWord && !globalConfig?.simulatedPassword) {
-    message.warning('请输入密码');
-    return;
+    await setSVGModelType(type);
+    await setModelType(type);
+    addMonitorText(selectData);
+    // playAnimation(selectRow, selectData.value.maxarea, true);
+    loading.value = false;
+    await getCamera(selectRow.deviceID, playerRef, renderPlayer);
   }
 
-  const data = {
-    deviceid: selectData.deviceID,
-    devicetype: selectData.deviceType,
-    paramcode: '',
-    value: value ?? null,
-    password: passWord || globalConfig?.simulatedPassword,
-    masterComputer: selectData.masterComputer,
+  /** 检修切换 */
+  const changeOverhaul = (e) => {
+    // 检修值需要在打开模态框前设置(handleOK 中按 toggle 逻辑计算下发值)
+    openGateControlModal('overhaul', '检修控制');
+    contrlValue = e;
   };
 
-  // 特殊:控制模式切换(paramcode 根据 contrlMod + contrlValue 动态决定)
-  if (handlerState === 'modeSwitch') {
-    if (selectData.contrlMod == 'codeCtrl') {
-      if (contrlValue == '1') {
-        data.paramcode = 'autoRoManualControl1';
-      } else if (contrlValue == '0') {
-        data.paramcode = 'autoRoManualControl2';
+  /** 统一下发控制指令(仿 windowMonitor 模式:handlerState 即点位code,特殊情况单独判断) */
+  function handleOK(passWord, handlerState, value?) {
+    if (!passWord && !globalConfig?.simulatedPassword) {
+      message.warning('请输入密码');
+      return;
+    }
+
+    const data = {
+      deviceid: selectData.deviceID,
+      devicetype: selectData.deviceType,
+      paramcode: '',
+      value: value ?? null,
+      password: passWord || globalConfig?.simulatedPassword,
+      masterComputer: selectData.masterComputer,
+    };
+
+    // 特殊:控制模式切换(paramcode 根据 contrlMod + contrlValue 动态决定)
+    if (handlerState === 'modeSwitch') {
+      if (selectData.contrlMod == 'codeCtrl') {
+        if (contrlValue == '1') {
+          data.paramcode = 'autoRoManualControl1';
+        } else if (contrlValue == '0') {
+          data.paramcode = 'autoRoManualControl2';
+        } else {
+          data.paramcode = 'autoRoManualControl0';
+        }
+        data.value = '';
+      } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
+        data.paramcode = 'autoRoManualControl';
+        data.value = '';
       } else {
-        data.paramcode = 'autoRoManualControl0';
+        data.paramcode = 'autoRoManualControl';
+        data.value = contrlValue;
       }
+      selectData.autoRoManual = null;
+    }
+    // 特殊:检修控制(value 取反 toggle)
+    else if (handlerState === 'overhaul') {
+      data.paramcode = 'runRoRecondition_S';
+      data.value = selectData['runRoRecondition'] == 0 ? '1' : '0';
+    }
+    // 默认:handlerState 即点位code(setControl 直接传参)
+    else {
+      data.paramcode = handlerState;
       data.value = '';
-    } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
-      data.paramcode = 'autoRoManualControl';
-      data.value = '';
-    } else {
-      data.paramcode = 'autoRoManualControl';
-      data.value = contrlValue;
     }
-    selectData.autoRoManual = null;
-  }
-  // 特殊:检修控制(value 取反 toggle)
-  else if (handlerState === 'overhaul') {
-    data.paramcode = 'runRoRecondition_S';
-    data.value = selectData['runRoRecondition'] == 0 ? '1' : '0';
-  }
-  // 默认:handlerState 即点位code(setControl 直接传参)
-  else {
-    data.paramcode = handlerState;
-    data.value = '';
-  }
 
-  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);
-        }
-        contrlValue = '';
-      })
-      .catch(() => {
-        message.error('控制异常,请排查问题。。。');
-        contrlValue = '';
-      });
-  }
-}
-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;
+          contrlValue = '';
+        })
+        .catch(() => {
+          message.error('控制异常,请排查问题。。。');
+          contrlValue = '';
+        });
     }
   }
+  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 == '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 (rearDeviceState != 1) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(3, timeScale);
-      rearDeviceState = 1;
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+    if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+      isRearOpenRunning = true;
+
+      if (rearDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(3, timeScale);
+        rearDeviceState = 1;
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
-  if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
-    isRearOpenRunning = true;
-
-    if (rearDeviceState != 1) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(3, timeScale);
-      rearDeviceState = 1;
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+    if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+      isRearOpenRunning = true;
+
+      if (rearDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(3, timeScale);
+        rearDeviceState = 1;
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
-    isRearOpenRunning = false;
-    if (rearDeviceState != 0) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-      play(4, timeScale);
-      rearDeviceState = 0;
-      backDoorIsOpen.value = false;
+    if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
+      isRearOpenRunning = false;
+      if (rearDeviceState != 0) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+        play(4, timeScale);
+        rearDeviceState = 0;
+        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) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(8, timeScale);
-      midDeviceState = 1;
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (midDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(8, timeScale);
+        midDeviceState = 1;
+        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) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-      play(8, timeScale);
-      midDeviceState = 1;
-      backDoorIsOpen.value = false;
-      frontDoorIsOpen.value = true;
+      if (midDeviceState != 1) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+        play(8, timeScale);
+        midDeviceState = 1;
+        backDoorIsOpen.value = false;
+        frontDoorIsOpen.value = true;
+      }
     }
-  }
 
-  if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
-    isMidOpenRunning = false;
-    if (midDeviceState != 0) {
-      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-      play(9, timeScale);
-      midDeviceState = 0;
-      backDoorIsOpen.value = false;
+    if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
+      isMidOpenRunning = false;
+      if (midDeviceState != 0) {
+        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+        play(9, timeScale);
+        midDeviceState = 0;
+        backDoorIsOpen.value = false;
+      }
     }
+
+    modelRef.value?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
   }
 
-  modelRef.value?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-}
-
-function playWindowAnimation(data, maxarea = 90, isFirst = false) {
-  computePlay(data, maxarea, isFirst);
-}
-
-function handleCancel() {
-  modalIsShow.value = false;
-  modalTitle.value = '';
-  modalType.value = '';
-}
-
-const handleSwitchChange = (checked: boolean) => {
-  contrlValue = checked;
-  setControl('manualAutoMode_w', '手动/自动模式切换');
-};
-
-function setSVGModelType(type) {
-  modelComponent.value = getModelComponent(globalConfig.is2DModel, type);
-  return nextTick();
-}
-
-onMounted(async () => {
-  const { query } = unref(currentRoute);
-  if (query['deviceType']) deviceType.value = query['deviceType'] as string;
-  modelList.value = await getDictItems('gateModel');
-  if (globalConfig.is2DModel) {
-    await getMonitor(true);
-  } else {
-    loading.value = true;
-    // const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
-    mountedThree()
-      .then(async () => {
-        if (sysOrgCode != 'zmhjhzmy') {
-          await getMonitor(true);
-          loading.value = false;
-        } else {
-          // 韩咀无风门设备,只有报警历史数据,无其他数据
-          setModelType('fm1').then(async () => {
-            loading.value = false;
-            dataSource.value = [];
-            addMonitorText(selectData);
-          });
-        }
-      })
-      .catch((e) => {
-        console.log(e);
-      });
+  function playWindowAnimation(data, maxarea = 90, isFirst = false) {
+    computePlay(data, maxarea, isFirst);
   }
-});
 
-onBeforeUnmount(() => {
-  removeCamera(playerRef);
-  getDeviceBaseList();
-});
+  function handleCancel() {
+    modalIsShow.value = false;
+    modalTitle.value = '';
+    modalType.value = '';
+  }
 
-onUnmounted(() => {
-  if (timer) {
-    clearTimeout(timer);
-    timer = undefined;
+  const handleSwitchChange = (checked: boolean) => {
+    contrlValue = checked;
+    setControl('manualAutoMode_w', '手动/自动模式切换');
+  };
+
+  function setSVGModelType(type) {
+    modelComponent.value = getModelComponent(globalConfig.is2DModel, type);
+    return nextTick();
   }
-  destroy();
-});
+
+  onMounted(async () => {
+    const { query } = unref(currentRoute);
+    if (query['deviceType']) deviceType.value = query['deviceType'] as string;
+    modelList.value = await getDictItems('gateModel');
+    if (globalConfig.is2DModel) {
+      await getMonitor(true);
+    } else {
+      loading.value = true;
+      // const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
+      mountedThree()
+        .then(async () => {
+          if (sysOrgCode != 'zmhjhzmy') {
+            await getMonitor(true);
+            loading.value = false;
+          } else {
+            // 韩咀无风门设备,只有报警历史数据,无其他数据
+            setModelType('fm1').then(async () => {
+              loading.value = false;
+              dataSource.value = [];
+              addMonitorText(selectData);
+            });
+          }
+        })
+        .catch((e) => {
+          console.log(e);
+        });
+    }
+  });
+
+  onBeforeUnmount(() => {
+    removeCamera(playerRef);
+    getDeviceBaseList();
+  });
+
+  onUnmounted(() => {
+    if (timer) {
+      clearTimeout(timer);
+      timer = undefined;
+    }
+    destroy();
+  });
 </script>
 
 <style lang="less" scoped>
-@import '/@/design/theme.less';
-@import '/@/design/vent/modal.less';
+  @import url('/@/design/theme.less');
+  @import url('/@/design/vent/modal.less');
 
-.scene-box {
-  .bottom-tabs-box {
-    height: 350px;
+  .scene-box {
+    .bottom-tabs-box {
+      height: 350px;
+    }
   }
-}
 
-.button-box {
-  border: none !important;
-  height: 34px !important;
+  .button-box {
+    height: 34px !important;
+    border: none !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;
-}
+  ::-webkit-scrollbar-thumb {
+    box-shadow: inset 0 0 5px rgb(0 0 0 / 20%);
+    background: #4288a444;
+  }
 
-:deep(.zxm-radio-disabled + span) {
-  color: var(--vent-font-color) !important;
-}
+  :deep(.zxm-radio-disabled + span) {
+    color: var(--vent-font-color) !important;
+  }
 
-:deep(.zxm-radio-disabled .zxm-radio-inner::after) {
-  background-color: #127cb5 !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;
-}
+  :deep(.@{ventSpace}-picker-datetime-panel) {
+    height: 200px !important;
+    overflow-y: auto !important;
+  }
 </style>