Ver código fonte

修改冲突

hongrunxia 1 ano atrás
pai
commit
a0a59ece0f

+ 8 - 8
index.html

@@ -12,7 +12,7 @@
     <script src="/js/liveplayer-lib.min.js"></script>
     <script src="/js/webrtcstreamer.js"></script>
     <script src="/js/adapter.min.js"></script>
-    <script type="text/javascript" src="<%= VITE_PUBLIC_PATH %>documents/web-apps/apps/api/documents/api.js"></script>
+    <!-- <script type="text/javascript" src="/web-apps/apps/api/documents/api.js"></script> -->
   </head>
   <body>
     <script>
@@ -321,13 +321,13 @@
     
     <script type="module" src="/src/main.ts"></script>
     <script>
-      var _hmt = _hmt || [];
-      (function() {
-        var hm = document.createElement("script");
-        hm.src = "https://hm.baidu.com/hm.js?0febd9e3cacb3f627ddac64d52caac39";
-        var s = document.getElementsByTagName("script")[0];
-        s.parentNode.insertBefore(hm, s);
-      })();
+      // var _hmt = _hmt || [];
+      // (function() {
+      //   var hm = document.createElement("script");
+      //   hm.src = "https://hm.baidu.com/hm.js?0febd9e3cacb3f627ddac64d52caac39";
+      //   var s = document.getElementsByTagName("script")[0];
+      //   s.parentNode.insertBefore(hm, s);
+      // })();
     </script>
   </body>
 </html>

BIN
src/assets/images/company/home-dz.png


BIN
src/assets/images/company/home-map.png


BIN
src/assets/images/company/home-pageBg.png


BIN
src/assets/images/company/select-bg.png


BIN
src/assets/images/company/unselect-bg.png


BIN
src/assets/images/company/标注.png


+ 11 - 135
src/components/vent/micro/ventModal.vue

@@ -1,12 +1,6 @@
 <template>
-  <div v-if="loading" class="app-loading">
-    <div id="loader-wrapper" class="app-loading">
-      <div class="app-loading-wrap">
-        <div class="app-loading-dots">
-          <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
-        </div>
-      </div>
-    </div>
+  <div style="position: absolute; width: 100%; height: 100%">
+    <a-spin class="loading-box" size="large" :spinning="loading" tip="正在加载,请稍等。。。" />
   </div>
   <div id="micro-vent-3dModal"></div>
 </template>
@@ -14,28 +8,15 @@
   import { ref, onMounted, onBeforeUnmount, defineComponent } from 'vue';
   import { unmountMicroApps, mountMicroApp } from '/@/qiankun';
   import { resetMicroContentWH } from '/@/utils/domUtils';
