Browse Source

[Feat 0000] 新增均压二维巷道模型

hongrunxia 1 week ago
parent
commit
d6212f2e9e

+ 2 - 1
.env.production

@@ -63,7 +63,8 @@ VITE_LEGACY = false
 #VITE_APP_SUB_APP = [["micro-need-air", "//182.92.126.35:8093/"], ["micro-vent-3dModal", "//182.92.126.35:8091/"]]
 #VITE_APP_SUB_APP = [["micro-need-air", ":8093/"], ["micro-vent-3dModal", ":8091/"]]
 #VITE_APP_SUB_APP = [["micro-vent-3dModal", ":8091/", "micro-vent-3dModal"], ["micro-need-air", ":8093/", "micro-need-air"]]
-VITE_APP_SUB_APP = [["micro-vent-3dModal", "/models/", ":8091/"], ["micro-need-air", "/vent-need-air/", ":8093/"]] #[name, entry, container]
+VITE_APP_SUB_APP = [["micro-vent-3dModal", "/models/", ":8091/"],["micro-vent-2dModal", "/tun2D/", ":8099/"],["micro-need-air", "/vent-need-air/", ":8093/"]] #[name, entry, container]
+# VITE_APP_SUB_APP = [["micro-vent-3dModal", "//182.92.126.35:8091/", "micro-vent-3dModal"],["micro-vent-2dModal", "//localhost:8088/", "micro-vent-2dModal"], ["micro-need-air", "//182.92.126.35:8099/", "micro-need-air"], ["micro-fire-front", "//182.92.126.35:8097/", "fire-Micro"]]
 #VITE_APP_SUB_APP = [["micro-need-air", "//172.16.41.171:7123/"], ["micro-vent-3dModal", "//172.16.41.171:7121/"]]
 #VITE_APP_SUB_APP = [["micro-vent-3dModal", "//192.168.0.79:7121/"]]
 #VITE_APP_SUB_APP = [["micro-need-air", "//127.0.0.1:20000/"], ["micro-vent-3dModal", "//127.0.0.1:30000/"], ["micro-fire-front", "//127.0.0.1:40000/"]]

+ 236 - 236
src/layouts/default/header/components/VoiceBroadcast.vue

@@ -46,283 +46,283 @@
   </div>
 </template>
 <script lang="ts">
-import { Tooltip, Badge } from 'ant-design-vue';
-import { SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined } from '@ant-design/icons-vue';
-import Icon from '/@/components/Icon';
-import { defineComponent, ref, unref, onMounted, nextTick } from 'vue';
-import { defHttp } from '/@/utils/http/axios';
-import { useRouter } from 'vue-router';
-import { connectWebSocket, onWebSocket } from '/@/hooks/web/useWebSocket';
-import { getToken } from '/@/utils/auth';
-import { useUserStore } from '/@/store/modules/user';
-import { useGlobSetting } from '/@/hooks/setting';
-import SpeakVoice from './notify/speakVoice';
-import { useDrag } from '@/hooks/event/useDrag';
-import dayjs from 'dayjs';
-export default defineComponent({
-  name: 'VoiceBroadcast',
-  components: { Icon, Tooltip, Badge, SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined },
+  import { Tooltip, Badge } from 'ant-design-vue';
+  import { SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined } from '@ant-design/icons-vue';
+  import Icon from '/@/components/Icon';
+  import { defineComponent, ref, unref, onMounted, nextTick } from 'vue';
+  import { defHttp } from '/@/utils/http/axios';
+  import { useRouter } from 'vue-router';
+  import { connectWebSocket, onWebSocket } from '/@/hooks/web/useWebSocket';
+  import { getToken } from '/@/utils/auth';
+  import { useUserStore } from '/@/store/modules/user';
+  import { useGlobSetting } from '/@/hooks/setting';
+  import SpeakVoice from './notify/speakVoice';
+  import { useDrag } from '@/hooks/event/useDrag';
+  import dayjs from 'dayjs';
+  export default defineComponent({
+    name: 'VoiceBroadcast',
+    components: { Icon, Tooltip, Badge, SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined },
 
-  setup() {
-    // debugger;
-    let speakVoice;
-    const userStore = useUserStore();
-    const glob = useGlobSetting();
-    const router = useRouter();
-    const list = (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params });
-    const cleanAlarm = () => defHttp.get({ url: '/safety/ventanalyAlarmLog/cleanAlarmLog' });
-    const activeKey = ref(0);
-    const isShowWarningBroad = ref(false);
-    const isBroad = ref(true);
-    const isWarningDot = ref(false);
-    const broadcastList = ref([]);
-    function showWarningBroad() {
-      isShowWarningBroad.value = !isShowWarningBroad.value;
-      if (isShowWarningBroad.value) {
-        toSelectList(0);
-        nextTick(() => {
-          const dom = document.getElementById('VoiceBroadcast');
-          if (dom) useDrag(dom);
-        });
+    setup() {
+      // debugger;
+      let speakVoice;
+      const userStore = useUserStore();
+      const glob = useGlobSetting();
+      const router = useRouter();
+      const list = (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params });
+      const cleanAlarm = () => defHttp.get({ url: '/safety/ventanalyAlarmLog/cleanAlarmLog' });
+      const activeKey = ref(0);
+      const isShowWarningBroad = ref(false);
+      const isBroad = ref(true);
+      const isWarningDot = ref(false);
+      const broadcastList = ref([]);
+      function showWarningBroad() {
+        isShowWarningBroad.value = !isShowWarningBroad.value;
+        if (isShowWarningBroad.value) {
+          toSelectList(0);
+          nextTick(() => {
+            const dom = document.getElementById('VoiceBroadcast');
+            if (dom) useDrag(dom);
+          });
+        }
+      }
+      function handleBroad() {
+        isBroad.value = !isBroad.value;
       }
-    }
-    function handleBroad() {
-      isBroad.value = !isBroad.value;
-    }
 
-    async function clearInfo() {
-      await cleanAlarm();
-      const res = await list({ pageSize: 20, devicetype: '', sort: 'createTime', delFlag: 0 });
-      broadcastList.value = res['records'];
-    }
+      async function clearInfo() {
+        await cleanAlarm();
+        const res = await list({ pageSize: 20, devicetype: '', sort: 'createTime', delFlag: 0 });
+        broadcastList.value = res['records'];
+      }
 
-    async function toSelectList(key) {
-      activeKey.value = key;
-      const res = await list({ pageSize: 20, devicetype: '', isok: key == 1 ? 0 : key == 2 ? 1 : null, sort: 'createTime', delFlag: 0 });
-      broadcastList.value = res['records'];
-      const isHasWarning = broadcastList.value.findIndex((item) => !item['isok']);
-      if (key !== 2) isWarningDot.value = isHasWarning > -1 ? true : false;
-    }
+      async function toSelectList(key) {
+        activeKey.value = key;
+        const res = await list({ pageSize: 20, devicetype: '', isok: key == 1 ? 0 : key == 2 ? 1 : null, sort: 'createTime', delFlag: 0 });
+        broadcastList.value = res['records'];
+        const isHasWarning = broadcastList.value.findIndex((item) => !item['isok']);
+        if (key !== 2) isWarningDot.value = isHasWarning > -1 ? true : false;
+      }
 
-    async function toMore() {
-      await router.push({ path: '/monitorChannel/device-monitor/warningHistory/home' });
-      showWarningBroad();
-    }
+      async function toMore() {
+        await router.push({ path: '/monitorChannel/device-monitor/warningHistory/home' });
+        showWarningBroad();
+      }
 
-    // 初始化 WebSocket
-    function initWebSocket() {
-      let token = getToken();
-      //将登录token生成一个短的标识
-      // let wsClientId = md5(token);
-      // let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
-      let userId = unref(userStore.getUserInfo).id + '?token=' + token;
-      // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-      let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
-      connectWebSocket(url);
-      onWebSocket(onWebSocketMessage);
-    }
+      // 初始化 WebSocket
+      function initWebSocket() {
+        let token = getToken();
+        //将登录token生成一个短的标识
+        // let wsClientId = md5(token);
+        // let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
+        let userId = unref(userStore.getUserInfo).id + '?token=' + token;
+        // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
+        let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
+        connectWebSocket(url);
+        onWebSocket(onWebSocketMessage);
+      }
 
-    async function onWebSocketMessage(data) {
-      console.log('WebSocket 监测消息--------------》', data);
-      if (data.topic === 'warn' || data.cmd === 'user') {
-        if (isBroad.value) {
-          await speakVoice.getSpeechCnVoices();
-          const messageText = data['warndata'];
-          // const messageText = '这是一个测试';
-          speakVoice.handleReply(messageText);
-          const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
-          console.log(time + '语音播报开始报警------>', data);
-        }
-        if (!isShowWarningBroad.value) {
-          isWarningDot.value = true;
-        } else {
-          isWarningDot.value = false;
-        }
-        setTimeout(() => {
-          if (isShowWarningBroad.value) {
-            toSelectList(0);
+      async function onWebSocketMessage(data) {
+        console.log('WebSocket 监测消息--------------》', data);
+        if (data.topic === 'warn' || data.cmd === 'user') {
+          if (isBroad.value) {
+            await speakVoice.getSpeechCnVoices();
+            const messageText = data['warndata'];
+            // const messageText = '这是一个测试';
+            speakVoice.handleReply(messageText);
+            const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
+            console.log(time + '语音播报开始报警------>', data);
           }
-        }, 0);
+          if (!isShowWarningBroad.value) {
+            isWarningDot.value = true;
+          } else {
+            isWarningDot.value = false;
+          }
+          setTimeout(() => {
+            if (isShowWarningBroad.value) {
+              toSelectList(0);
+            }
+          }, 0);
+        }
       }
-    }
-    onMounted(() => {
-      speakVoice = new SpeakVoice();
-      nextTick(async () => {
-        initWebSocket();
-        await toSelectList(1);
+      onMounted(() => {
+        speakVoice = new SpeakVoice();
+        nextTick(async () => {
+          initWebSocket();
+          await toSelectList(1);
+        });
+        window.speechSynthesis.onvoiceschanged = () => {
+          console.log('语音列表已更新');
+        };
       });
-      window.speechSynthesis.onvoiceschanged = () => {
-        console.log('语音列表已更新');
-      };
-    });
 
-    return {
-      showWarningBroad,
-      isShowWarningBroad,
-      activeKey,
-      toSelectList,
-      broadcastList,
-      toMore,
-      isBroad,
-      handleBroad,
-      clearInfo,
-      isWarningDot,
-    };
-  },
-});
+      return {
+        showWarningBroad,
+        isShowWarningBroad,
+        activeKey,
+        toSelectList,
+        broadcastList,
+        toMore,
+        isBroad,
+        handleBroad,
+        clearInfo,
+        isWarningDot,
+      };
+    },
+  });
 </script>
 <style lang="less" scoped>
-.btn {
-  line-height: 30px;
-  margin-right: 20px;
-  cursor: pointer;
-  display: flex;
-}
-
-.no-play {
-  position: relative;
-  &::after {
-    position: absolute;
-    width: 70%;
-    height: 100%;
-    content: '';
-    left: 15%;
-    top: 0;
-    background: linear-gradient(
-      to bottom left,
-      transparent 0%,
-      transparent calc(50% - 1px),
-      #ffffff 50%,
-      transparent calc(50% + 1px),
-      transparent 100%
-    );
+  .btn {
+    line-height: 30px;
+    margin-right: 20px;
+    cursor: pointer;
+    display: flex;
   }
-}
-
-.broadcast {
-  width: 500px;
-  height: 350px;
-  border-radius: 4px;
-  position: fixed;
-  top: 50px;
-  right: 20px;
-  background-color: rgb(255, 255, 255);
-  background: url('../../../../assets/images/warn-dialog-bg.png') no-repeat center;
-  background-size: 100% 100%;
-  z-index: 9999999;
-  color: #fff;
 
-  .title {
-    height: 32px;
-    padding: 0 20px;
-
-    :deep(.ant-badge:not(.ant-badge-status)) {
-      margin-right: 40px !important;
+  .no-play {
+    position: relative;
+    &::after {
+      position: absolute;
+      width: 70%;
+      height: 100%;
+      content: '';
+      left: 15%;
+      top: 0;
+      background: linear-gradient(
+        to bottom left,
+        transparent 0%,
+        transparent calc(50% - 1px),
+        #ffffff 50%,
+        transparent calc(50% + 1px),
+        transparent 100%
+      );
     }
+  }
 
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    margin-bottom: 5px;
+  .broadcast {
+    width: 500px;
+    height: 350px;
+    border-radius: 4px;
+    position: fixed;
+    top: 50px;
+    right: 20px;
+    background-color: rgb(255, 255, 255);
+    background: url('../../../../assets/images/warn-dialog-bg.png') no-repeat center;
+    background-size: 100% 100%;
+    z-index: 9999999;
+    color: #fff;
 
-    .message-title {
-      font-size: 18px;
-      padding-top: 10px;
-    }
+    .title {
+      height: 32px;
+      padding: 0 20px;
 
-    .badge-box {
-      display: flex;
-      align-items: center;
-      padding-top: 10px;
-      .badge-title {
-        display: inline-block;
-        width: 62px;
-        line-height: 32px;
-        background-color: #2174f0;
-        border-radius: 26px;
-        text-align: center;
-        color: #fff;
-        padding-bottom: 2px;
+      :deep(.ant-badge:not(.ant-badge-status)) {
+        margin-right: 40px !important;
       }
-    }
-  }
 
-  .broadcast-context {
-    .context-tab {
       display: flex;
-      padding: 20px;
-      .context-tab-item {
-        line-height: 24px;
-        background-color: #6b6b6b;
-        border-radius: 24px;
-        text-align: center;
-        padding: 0 10px;
-        color: #fff;
-        margin: 5px;
-        cursor: pointer;
-        font-size: 14px;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 5px;
+
+      .message-title {
+        font-size: 18px;
+        padding-top: 10px;
       }
 
-      .context-tab-item-active {
-        background-color: #2174f0;
+      .badge-box {
+        display: flex;
+        align-items: center;
+        padding-top: 10px;
+        .badge-title {
+          display: inline-block;
+          width: 62px;
+          line-height: 32px;
+          background-color: #2174f0;
+          border-radius: 26px;
+          text-align: center;
+          color: #fff;
+          padding-bottom: 2px;
+        }
       }
     }
 
-    .context-box {
-      flex: 1;
-      padding: 0 10px;
-      height: 200px;
-      overflow-y: auto;
-
-      .no-context {
+    .broadcast-context {
+      .context-tab {
         display: flex;
-        justify-content: center;
-        padding-top: 30px;
-        font-size: 16px;
+        padding: 20px;
+        .context-tab-item {
+          line-height: 24px;
+          background-color: #6b6b6b;
+          border-radius: 24px;
+          text-align: center;
+          padding: 0 10px;
+          color: #fff;
+          margin: 5px;
+          cursor: pointer;
+          font-size: 14px;
+        }
+
+        .context-tab-item-active {
+          background-color: #2174f0;
+        }
       }
 
-      .context-detail {
-        display: flex;
-        justify-content: space-between;
-        line-height: 24px;
-        padding: 0px 16px;
+      .context-box {
+        flex: 1;
+        padding: 0 10px;
+        height: 200px;
+        overflow-y: auto;
 
-        div {
+        .no-context {
           display: flex;
-          justify-content: flex-start;
+          justify-content: center;
+          padding-top: 30px;
+          font-size: 16px;
+        }
 
-          &:nth-child(1) {
-            width: 44%;
-          }
+        .context-detail {
+          display: flex;
+          justify-content: space-between;
+          line-height: 24px;
+          padding: 0px 16px;
 
-          &:nth-child(2) {
-            width: 40%;
-          }
+          div {
+            display: flex;
+            justify-content: flex-start;
 
-          &:nth-child(3) {
-            width: 25%;
-          }
+            &:nth-child(1) {
+              width: 44%;
+            }
 
-          &:nth-child(4) {
-            width: 15%;
+            &:nth-child(2) {
+              width: 40%;
+            }
+
+            &:nth-child(3) {
+              width: 25%;
+            }
+
+            &:nth-child(4) {
+              width: 15%;
+            }
           }
         }
       }
-    }
-    .more {
-      position: absolute;
-      left: 24px;
-      bottom: 10px;
-      cursor: pointer;
+      .more {
+        position: absolute;
+        left: 24px;
+        bottom: 10px;
+        cursor: pointer;
 
-      &:hover {
-        color: #2174f0;
+        &:hover {
+          color: #2174f0;
+        }
       }
     }
   }
-}
-:deep(.zxm-badge-count) {
-  width: 8px;
-  height: 8px;
-}
+  :deep(.zxm-badge-count) {
+    width: 8px;
+    height: 8px;
+  }
 </style>

+ 2 - 1
src/utils/threejs/main.worker.ts

@@ -46,11 +46,12 @@ export function initModalWorker() {
 
   const db: any = new Dexie('DB');
   window['CustomDB'] = db;
-  const modelStore = useModelStore();
+
   db.version(1).stores({
     modal: '&modalName, modalVal, versionStr',
   });
   db.open();
+  const modelStore = useModelStore();
 
   new Promise(async (resolve) => {
     const validateModelUrlArr: string[] = [];

+ 1 - 0
src/utils/threejs/useEvent.ts

@@ -9,6 +9,7 @@ export default function useEvent() {
 
   let startTime: number = 0;
   const mouseDownFn = (modal: UseThree, group: THREE.Object3D | THREE.Object3D[], event: MouseEvent, callBack?: Function) => {
+    debugger;
     event.stopPropagation();
     event.preventDefault();
 

+ 90 - 17
src/utils/threejs/useThree.ts

@@ -15,8 +15,10 @@ import TWEEN from 'three/examples/jsm/libs/tween.module.js';
 import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
 import { getList } from '@/views/vent/sys/resources/file.api';
 import { saveModel } from '/@/utils/threejs/util';
+import { getToken, getTenantId } from '/@/utils/auth';
 
 import { useGlobSetting } from '/@/hooks/setting';
+import { get } from 'sortablejs';
 const globSetting = useGlobSetting();
 const baseApiUrl = globSetting.domainUrl;
 
@@ -276,28 +278,99 @@ class UseThree {
                 );
               } else {
                 // 开启线程下载
-                console.log('需要开启线程下载模型资源。。。。。');
+
                 const result = (await getList({ fileName: modalNameStr })) || [];
                 const file = result['records'][0];
                 if (file && file.path) {
-                  gltfLoader.load(`${baseApiUrl}/sys/common/static/${file.path}`, async (glft) => {
-                    if (glft) {
-                      let object: THREE.Object3D = glft.scene;
-                      if (isBlender) {
-                        object = object.children[0];
-                      }
-                      object.name = modalNameStr;
-                      if (glft.animations.length > 0) {
-                        object.animations = glft.animations;
-                      }
-                      if (group) group.add(object);
-                      childResolve(object);
-                      const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
-                      if (modalArr.length < 1) {
-                        saveModel(modalNameStr, file.path, file.version);
+                  console.log('需要开启线程下载模型资源。。。。。');
+
+                  // 如果是常村时
+                  const token = getToken();
+                  fetch(`${baseApiUrl}/sys/common/static/${file.path}`, {
+                    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();
+                    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);
                       }
-                    }
+                    );
                   });
+
+                  // gltfLoader.load(
+                  //   `${baseApiUrl}/sys/common/static/${file.path}`,
+                  //   async (glft) => {
+                  //     if (glft) {
+                  //       let object: THREE.Object3D = glft.scene;
+                  //       if (isBlender) {
+                  //         object = object.children[0];
+                  //       }
+                  //       object.name = modalNameStr;
+                  //       if (glft.animations.length > 0) {
+                  //         object.animations = glft.animations;
+                  //       }
+                  //       if (group) group.add(object);
+                  //       childResolve(object);
+                  //       const modalArr = await db.modal.where('modalName').equals(modalNameStr).toArray();
+                  //       if (modalArr.length < 1) {
+                  //         saveModel(modalNameStr, file.path, file.version);
+                  //       }
+                  //     }
+                  //   },
+                  //   (err) => {
+                  //     console.log(err);
+                  //   }
+                  // );
                 } else {
                   childResolve(null);
                 }

+ 8 - 6
src/views/vent/monitorManager/balancePressMonitor/balancePress.data.ts

@@ -67,16 +67,18 @@ export const windowParam = [
 
 export const localFanParam = [
   {
-    title: '风机频率',
-    dataIndex: 'FanfHz',
+    title: '运行风机',
+    code: 'FanRun',
   },
   {
-    title: '供风量',
-    dataIndex: 'readData.m3_merge',
+    title: '风机频率',
+    code: 'FanfHz',
+    unit: 'Hz',
   },
   {
-    title: '运行风机',
-    dataIndex: 'FanRun',
+    title: '供风量',
+    code: 'readData.m3_merge',
+    unit: 'm³/min',
   },
 ];
 

+ 8 - 9
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHome.vue

@@ -138,7 +138,7 @@
   import { SvgIcon } from '/@/components/Icon';
   import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
   import { settingParam1, settingParam2, settingParam3, windowParam, localFanParam, windrectParam } from '../balancePress.data';
-  import { list, submit, subList,submitEdit } from '../balancePress.api';
+  import { list, submit, subList, submitEdit } from '../balancePress.api';
   import { message } from 'ant-design-vue';
   import { get } from 'lodash-es';
 
@@ -172,7 +172,7 @@
     //
   };
 
-  let listData=ref<any[]>([])
+  let listData = ref<any[]>([]);
 
   // https获取监测数据
   let timer: any = null;
@@ -231,16 +231,16 @@
 
   // 喷粉操作
   async function onSubmit() {
-    if(listData.value.length!=0){
+    if (listData.value.length != 0) {
       //编辑
       let res = await submitEdit(listData.value[0]);
-      if(res){
+      if (res) {
         initParamList();
       }
-    }else{
+    } else {
       //新增
       let res = await submit(formData.value);
-      if(res){
+      if (res) {
         initParamList();
         message.success('提交成功');
       }
@@ -251,9 +251,8 @@
   async function initParamList() {
     let res = await subList();
     if (res && res.records && res.records.length != 0) {
-      listData.value=res.records
+      listData.value = res.records;
       formData.value = res.records[0];
-      
     }
   }
 
@@ -268,7 +267,7 @@
   );
 
   const formData = ref({
-    id:'',
+    id: '',
     coMaxStart: 0,
     o2MinStart: 0,
     coRiseStart: 0,

+ 1 - 1
src/views/vent/monitorManager/balancePressMonitor/index1.vue

@@ -113,7 +113,7 @@ onMounted(async() => {
   actions.onGlobalStateChange((newState) => {
     const isMounted = newState['isMounted'];
     if (isMounted) {
-      actions.setGlobalState({ isMounted: false, pageObj:{modalId: '1909406023414272001'} });
+      actions.setGlobalState({ isMounted: false, pageObj:{modalId: '1922122318615515138'} });
       loading.value = false;
     }
   });

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

@@ -454,9 +454,6 @@ export const mountedThree = (playerDom) => {
         fm3.mountedThree(playerDom);
         break;
       case 'sdmtjtbltmk':
-        const FmThreeTl = await import('./gate.threejs.three.tl');
-        if (FmThreeTl) fmThreeTl = new FmThreeTl.default(model);
-        if (fmThreeTl) fmThreeTl.mountedThree(playerDom);
         fm3 = new Fm3(model);
         fm3.mountedThree(playerDom);
         break;
@@ -469,7 +466,11 @@ export const mountedThree = (playerDom) => {
         fm2.mountedThree(playerDom);
         break;
     }
-
+    // 三道门
+    const FmThreeTl = await import('./gate.threejs.three.tl');
+    if (FmThreeTl) fmThreeTl = new FmThreeTl.default(model);
+    if (fmThreeTl) fmThreeTl.mountedThree(playerDom);
+    // 行人风门
     fmXr = new FmXR(model);
     fmXr.mountedThree(playerDom);
     fm1 = new Fm1(model);
@@ -490,11 +491,13 @@ export const destroy = () => {
     if (fmXr) fmXr.destroy();
     if (fmTwoSs) fmTwoSs.destroy();
     if (fmWindow) fmWindow.destroy();
+    if (fmThreeTl) fmThreeTl.destroy();
     fm1 = null;
     fm2 = null;
     fm3 = null;
     fmXr = null;
     fmWindow = null;
+    fmThreeTl = null;
     fmTwoSs = null;
     group = null;
     model.mixers = [];

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

@@ -243,8 +243,10 @@
   import { useCamera } from '/@/hooks/system/useCamera';
   import { usePermission } from '/@/hooks/web/usePermission';
   import { useMessage } from '/@/hooks/web/useMessage';
-  const { hasPermission } = usePermission();
+  import { useGlobSetting } from '/@/hooks/setting';
 
+  const { hasPermission } = usePermission();
+  const { sysOrgCode } = useGlobSetting();
   const globalConfig = inject('globalConfig');
 
   const { currentRoute } = useRouter();
@@ -333,9 +335,10 @@
             if (data.maxarea) {
               playAnimation(selectData.value, selectData.value.maxarea);
             }
-            addMonitorText(selectData.value);
+            if (sysOrgCode != 'smjthllmk') {
+              addMonitorText(selectData.value);
+            }
           }
-
           if (timer) {
             timer = null;
           }

+ 49 - 6
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -8,10 +8,11 @@ import sdFc_3 from './shuangdaoFcBlt.threejs'; // sdFc_3 双道-带小门-小窗
 import sdFc_4 from './shuangdaoFcHj.threejs'; // sdFc_4 双道-带门-卷闸
 import sdFc_2 from './shuangdaoFcSw.threejs'; // sdFc_2 单道-带小门-2个窗
 import sdFc_5 from './shuangdaoFcYjl.threejs'; // sdFc_5 双道-小门(侧边下)-小窗(榆家梁)
-import ddFc_4 from './dandaoFcBd1.threejs'; // ddFc_2 单道-一个小窗两列扇叶
+import ddFc_4 from './dandaoFcBd1.threejs'; // ddFc_4 单道-一个小窗两列扇叶
 import ddFc_2 from './dandaoFcBd2.threejs'; // ddFc_2 单道-一个大窗两列竖型扇叶
 import ddFc_6 from './dandaoFcHjt.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
 import ddFc_7 from './dandaoFcBd3.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
+import threeFc_8 from './sandaoFc.threejs'; // ddFc_8 三道-大窗2列门式扇叶(三道沟)
 import { animateCamera } from '/@/utils/threejs/util';
 import useEvent from '../../../../utils/threejs/useEvent';
 import { getDictItemsByCode } from '/@/utils/dict';
@@ -33,6 +34,7 @@ let model: UseThree,
   ddFc4: ddFc_4,
   ddFc6: ddFc_6,
   ddFc7: ddFc_7,
+  threeFc8: threeFc_8,
   singleWindowXkObj: singleWindowXk,
   group: THREE.Object3D,
   windowType = 'ddFc1';
@@ -40,6 +42,8 @@ let model: UseThree,
 const rotationParam = {
   frontDeg0: 0, // 前门初始
   frontDeg1: 0, // 前门目标
+  centerDeg0: 0, // 前门初始
+  centerDeg1: 0, // 前门目标
   backDeg0: 0, // 后门初始
   backDeg1: 0, // 后门目标
 };
@@ -75,6 +79,8 @@ const startAnimation = () => {
       sdFc2.mouseUpModel.call(sdFc2);
     } else if (windowType === 'sdFc5' && sdFc5) {
       sdFc5.mouseUpModel.call(sdFc5);
+    } else if (windowType === 'threeFc8' && threeFc8) {
+      threeFc8.mouseUpModel.call(threeFc8);
     } else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
       singleWindowXkObj.mouseUpModel.call(singleWindowXkObj);
     }
@@ -107,6 +113,8 @@ const mouseEvent = (event) => {
         sdFc2.mousedownModel.call(sdFc2, intersects);
       } else if (windowType === 'sdFc5' && sdFc5) {
         sdFc5.mousedownModel.call(sdFc5, intersects);
+      } else if (windowType === 'threeFc8' && threeFc8) {
+        threeFc8.mousedownModel(intersects);
       } else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
         singleWindowXkObj.mousedownModel.call(singleWindowXkObj, intersects);
       }
@@ -114,7 +122,11 @@ const mouseEvent = (event) => {
     console.log('摄像头控制信息', model.orbitControls, model.camera);
   }
 };
-
+const addMouseEvent = () => {
+  // 定义鼠标点击事件
+  model.canvasContainer?.addEventListener('mousedown', mouseEvent.bind(null));
+  // model.canvasContainer?.addEventListener('pointerup', mouseUp);
+};
 export const addMonitorText = (selectData) => {
   if (windowType === 'ddFc5' && ddFc5) {
     return ddFc5.addMonitorText.call(ddFc5, selectData);
@@ -138,6 +150,8 @@ export const addMonitorText = (selectData) => {
     return sdFc2.addMonitorText.call(sdFc2, selectData);
   } else if (windowType === 'sdFc5' && sdFc5) {
     return sdFc5.addMonitorText.call(sdFc5, selectData);
+  } else if (windowType === 'threeFc8' && threeFc8) {
+    return threeFc8.addMonitorText(selectData);
   } else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
     return singleWindowXkObj.addMonitorText.call(singleWindowXkObj, selectData);
   }
@@ -163,7 +177,7 @@ export function computePlay(data, maxarea, isFirst = false) {
       }, 0);
     }
   } else {
-    if (data.OpenDegree || data.OpenDegree1 || data.OpenDegree2) {
+    if (data.OpenDegree || data.OpenDegree1 || data.OpenDegree2 || data.OpenDegree3) {
       maxarea = 180;
       if (data.OpenDegree) {
         rotationParam.frontDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree);
@@ -177,6 +191,10 @@ export function computePlay(data, maxarea, isFirst = false) {
         rotationParam.backDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree2);
         rotationParam.backDeg1 = (180 / maxarea) * Number(data.OpenDegree2) || 0;
       }
+      if (data.OpenDegree3) {
+        rotationParam.centerDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree3);
+        rotationParam.centerDeg1 = (180 / maxarea) * Number(data.OpenDegree3) || 0;
+      }
     } else {
       // 这里判断是扇叶模型还是卷闸模型,如果是卷闸模型时
       if (isJz) {
@@ -190,6 +208,10 @@ export function computePlay(data, maxarea, isFirst = false) {
         rotationParam.backDeg0 = (90 / maxarea) * Number(isFirst ? 0 : data.rearArea);
         rotationParam.frontDeg1 = (90 / maxarea) * Number(data.forntArea) || 0;
         rotationParam.backDeg1 = (90 / maxarea) * Number(data.rearArea) || 0;
+        if (windowType == 'threeFc8') {
+          rotationParam.centerDeg0 = (90 / maxarea) * Number(isFirst ? 0 : data.middleArea);
+          rotationParam.centerDeg1 = (90 / maxarea) * Number(data.middleArea) || 0;
+        }
       }
     }
     if (isJz) {
@@ -202,15 +224,21 @@ export function computePlay(data, maxarea, isFirst = false) {
         // 当返回值有误时默认关闭
         play(rotationParam, 0);
       } else {
-        if (data.nwindownum == 1 || data.nwindownum == 2) {
+        setTimeout(() => {
+          play(rotationParam, 1);
+        }, 0);
+        if (data.nwindownum == 2) {
           setTimeout(() => {
-            play(rotationParam, 1);
+            play(rotationParam, 2);
           }, 0);
         }
-        if (data.nwindownum == 2) {
+        if (data.nwindownum == 3) {
           setTimeout(() => {
             play(rotationParam, 2);
           }, 0);
+          setTimeout(() => {
+            play(rotationParam, 3);
+          }, 0);
         }
       }
     }
@@ -240,6 +268,8 @@ export const play = (rotationParam, flag) => {
     return sdFc2.play.call(sdFc2, rotationParam, flag);
   } else if (windowType === 'sdFc5' && sdFc5) {
     return sdFc5.play.call(sdFc5, rotationParam, flag);
+  } else if (windowType === 'threeFc8' && threeFc8) {
+    return threeFc8.play(rotationParam, flag);
   } else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
     return singleWindowXkObj.play.call(singleWindowXkObj, rotationParam, flag);
   }
@@ -316,6 +346,12 @@ export const setModelType = (type) => {
       newP: { x: 34.294433107431956, y: 19.284123769585108, z: 47.717286013509835 },
       newT: { x: 12.311816240141978, y: -5.691930035759495, z: -5.57302688985693 },
     },
+    threeFc8: {
+      render: threeFc8 ? () => threeFc8.render() : null,
+      group: threeFc8 ? threeFc8.group : null,
+      newP: { x: 70.79925059068043, y: 61.89235869996884, z: 107.07997293517579 },
+      newT: { x: 15.353809053159333, y: 8.712511207091119, z: -13.223119892513122 },
+    },
     singleXkWindow: {
       render: singleWindowXkObj ? () => singleWindowXkObj.render() : null,
       group: singleWindowXkObj ? singleWindowXkObj.group : null,
@@ -404,6 +440,10 @@ export const mountedThree = () => {
           sdFc5 = new sdFc_5(model);
           await sdFc5.mountedThree();
           break;
+        case 'threeFc8':
+          threeFc8 = new threeFc_8(model);
+          await threeFc8.mountedThree();
+          break;
         case 'singleXkWindow':
           singleWindowXkObj = new singleWindowXk(model);
           await singleWindowXkObj.mountedThree();
@@ -411,6 +451,7 @@ export const mountedThree = () => {
       }
     }
     model.animate();
+    // addMouseEvent();
     resolve(null);
   });
 };
@@ -431,6 +472,7 @@ export const destroy = () => {
     if (sdFc4) sdFc4.destroy();
     if (sdFc2) sdFc2.destroy();
     if (sdFc5) sdFc5.destroy();
+    if (threeFc8) threeFc8.destroy();
 
     singleWindowXkObj.destroy();
     model.destroy();
@@ -448,5 +490,6 @@ export const destroy = () => {
     sdFc4 = null;
     sdFc2 = null;
     sdFc5 = null;
+    threeFc8 = null;
   }
 };

+ 15 - 1
vite.config.ts

@@ -67,7 +67,21 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
       https: false,
       port: VITE_PORT,
       // Load proxy configuration from .env
-      proxy: createProxy(VITE_PROXY),
+      proxy: {
+        ...createProxy(VITE_PROXY),
+        '/res': {
+          target: 'http://182.92.126.35:9999/',
+          ws: true,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(/^\/res/, ''),
+          configure: (proxy, options) => {
+            // 可以在这里对代理进行额外的配置
+            proxy.on('proxyReq', (proxyReq, req, res) => {
+              proxyReq.setHeader('Content-Type', 'application/force-download');
+            });
+          },
+        },
+      },
     },
     build: {
       minify: 'esbuild',