-  import { getActions } from '/@/qiankun/state';
 
   export default defineComponent({
     name: 'VentModel',
     setup() {
-      let actions: any;
       const loading = ref(true);
-
       onMounted(() => {
         mountMicroApp('/micro-vent-3dModal');
-        resetMicroContentWH('micro-vent-3dModal');
-        actions = getActions();
-        actions.onGlobalStateChange((newState, prev) => {
-          debugger;
-          for (const key in newState) {
-            if (key === 'isMounted') {
-              if (newState[key] !== prev[key] && newState[key] === true) {
-                loading.value = false;
-                console.log('首页已经渲染完毕');
-              }
-            }
-          }
+        resetMicroContentWH('micro-vent-3dModal', () => {
+          loading.value = false;
         });
       });
 
@@ -47,121 +28,16 @@
   });
 </script>
 <style lang="less" scoped>
-  @import '/@/design/vent/color.less';
-  .app-loading {
-    position: absolute;
+  .loading-box {
+    position: fixed;
     display: flex;
-    width: 100%;
-    height: 100%;
-    justify-content: center;
     align-items: center;
-    flex-direction: column;
-    // background-color: #f4f7f900;
-    background-image: url('/@/assets/images/vent/loading-bg.png');
-    background-size: cover;
-    background-repeat: no-repeat;
-    background-color: var(--vent-base-color);
-  }
-
-  .app-loading .app-loading-wrap {
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    display: flex;
-    -webkit-transform: translate3d(-50%, -50%, 0);
-    transform: translate3d(-50%, -50%, 0);
     justify-content: center;
-    align-items: center;
-    flex-direction: column;
-  }
-
-  .app-loading .dots {
-    display: flex;
-    padding: 98px;
-    justify-content: center;
-    align-items: center;
-  }
-
-  .app-loading .app-loading-title {
-    display: flex;
-    margin-top: 30px;
-    font-size: 30px;
-    color: rgba(0, 0, 0, 0.85);
-    justify-content: center;
-    align-items: center;
-  }
-
-  .dot {
-    position: relative;
-    display: inline-block;
-    width: 32px;
-    height: 32px;
-    margin-top: 30px;
-    font-size: 32px;
-    transform: rotate(45deg);
-    box-sizing: border-box;
-    animation: antRotate 1.2s infinite linear;
-  }
-
-  .dot i {
-    position: absolute;
-    display: block;
-    width: 14px;
-    height: 14px;
-    background-color: #0065cc;
-    // background-color: #d1d1d1;
-    border-radius: 100%;
-    opacity: 0.3;
-    transform: scale(0.75);
-    animation: antSpinMove 1s infinite linear alternate;
-    transform-origin: 50% 50%;
-  }
-
-  .dot i:nth-child(1) {
-    top: 0;
-    left: 0;
-  }
-
-  .dot i:nth-child(2) {
-    top: 0;
-    right: 0;
-    -webkit-animation-delay: 0.4s;
-    animation-delay: 0.4s;
-  }
-
-  .dot i:nth-child(3) {
-    right: 0;
-    bottom: 0;
-    -webkit-animation-delay: 0.8s;
-    animation-delay: 0.8s;
-  }
-
-  .dot i:nth-child(4) {
-    bottom: 0;
-    left: 0;
-    -webkit-animation-delay: 1.2s;
-    animation-delay: 1.2s;
-  }
-  @keyframes antRotate {
-    to {
-      -webkit-transform: rotate(405deg);
-      transform: rotate(405deg);
-    }
-  }
-  @-webkit-keyframes antRotate {
-    to {
-      -webkit-transform: rotate(405deg);
-      transform: rotate(405deg);
-    }
-  }
-  @keyframes antSpinMove {
-    to {
-      opacity: 1;
-    }
+    width: 100%;
+    height: 100%;
   }
-  @-webkit-keyframes antSpinMove {
-    to {
-      opacity: 1;
-    }
+  #micro-vent-3dModal {
+    width: 100%;
+    height: 100%;
   }
 </style>

+ 1 - 1
src/layouts/default/content/index.vue

@@ -46,7 +46,7 @@
       let actions;
       if (openQianKun == 'true') {
         actions = getActions();
-        // actions.setGlobalState({ isMounted: false });
+        actions.setGlobalState({ isMounted: false });
         actions.onGlobalStateChange((newState, prev) => {
           for (const key in newState) {
             if (key === 'isMounted') {

+ 4 - 3
src/utils/domUtils.ts

@@ -171,14 +171,15 @@ export function useRafThrottle<T extends FunctionArgs>(fn: T): T {
   };
 }
 
-export function resetMicroContentWH(domId) {
+export function resetMicroContentWH(domId, callBack?: Function) {
   const contentDom = document.getElementById(domId);
   if (contentDom && contentDom.firstChild) {
     (contentDom.firstChild as HTMLElement).style.height = '100%';
     (contentDom.firstChild as HTMLElement).style.width = '100%';
+    if (callBack) callBack();
   } else {
     setTimeout(() => {
-      resetMicroContentWH(domId);
+      resetMicroContentWH(domId, callBack);
     }, 1000);
   }
-};
+}

+ 1 - 1
src/utils/threejs/util.ts

@@ -64,7 +64,7 @@ export const getTextCanvas = (w, h, textArr, imgUrl) => {
     if (imgUrl) {
       const img = new Image();
 
-      img.src = new URL('../../assets/images/vent/model_image/' + imgUrl, import.meta.url).href;
+      img.src = new URL(location.origin + '../../assets/images/vent/model_image/' + imgUrl, import.meta.url).href;
       img.onload = () => {
         //将画布处理为透明
         ctx.clearRect(0, 0, width, height);

+ 4 - 4
src/utils/ui.js

@@ -1,7 +1,7 @@
 // 中间背景雨
 export function rainBg(className, bgClassName) {
   var c = document.querySelector(`.${className}`);
-  if (!c) return
+  if (!c) return;
   var ctx = c.getContext('2d'); //获取canvas上下文
   var w = (c.width = document.querySelector(`.${bgClassName}`).clientWidth);
   var h = (c.height = document.querySelector(`.${bgClassName}`).clientHeight);
@@ -11,7 +11,7 @@ export function rainBg(className, bgClassName) {
     return Math.random() * (max - min) + min;
   }
 
-  function RainDrop() { }
+  function RainDrop() {}
   //雨滴对象 这是绘制雨滴动画的关键
   RainDrop.prototype = {
     init: function () {
@@ -77,5 +77,5 @@ export function rainBg(className, bgClassName) {
 export const getAssetURL = (image) => {
   // 参数一: 相对路径
   // 参数二: 当前路径的URL
-  return new URL(`../assets/images/${image}`, import.meta.url).href
-}
+  return new URL(`${location.origin}../assets/images/${image}`, import.meta.url).href;
+};

+ 0 - 2
src/utils/ventutil.ts

@@ -222,5 +222,3 @@ export function deviceCameraInit(cameraAddrs, player: HTMLElement, webRtcServerL
     return { webRtcServerList: webRtcServer, playerDoms };
   });
 }
-
-

+ 58 - 56
src/views/vent/comment/components/customHeader.vue

@@ -4,16 +4,16 @@
       <!-- <Decoration5 class="header-icon" :dur="2" :color="['#21437F', '#2CF7FE']" style="width:500px;height:40px;" /> -->
       <div class="header-text"><slot></slot></div>
     </div>
-    <div class = "container-title" v-if="fieldNames">
+    <div class="container-title" v-if="fieldNames">
       <a-select
         class="title-select"
         ref="select"
         v-model:value="currentTitleValue"
         @change="handleTitleChange"
-        popupClassName="drop"
+        dropdownClassName="drop"
         :field-names="fieldNames"
         :options="options"
-        :dropdownStyle="{ background : 'transparent',  borderBottom: '1px solid #ececec66', backdropFilter: 'blur(50px)', color: '#fff'}"
+        :dropdownStyle="{ background: 'transparent', borderBottom: '1px solid #ececec66', backdropFilter: 'blur(50px)', color: '#fff' }"
       >
         <!-- <a-select-option value="2">15212工作面</a-select-option>
         <a-select-option value="1598491318007898113">采煤工作面</a-select-option>
@@ -23,71 +23,72 @@
   </div>
 </template>
 <script lang="ts">
-import { defineComponent, computed } from 'vue'
-import { Decoration5 } from '@kjgl77/datav-vue3'
-export default defineComponent({
-  name: 'customHeader',
-  components: { Decoration5 },
-  props: {
-    optionValue: {
-      type: String
+  import { defineComponent, computed } from 'vue';
+  import { Decoration5 } from '@kjgl77/datav-vue3';
+  export default defineComponent({
+    name: 'CustomHeader',
+    components: { Decoration5 },
+    props: {
+      optionValue: {
+        type: String,
+      },
+      fieldNames: {
+        type: Object,
+        default: () => {},
+      },
+      options: {
+        type: Array,
+        default: () => [],
+      },
     },
-    fieldNames: {
-      type: Object,
-      default: () => {}
+    emits: ['change'],
+    setup(props, { emit }) {
+      const currentTitleValue = computed(() => props.optionValue);
+      // 标题选择
+      function handleTitleChange(value) {
+        emit('change', value);
+      }
+      return {
+        currentTitleValue,
+        handleTitleChange,
+      };
     },
-    options: {
-      type: Array,
-      default: () => []
-    }
-  },
-  emits: ['change'],
-  setup(props, { emit }) {
-    const currentTitleValue = computed(() => props.optionValue)
-    // 标题选择
-    function handleTitleChange(value) {
-      emit('change', value)
-    }   
-    return {
-      currentTitleValue,
-      handleTitleChange,
-    }
-  },
-})
+  });
 </script>
 <style lang="less">
-@import '/@/design/vent/modal.less';
+  @import '/@/design/vent/modal.less';
 
-.@{ventSpace}-select-dropdown {
-  // color: #fff !important;
-  .@{ventSpace}-select-item-option-selected,
-  .@{ventSpace}-select-item-option-active {
-    background-color: #ffffff33 !important;
-  }
-  .@{ventSpace}-select-item{
-    color: inherit;
-    &:hover {
+  .@{ventSpace}-select-dropdown.drop {
+    background-color: transparent !important;
+
+    .@{ventSpace}-select-item-option-selected,
+    .@{ventSpace}-select-item-option-active {
       background-color: #ffffff33 !important;
     }
-  }
-  .@{ventSpace}-select-tree {
-    .@{ventSpace}-select-tree-treenode {
+    .@{ventSpace}-select-item {
       color: inherit;
+      &:hover {
+        background-color: #ffffff33 !important;
+      }
     }
-    .@{ventSpace}-select-tree-switcher-icon {
-      color: inherit;
+    .@{ventSpace}-select-tree {
+      .@{ventSpace}-select-tree-treenode {
+        color: inherit;
+      }
+      .@{ventSpace}-select-tree-switcher-icon {
+        color: inherit;
+      }
     }
   }
-}
 </style>
 <style lang="less" scoped>
   @ventSpace: zxm;
-  .vent-custom-header{
+  .vent-custom-header {
     width: 100%;
     height: fit-content;
     .vent-home-header {
       width: 100%;
-      
+
       position: fixed;
       top: 0;
       // background: url('/@/assets/images/vent/new-home/header-bg.png') no-repeat;
@@ -97,10 +98,10 @@ export default defineComponent({
       background-size: contain;
       display: flex;
       justify-content: center;
-      .header-icon{
+      .header-icon {
         margin-top: 45px;
       }
-      .header-text{
+      .header-text {
         position: fixed;
         top: 5px;
         color: #fff;
@@ -125,23 +126,24 @@ export default defineComponent({
       .title-select {
         width: 228px;
         position: absolute;
+
         top: 0;
         left: 160px;
       }
     }
   }
-  :deep(.zxm-select){
+  :deep(.zxm-select) {
     width: 300px;
-    .@{ventSpace}-select-selector{
+    .@{ventSpace}-select-selector {
       background: transparent !important;
       border: none !important;
       box-shadow: none !important;
-      .zxm-select-selection-item{
+      .zxm-select-selection-item {
         color: #fff !important;
         font-size: 20px;
       }
     }
-    .@{ventSpace}-select-arrow{
+    .@{ventSpace}-select-arrow {
       color: #fff !important;
     }
   }

+ 58 - 0
src/views/vent/home/clique/components/icon-light.vue

@@ -0,0 +1,58 @@
+<template>
+    <div class="icon-light">
+        <div class="icon-point" v-for="(item, index) in pointList" :key="index"
+            :style="{ left: item.leftV, top: item.topV }">
+            <img :src="item.imgSrc" alt="">
+            <span :style="{ color: item.textColor }">{{ item.label }}</span>
+        </div>
+    </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive } from 'vue'
+import { getAssetURL } from '/@/utils/ui';
+
+let pointList = reactive<any[]>([
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '柳塔矿', leftV: '327px', topV: '40px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '寸草塔二矿', leftV: '291px', topV: '69px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '布尔台矿', leftV: '286px', topV: '97px', textColor: 'rgba(255, 231, 83,.9)' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '乌兰木伦矿', leftV: '327px', topV: '115px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '寸草塔矿', leftV: '346px', topV: '132px', textColor: 'rgba(255, 231, 83,.9)' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '石坎台矿', leftV: '373px', topV: '149px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '补连塔矿', leftV: '408px', topV: '184px', textColor: 'rgba(255, 231, 83,.9)' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '哈拉沟矿', leftV: '445px', topV: '214px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '上湾矿', leftV: '439px', topV: '244px', textColor: 'rgba(255, 231, 83,.9)' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '活鸡兔井', leftV: '398px', topV: '265px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '大柳塔矿', leftV: '492px', topV: '260px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '锦界矿', leftV: '565px', topV: '413px', textColor: 'rgba(255, 231, 83,.9)' },
+    { imgSrc: getAssetURL('company/unselect-bg.png'), label: '榆家梁矿', leftV: '669px', topV: '308px', textColor: '#fff' },
+    { imgSrc: getAssetURL('company/select-bg.png'), label: '宝德矿', leftV: '862px', topV: '340px', textColor: 'rgba(255, 231, 83,.9)' },
+])
+
+</script>
+
+<style lang="less" scoped>
+.icon-light {
+    position: relative;
+    width: 100%;
+    height: 100%;
+
+    .icon-point {
+        display: flex;
+        align-items: center;
+        position: absolute;
+
+        img {
+            width: 35px;
+            height: 35px;
+            cursor: pointer;
+        }
+
+        span {
+            font-size: 12px;
+            padding: 0px 5px;
+            background-color: rgba(12, 13, 13);
+        }
+    }
+}
+</style>

+ 28 - 0
src/views/vent/home/clique/index.vue

@@ -17,6 +17,12 @@
           </div>
         </div>
         <div class="center-area">
+          <!-- 地图底图 -->
+          <div class="center-bg">
+            <div class="bg-map">
+              <iconLight></iconLight>
+            </div>
+          </div>
           <!-- 榆家梁矿 -->
           <!-- <div class="area-card2">
             
@@ -48,6 +54,10 @@
   import windRoad from './components/wind-road.vue';
   import sceneKey from './components/scene-key.vue';
   import mapComponent from './components/3Dmap/index.vue';
+  import windRoad from './components/wind-road.vue';
+  import sceneKey from './components/scene-key.vue';
+  import iconLight from './components/icon-light.vue'
+  // import mapComponent from './components/3Dmap/index.vue';
 
   let mainTitle = ref('国家能源神东煤炭集团');
   function showDetail(code) {
@@ -70,6 +80,8 @@
     width: 100%;
     height: 100%;
     position: relative;
+    background: url('../../../../assets/images/company/home-pageBg.png') no-repeat center;
+    background-size: 100% 100%;
 
     .top-bg {
       width: 100%;
@@ -138,6 +150,22 @@
           width: calc(54% - 30px);
           height: 100%;
           position: relative;
+          .center-bg{
+            position: absolute;
+            bottom: 269px;
+            left: 50%;
+            transform: translate(-50%,0);
+            height: calc(100% - 325px);
+            width: 100%;
+            background: url('../../../../assets/images/company/home-dz.png') no-repeat center;
+            background-position: 50% 90%;
+            .bg-map{
+              width: 100%;
+              height: 100%;
+              background: url('../../../../assets/images/company/home-map.png') no-repeat center;
+              background-size: 100% 100%;
+            }
+          }
           .area-card2 {
             position: absolute;
             right: 0;

+ 4 - 4
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -600,7 +600,7 @@
       selectData = lodash.cloneDeep(initData);
       loading.value = false;
       if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
-
+      debugger;
       const headEl = document.querySelector(`.zxm-table-thead`);
       if (headEl) {
         headElHeight.value = headEl.clientHeight;
@@ -680,9 +680,9 @@
             }
             playSmoke(selectData);
             addText(selectData);
-            if (timer) {
-              timer = null;
-            }
+          }
+          if (timer) {
+            timer = null;
           }
           getMonitor();
         },

+ 232 - 218
src/views/vent/monitorManager/mainFanMonitor/components/conditionAssistance.vue

@@ -1,5 +1,16 @@
 <template>
-  <BasicModal @register="register" title="风机运行工况辅助决策" :maskStyle="{backgroundColor: '#000000aa'}" width="1200px" v-bind="$attrs" @ok="onSubmit" @cancel="onSubmit" :canFullscreen="false" :destroyOnClose="true" :footer="null">
+  <BasicModal
+    @register="register"
+    title="风机运行工况辅助决策"
+    :maskStyle="{ backgroundColor: '#000000aa' }"
+    width="1200px"
+    v-bind="$attrs"
+    @ok="onSubmit"
+    @cancel="onSubmit"
+    :canFullscreen="false"
+    :destroyOnClose="true"
+    :footer="null"
+  >
     <div class="modal-box">
       <div class="right-box">
         <!-- <div class="box-title">风机信息</div> -->
@@ -14,13 +25,14 @@
         </div>
       </div>
       <div class="center-box">
-         <a-spin :spinning="loadding" tip="正在计算,请稍等。。。">
-          <div ref="chartRef" class="info-echarts" style="width: 450px; height:375px;"></div>
+        <a-spin :spinning="loadding" tip="正在计算,请稍等。。。">
+          <div ref="chartRef" class="info-echarts" style="width: 450px; height: 375px"></div>
           <div v-if="resultObj" class="result-tip">
             工况点为
-            <span style="color: #9A60B4; padding: 0 10px; font-weight: 600;">{{ parseInt(resultObj.Hz) }}Hz</span>
-            <span style="color: #C60000; padding: 0 10px; font-weight: 600;">{{ formatNum(resultObj.x) }} m³/s</span>
-            <span style="color: #C60000; padding: 0 10px; font-weight: 600;">{{ formatNum(resultObj.y) }} Pa</span></div>
+            <span style="color: #9a60b4; padding: 0 10px; font-weight: 600">{{ parseInt(resultObj.Hz) }}Hz</span>
+            <span style="color: #c60000; padding: 0 10px; font-weight: 600">{{ formatNum(resultObj.x) }} m³/s</span>
+            <span style="color: #c60000; padding: 0 10px; font-weight: 600">{{ formatNum(resultObj.y) }} Pa</span></div
+          >
         </a-spin>
       </div>
       <div class="left-box">
@@ -53,61 +65,64 @@
     </div>
     <div v-if="formShow" class="is-close" :class="{ 'is-open': formShow }">
       <a-divider orientation="left" style="border-color: #00d8ff22">{{ formType }}</a-divider>
-      <BasicForm  @register="registerForm" @submit="handleSubmit" :schemas="formType == '编辑风机信息' ? getSchamas() : getSchamas1()" :model="formType == '编辑风机信息' ? fanInfoData : lineFormData"></BasicForm>
+      <BasicForm
+        @register="registerForm"
+        @submit="handleSubmit"
+        :schemas="formType == '编辑风机信息' ? getSchamas() : getSchamas1()"
+        :model="formType == '编辑风机信息' ? fanInfoData : lineFormData"
+      />
     </div>
-    
   </BasicModal>
-  
 </template>
 
 <script lang="ts" setup>
   //ts语法
   import { ref, onMounted, reactive, nextTick } from 'vue';
   import echarts from '/@/utils/lib/echarts';
-  import { option, initData, fanInfoData, fanInfo, getSchamas, getSchamas1, lineFormData } from '../main.data.ts'
+  import { option, initData, fanInfoData, fanInfo, getSchamas, getSchamas1, lineFormData } from '../main.data.ts';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form/index';
-  import { Input} from 'ant-design-vue';
-  import { Decoration7 as DvDecoration7} from '@kjgl77/datav-vue3';
+  import { Input } from 'ant-design-vue';
+  import { Decoration7 as DvDecoration7 } from '@kjgl77/datav-vue3';
   import { message } from 'ant-design-vue';
-  import { formatNum } from '/@/utils/ventutil'
+  import { formatNum } from '/@/utils/ventutil';
 
-  const emit = defineEmits(['close', 'register', 'openModal'])
+  const emit = defineEmits(['close', 'register', 'openModal']);
   type AssistanceItemType = {
-    angle: number,
-    Hz: number,
-    a: number,
-    b: number,
-    c: number,
-    min: number,
-    max: number,
-  }
+    angle: number;
+    Hz: number;
+    a: number;
+    b: number;
+    c: number;
+    min: number;
+    max: number;
+  };
 
   // 注册 modal
   const [register, { closeModal }] = useModalInner(() => {
     nextTick(() => {
-      computeAssistance()
-      if (option['xAxis']) option['xAxis']['data'] = xData
-      option['series'] = yDataList
-      initEcharts()
-    })
+      computeAssistance();
+      if (option['xAxis']) option['xAxis']['data'] = xData;
+      option['series'] = yDataList;
+      initEcharts();
+    });
   });
   const loadding = ref<boolean>(false);
-  const formShow = ref(false)
-  const formType = ref('')
+  const formShow = ref(false);
+  const formType = ref('');
   const chartRef = ref();
   const myChart = ref();
-  const refresh = ref(true)
-  const xData:any[] = [];
-  const yDataList:[] = [];
+  const refresh = ref(true);
+  const xData: any[] = [];
+  const yDataList: [] = [];
   let lineNum = 0;
-  const lineEquation = ref<string[]>([])
+  const lineEquation = ref<string[]>([]);
+
+  const uQ = ref<string | undefined>(undefined); // 100 - 400
+  const uH = ref<number | undefined>(undefined); //  - 1000
+  const resultObj = ref<{ x: number; y: number; Hz: number } | null>(null);
 
-  const uQ = ref<string | undefined>(undefined) // 100 - 400
-  const uH = ref<number | undefined>(undefined) //  - 1000
-  const resultObj = ref<{ x: number, y: number, Hz: number }|null>(null)
-  
-  const [registerForm, {  }] = useForm({
+  const [registerForm, {}] = useForm({
     labelWidth: 120,
     actionColOptions: {
       span: 24,
@@ -124,57 +139,67 @@
       preIcon: '',
     },
     resetFunc: async () => {
-      formShow.value = false
-    }
+      formShow.value = false;
+    },
   });
 
   function computeAssistance() {
-    const assistanceData = initData()
-    lineNum = 0
-    const assistanceDataList = []
-    const lineEquationList: string[] = []
+    const assistanceData = initData();
+    lineNum = 0;
+    const assistanceDataList = [];
+    const lineEquationList: string[] = [];
     for (const key in assistanceData) {
-      const item = assistanceData[key]
-      assistanceDataList.push(item)
-      lineEquationList.push(`H${parseInt(item['Hz'])} = ${item['a']}Q² ${Number(item['b']) > 0 ? '+' : '-'} ${Math.abs(Number(item['b'])).toFixed(5)}Q ${Number(item['c']) > 0 ? '+' : '-'} ${Math.abs(Number(item['c'])).toFixed(5)}` )
-    }
-    lineEquation.value = lineEquationList
+      const item = assistanceData[key];
+      assistanceDataList.push(item);
+      lineEquationList.push(
+        `H${parseInt(item['Hz'])} = ${item['a']}Q² ${Number(item['b']) > 0 ? '+' : '-'} ${Math.abs(Number(item['b'])).toFixed(5)}Q ${
+          Number(item['c']) > 0 ? '+' : '-'
+        } ${Math.abs(Number(item['c'])).toFixed(5)}`
+      );
+    }
+    lineEquation.value = lineEquationList;
     lineNum = assistanceDataList.length;
-    const xDataMin = Math.min.apply(Math, assistanceDataList.map(item => { return item.min })) - 10
+    const xDataMin =
+      Math.min.apply(
+        Math,
+        assistanceDataList.map((item) => {
+          return item.min;
+        })
+      ) - 10;
     // const xDataMax = Math.max.apply(Math, assistanceDataList.map(item => { return item.max }))
-    const xDataMax = 230
-    fanInfoData.flfw = `${xDataMin}~${xDataMax}`
+    const xDataMax = 230;
+    fanInfoData.flfw = `${xDataMin}~${xDataMax}`;
     const computeItem = (item: AssistanceItemType) => {
-      const min = item.min
-      const max = item.max
-      const HList:number[] = []
-      for(let i = xDataMin; i <= xDataMax; i++){
-        if(i < min){
-          HList.push(null)
-        } else if(i > max){
-          HList.push(null)
-        }else{
-          HList.push(item.a * i * i + item.b * i + item.c)
+      const min = item.min;
+      const max = item.max;
+      const HList: number[] = [];
+      for (let i = xDataMin; i <= xDataMax; i++) {
+        if (i < min) {
+          HList.push(null);
+        } else if (i > max) {
+          HList.push(null);
+        } else {
+          HList.push(item.a * i * i + item.b * i + item.c);
         }
       }
-      return HList
-    }
-    
+      return HList;
+    };
+
     for (const key in assistanceData) {
       const element: AssistanceItemType = assistanceData[key];
-      const yData:number[] = computeItem(element)
+      const yData: number[] = computeItem(element);
       const series = {
         name: `${element['Hz']}Hz`,
         type: 'line',
         smooth: true,
         showSymbol: false,
         emphasis: {
-          focus: 'series'
+          focus: 'series',
         },
         itemStyle: { normal: { label: { show: true } } },
         lineStyle: {
           width: 1,
-          color: '#ffffff88'
+          color: '#ffffff88',
         },
         zlevel: 0,
         z: 1,
@@ -184,29 +209,29 @@
           distance: 0,
           color: '#39E9FE99',
           backgroundColor: 'transparent',
-          padding: [3, 3, 2, 3]
+          padding: [3, 3, 2, 3],
         },
-        data: yData
+        data: yData,
       };
-      yDataList.push(series)
+      yDataList.push(series);
     }
-    
+
     for (let i = xDataMin; i <= xDataMax; i++) {
-      xData.push(i)
+      xData.push(i);
     }
   }
 
   function computeRLine() {
-    if(uH.value && uQ.value){
+    if (uH.value && uQ.value) {
       const R = uH.value / Number(uQ.value) / Number(uQ.value);
-      const yAxis: number[] = []
+      const yAxis: number[] = [];
       for (let i = 0; i < xData.length; i++) {
-        const x = xData[i]
-        const y = R * x * x
+        const x = xData[i];
+        const y = R * x * x;
         if (x == uQ.value) {
-          uH.value = y
+          uH.value = y;
         }
-        yAxis.push(y)
+        yAxis.push(y);
       }
       const series = {
         name: 'R',
@@ -215,12 +240,12 @@
         showSymbol: false,
         zlevel: 0,
         emphasis: {
-          focus: 'series'
+          focus: 'series',
         },
         itemStyle: { normal: { label: { show: true } } },
         lineStyle: {
           width: 2,
-          color: '#D0A343'
+          color: '#D0A343',
         },
         endLabel: {
           show: true,
@@ -228,49 +253,49 @@
           distance: 0,
           color: '#D0A343',
         },
-        data: yAxis
+        data: yAxis,
       };
-      yDataList[lineNum] = series
+      yDataList[lineNum] = series;
     }
   }
 
   function reSetLine() {
-    let minIndex = -1
-    for(let i=0; i< yDataList.length; i++){
-      if(i !== lineNum && i != lineNum + 1){
-        if (yDataList[i]['lineStyle']) yDataList[i]['lineStyle']['color'] = '#ffffff88'
-        if (yDataList[i]['lineStyle']) yDataList[i]['lineStyle']['width'] = 1
-        if (yDataList[i]['endLabel'] && yDataList[i]['endLabel']['color']) yDataList[i]['endLabel']['color'] = '#39E9FE99'
-        if (yDataList[i]['endLabel'] && yDataList[i]['endLabel']['backgroundColor']) yDataList[i]['endLabel']['backgroundColor'] = 'transparent'
-        if (yDataList[i]['z']) yDataList[i]['z'] = 1
+    let minIndex = -1;
+    for (let i = 0; i < yDataList.length; i++) {
+      if (i !== lineNum && i != lineNum + 1) {
+        if (yDataList[i]['lineStyle']) yDataList[i]['lineStyle']['color'] = '#ffffff88';
+        if (yDataList[i]['lineStyle']) yDataList[i]['lineStyle']['width'] = 1;
+        if (yDataList[i]['endLabel'] && yDataList[i]['endLabel']['color']) yDataList[i]['endLabel']['color'] = '#39E9FE99';
+        if (yDataList[i]['endLabel'] && yDataList[i]['endLabel']['backgroundColor']) yDataList[i]['endLabel']['backgroundColor'] = 'transparent';
+        if (yDataList[i]['z']) yDataList[i]['z'] = 1;
       }
-      if(`${resultObj.value.Hz}Hz` == yDataList[i]['name']){
-        minIndex = i
+      if (`${resultObj.value.Hz}Hz` == yDataList[i]['name']) {
+        minIndex = i;
       }
     }
-    if(minIndex != -1){
-      yDataList[minIndex]['lineStyle']['color'] = '#9A60B4'
-      yDataList[minIndex]['lineStyle']['width'] = 2
-      yDataList[minIndex]['endLabel']['color'] = '#9A60B4'
-      yDataList[minIndex]['endLabel']['backgroundColor'] = '#111'
-      yDataList[minIndex]['z'] = 999
+    if (minIndex != -1) {
+      yDataList[minIndex]['lineStyle']['color'] = '#9A60B4';
+      yDataList[minIndex]['lineStyle']['width'] = 2;
+      yDataList[minIndex]['endLabel']['color'] = '#9A60B4';
+      yDataList[minIndex]['endLabel']['backgroundColor'] = '#111';
+      yDataList[minIndex]['z'] = 999;
     }
   }
 
   // 根据风量计算压差
   function computePa() {
     const R = uH.value / Number(uQ.value) / Number(uQ.value);
-    const pointX = Number(uQ.value)
-    const pointY = Number(uH.value)
+    const pointX = Number(uQ.value);
+    const pointY = Number(uH.value);
     type ItemType = {
-      x: number,
-      y: number,
-      Hz: number
-    }
-    const assistanceData = initData()
-    const paList = new Map<number, ItemType>() // key 是最近距离
+      x: number;
+      y: number;
+      Hz: number;
+    };
+    const assistanceData = initData();
+    const paList = new Map<number, ItemType>(); // key 是最近距离
     const getIntersectionPoint = (a, b, c, R, min, max) => {
-      const obj: { x: undefined | number, y: undefined | number } = { x: undefined, y: undefined }
+      const obj: { x: undefined | number; y: undefined | number } = { x: undefined, y: undefined };
       // 计算二次方程的判别式
       const discriminant = b * b - 4 * (a - R) * c;
 
@@ -282,66 +307,64 @@
         const y1 = R * x1 * x1;
         const y2 = R * x2 * x2;
         if (x1 >= min && x1 <= max) {
-          obj.x = x1
-          obj.y = y1
+          obj.x = x1;
+          obj.y = y1;
         } else {
-          obj.x = x2
-          obj.y = y2
+          obj.x = x2;
+          obj.y = y2;
         }
       } else if (discriminant === 0) {
         // 有一个实根
         const x = -b / (2 * (a - R));
         const y = R * x * x;
         if (x >= min && x <= max) {
-          obj.x = x
-          obj.y = y
+          obj.x = x;
+          obj.y = y;
         }
         // console.log(`唯一交点: (${x}, ${y})`);
       } else {
         // 没有实根,交点在虚数域
-        console.log("没有实数交点");
+        console.log('没有实数交点');
       }
-      return obj
+      return obj;
+    };
 
+    for (let key in assistanceData) {
+      const item: AssistanceItemType = assistanceData[key];
+      paList.set(item.Hz, getIntersectionPoint(item.a, item.b, item.c, R, item.min, item.max));
     }
 
-    for(let key in assistanceData){
-      const item: AssistanceItemType = assistanceData[key]
-      paList.set(item.Hz, getIntersectionPoint(item.a, item.b, item.c, R, item.min, item.max ))
-    }
-    
     const min = (points: Map<number, ItemType>) => {
       const targetX = uQ.value;
       const targetY = uH.value;
       let minDistance = Number.POSITIVE_INFINITY;
       let closestPoint = null;
-      let keyVal = ''
+      let keyVal = '';
       // 遍历已知点数组,计算距离并更新最小距离和对应的点
       for (const [key, point] of points) {
         const distance = Math.sqrt((targetX - point.x) ** 2 + (targetY - point.y) ** 2);
         if (distance < minDistance) {
           minDistance = distance;
           closestPoint = point;
-          keyVal = key
+          keyVal = key;
         }
       }
 
       if (closestPoint !== null) {
         console.log(`距离最小的点是 (${closestPoint.x}, ${closestPoint.y}), 距离为 ${minDistance}`);
-        resultObj.value = {x: closestPoint.x, y: closestPoint.y,  Hz: keyVal }
+        resultObj.value = { x: closestPoint.x, y: closestPoint.y, Hz: keyVal };
       } else {
-        console.log("没有找到最小距离的点");
+        console.log('没有找到最小距离的点');
       }
-    }
-    min(paList)
-    reSetLine()
+    };
+    min(paList);
+    reSetLine();
   }
 
-
-  function computeR(){
-    if(uQ.value && uH.value){
-      computeRLine()
-      computePa()
+  function computeR() {
+    if (uQ.value && uH.value) {
+      computeRLine();
+      computePa();
       if (resultObj.value && resultObj.value.x && resultObj.value.y) {
         const series = {
           type: 'effectScatter',
@@ -351,103 +374,97 @@
           // 涟漪特效相关配置。
           rippleEffect: {
             // 波纹的绘制方式,可选 'stroke' 和 'fill'。
-            brushType: 'stroke'
+            brushType: 'stroke',
           },
           zlevel: 1,
           z: 999,
           itemStyle: {
-            color: '#C60000'
+            color: '#C60000',
           },
-          data: [
-            [resultObj.value.x.toFixed(0), Number(resultObj.value.y.toFixed(0))]
-          ],
-        }
-        yDataList[lineNum + 1] = series
+          data: [[resultObj.value.x.toFixed(0), Number(resultObj.value.y.toFixed(0))]],
+        };
+        yDataList[lineNum + 1] = series;
       }
     }
   }
 
   function edit(flag) {
-    if(flag == 'info'){
-      formType.value = '编辑风机信息'
+    if (flag == 'info') {
+      formType.value = '编辑风机信息';
     }
-    if(flag == 'line'){
-      formType.value = '编辑特性曲线'
+    if (flag == 'line') {
+      formType.value = '编辑特性曲线';
     }
-    if(formShow.value == true){
-      formShow.value = false
+    if (formShow.value == true) {
+      formShow.value = false;
       nextTick(() => {
-        formShow.value = true
-      })
-    }else{
-      formShow.value = true
+        formShow.value = true;
+      });
+    } else {
+      formShow.value = true;
     }
-    
   }
 
   async function onSubmit() {
-    emit('close')
+    emit('close');
     closeModal();
-    chartRef.value = null
-    uQ.value = undefined
-    uH.value = undefined
-    formType.value = ''
-    myChart.value = undefined
-    refresh.value = true
-    xData.length = 0
-    yDataList.length = 0
-    lineNum = 0
-    lineEquation.value = []
-    resultObj.value = null
-  } 
+    chartRef.value = null;
+    uQ.value = undefined;
+    uH.value = undefined;
+    formType.value = '';
+    myChart.value = undefined;
+    refresh.value = true;
+    xData.length = 0;
+    yDataList.length = 0;
+    lineNum = 0;
+    lineEquation.value = [];
+    resultObj.value = null;
+  }
 
   function initEcharts() {
-    if(chartRef.value){
-      computeR()
+    if (chartRef.value) {
+      computeR();
       myChart.value = echarts.init(chartRef.value);
       option && myChart.value.setOption(option);
-      refresh.value = false
+      refresh.value = false;
       nextTick(() => {
         setTimeout(() => {
-          refresh.value = true
-        }, 0)
-        
-      })
+          refresh.value = true;
+        }, 0);
+      });
     }
   }
 
   function makeLine() {
-    if(uQ.value && uH.value){
-      loadding.value = true
+    if (uQ.value && uH.value) {
+      loadding.value = true;
       setTimeout(() => {
-        initEcharts()
-        loadding.value = false
-      }, 1200)
+        initEcharts();
+        loadding.value = false;
+      }, 1200);
     }
   }
   function handleSubmit() {
-    message.success('提交成功')
+    message.success('提交成功');
     setTimeout(() => {
-      formShow.value = false
-    }, 800)
+      formShow.value = false;
+    }, 800);
   }
-  onMounted(() => {
-      
-  })
+  onMounted(() => {});
 </script>
 
 <style scoped lang="less">
-  .modal-box{
-    display: flex; 
+  .modal-box {
+    display: flex;
     flex-direction: row;
     background-color: #ffffff05;
     padding: 20px 8px;
     border: 1px solid #00d8ff22;
     // min-height: 600px;
-    .box-title{
+    .box-title {
       width: calc(100% - 40px);
       text-align: center;
-      background-color: #1DC1F522;
+      background-color: #1dc1f522;
     }
     .info-item {
       display: flex;
@@ -456,7 +473,7 @@
       padding: 2px 0px;
       margin: 4px 0;
       background-image: linear-gradient(to right, #39deff15, #3977e500);
-      &:first-child{
+      &:first-child {
         margin-top: 0;
       }
       .title {
@@ -472,38 +489,38 @@
         text-align: right;
       }
     }
-    .right-box{
+    .right-box {
       width: 350px;
-      
-      .info-container{
+
+      .info-container {
         width: calc(100% - 2px);
         margin-top: 5px;
         box-shadow: 0px 0px 50px #86baff08 inset;
       }
     }
-    .left-box{
+    .left-box {
       width: 350px;
-      .info-lines{
+      .info-lines {
         width: calc(100% - 2px);
         height: 390px;
         box-shadow: 0px 0px 50px #86baff08 inset;
         overflow-y: auto;
         margin-top: 5px;
-        .title{
+        .title {
           width: 100%;
           color: #f1f1f1cc;
         }
       }
     }
-    .center-box{
+    .center-box {
       margin: 0 10px;
-      
-      .info-echarts{
+
+      .info-echarts {
         // background-color: #ffffff11;
       }
-      .result-tip{
-        text-align: center; 
-        background-color: #00000011; 
+      .result-tip {
+        text-align: center;
+        background-color: #00000011;
         line-height: 28px;
         margin: 10px 50px 0 50px;
         border: 1px solid #00d8ff22;
@@ -511,7 +528,7 @@
       }
     }
   }
-  .setting-box{
+  .setting-box {
     width: 1170px;
     height: 70px;
     margin: 10px 0;
@@ -520,30 +537,29 @@
     display: flex;
     align-items: center;
     justify-content: space-between;
-    
-    .right-inputs{
+
+    .right-inputs {
       display: flex;
       height: 40px;
       margin-right: 10px;
     }
-    .left-buttons{
+    .left-buttons {
       display: flex;
       height: 40px;
-      
-      .btn{
+
+      .btn {
         margin: 0 10px;
       }
-      
     }
-    .border-clip{
+    .border-clip {
       width: 1px;
       height: 25px;
       border-right: 1px solid #8b8b8b77;
     }
-    .input-title{
+    .input-title {
       width: 80px;
     }
-    .input-box{
+    .input-box {
       width: 200px !important;
       background: transparent !important;
       border-color: #00d8ff44 !important;
@@ -586,24 +602,22 @@
         }
       }
     }
-
   }
-  .is-open{
-    animation: open .5s;
+  .is-open {
+    animation: open 0.5s;
     animation-iteration-count: 1;
     animation-fill-mode: forwards;
     animation-timing-function: ease-in;
-    
   }
-  .is-close{
-    height: 0px; 
+  .is-close {
+    height: 0px;
   }
 
   @keyframes open {
     0% {
       height: 0px;
     }
-    100%{
+    100% {
       height: fit-content;
     }
   }
@@ -612,14 +626,14 @@
     0% {
       height: fit-content;
     }
-    100%{
+    100% {
       height: 0px;
     }
   }
   :deep(.zxm-divider-inner-text) {
     color: #cacaca88 !important;
   }
-  :deep(.zxm-form-item ){
+  :deep(.zxm-form-item) {
     margin-bottom: 10px;
   }
 </style>

+ 2 - 1
src/views/vent/monitorManager/workFaceMonitor/wokeFace.threejs.ts

@@ -9,6 +9,7 @@ let model,
   workFaceObj: WorkFace | undefined,
   group,
   fiberType = 'workFace'; // workerFaceFiber
+
 const { mouseDownFn, mousemoveFn, mouseUpFn } = useEvent();
 
 // 鼠标点击、松开事件
@@ -90,7 +91,7 @@ export const setModelType = (type, n = Math.ceil(Math.random() * 10)) => {
         var newControlsPosition = { x: -0.171622930063528, y: -0.1442344658741759, z: 0.032110784753260874 };
       }
       if (model.scene.getObjectByName('workFace')) {
-        model.camera.position.set(oldCameraPosition.x, oldCameraPosition.y, oldCameraPosition.z+20);
+        model.camera.position.set(oldCameraPosition.x, oldCameraPosition.y, oldCameraPosition.z + 20);
         model.orbitControls.target.set(oldControlsPosition.x, oldControlsPosition.y, oldControlsPosition.z);
       }
       setTimeout(async () => {

+ 4 - 2
src/views/vent/monitorManager/workFaceMonitor/workFace.threejs.base.ts

@@ -8,6 +8,7 @@ import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPa
 import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass.js';
 import { setModalCenter, setTag3D } from '/@/utils/threejs/util';
 import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
+import { gradientColors } from '/@/utils/threejs/util';
 
 // import * as dat from 'dat.gui';
 // const gui = new dat.GUI();
@@ -78,6 +79,7 @@ class WorkFace {
   }
 
   setPlanes = (n, colors = new Array(n).fill(new THREE.Color('rgb(100%, 0%, 0%)'))) => {
+    colors = gradientColors('#00FF2C', '#FF0000', n, 2);
     this.planeNum = n;
     const lenScale = 0.77 / n;
     const planeGeo = new THREE.PlaneGeometry();
@@ -135,8 +137,8 @@ class WorkFace {
     const obj = this.group.getObjectByName(`unitText`);
     if (obj) this.group.remove(obj);
     const element = document.getElementById(`gasUnitBox`) as HTMLElement;
-    if(element){
-      element.remove()
+    if (element) {
+      element.remove();
     }
   };