Browse Source

[Feat 0000] CAD参数更新

houzekong 4 months ago
parent
commit
79dc5ca66c

+ 1 - 1
src/components/CADViewer/src/hooks/useCADViewer.ts

@@ -24,7 +24,7 @@ export default function useCADViewer() {
   /** 调用 api 转换文件格式,并返回转换后文件的网络地址 */
   function processFile(id: string) {
     const close = message.loading('正在转换文件格式,请稍等', 0);
-    return transformCadFile({ id })
+    return transformCadFile({ id, ip: window.location.hostname })
       .then((result) => {
         const filepath = result.replace('/data/file/', '');
         if (import.meta.env.PROD) {

+ 65 - 35
src/views/vent/home/configurable/index.vue

@@ -25,24 +25,24 @@
           <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
             {{ homedata.allMineWarn }}
           </div>
-          <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
+          <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 自燃</div>
         </div>
         <div class="tcontent-r">
-          <div>粉尘</div>
+          <div>火灾</div>
           <div>风险</div>
         </div>
       </div>
     </div>
-    <!-- <div class="right-t">
-      <div class="tcontent-l" @click="redirectTo('https://bing.cn')">
+    <div class="right-t">
+      <div class="tcontent-l" @click="redirectTo('/grout-home')">
         <div>智能</div>
-        <div>浆系统</div>
+        <div>浆系统</div>
       </div>
-      <div class="tcontent-r" @click="redirectTo('https://bing.cn')">
+      <div class="tcontent-r" @click="redirectTo('/nitrogen-home')">
         <div>智能</div>
-        <div>注系统</div>
+        <div>注系统</div>
       </div>
-    </div> -->
+    </div>
     <ModuleBD
       v-for="cfg in configs"
       :key="cfg.deviceType"
@@ -53,9 +53,20 @@
       :visible="true"
       :page-type="pageType"
     />
-    <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
+    <ModuleBDDual
+      :show-style="configA.showStyle"
+      :module-data-a="configA.moduleData"
+      :module-name-a="configA.moduleName"
+      :device-type-a="configA.deviceType"
+      :module-data-b="configB.moduleData"
+      :module-name-b="configB.moduleName"
+      :device-type-b="configB.deviceType"
+      :visible="true"
+      :page-type="pageType"
+    />
+    <div style="width: 1000px; height: 550px; position: absolute; left: calc(50% - 500px); top: 60px">
       <!-- <VentModal /> -->
-      <iframe style="width: 1000px; height: 570px" :src="iframeUrl" ref="frameRef" @load="hideLoading"></iframe>
+      <iframe style="width: 1000px; height: 550px" :src="iframeUrl" ref="frameRef" @load="hideLoading"></iframe>
     </div>
   </div>
 </template>
@@ -65,37 +76,56 @@
   // import MonitorCenter from './components/MonitorCenter.vue';
   // import { useInitConfigs } from './hooks/useInit';
   import ModuleBD from './components/ModuleBD.vue';
-  import { testConfigBDDust } from './configurable.data';
+  import ModuleBDDual from './components/ModuleBDDual.vue';
+  import { testConfigBDFire } from './configurable.data';
   // import VentModal from '/@/components/vent/micro/ventModal.vue';
-  import { getBDDustData } from './configurable.api';
+  import { getBDFireData } from './configurable.api';
   import { getToken } from '/@/utils/auth';
 
+  // import FramePage from '/@/views/sys/iframe/index.vue';
+  const frameRef = ref();
+  const mainTitle = ref('保德煤矿火灾预警系统');
+  const pageType = 'BD_fire';
+  const loading = ref(true);
   const iframeUrl = ref(
     `${location.protocol}//${location.hostname}:8091/dashboard/analysis?type=empty&deviceType=empty&showid=1&token=${getToken()}`
-  );
-  const loading = ref(true);
-  const mainTitle = ref('保德煤矿粉尘灾害预警系统');
-  const pageType = 'BD_dust';
-
+  ); //正式时用 `${location.protocol}//${location.hostname}:8091/url`
+  // const url = ref('http://localhost:8088/');
   // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
 
-  const configs = ref(testConfigBDDust);
+  const configs = ref(
+    testConfigBDFire.filter(({ moduleName }) => {
+      return moduleName !== '工作面光纤监测' && moduleName !== '工作面束管监测';
+    })
+  );
+  const configA = ref<any>(
+    testConfigBDFire.find(({ moduleName }) => {
+      return moduleName === '工作面束管监测';
+    })
+  );
+  const configB = ref<any>(
+    testConfigBDFire.find(({ moduleName }) => {
+      return moduleName === '工作面光纤监测';
+    })
+  );
   // const { configs, fetchConfigs } = useInitConfigs();
-  const homedata = ref<any>({});
   function hideLoading() {
     loading.value = false;
   }
+  const homedata = ref<any>({});
+
   onMounted(() => {
     // configs.value = testConfigB;
-    getBDDustData({}).then((r) => {
+
+    getBDFireData({}).then((r) => {
       homedata.value = r;
     });
     // fetchConfigs(pageType);
   });
 
-  // function redirectTo(url) {
-  //   window.open(url);
-  // }
+  function redirectTo(url) {
+    window.open(url);
+  }
 </script>
 <style lang="less" scoped>
   @font-face {
@@ -173,7 +203,7 @@
   .left-t {
     position: absolute;
     height: 115px;
-    top: 50px;
+    top: 40px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
     background-color: #000723;
@@ -232,7 +262,8 @@
   }
   .right-t {
     position: absolute;
-    height: 160px;
+    // height: 160px;
+    height: 115px;
     right: 0;
     top: 50px;
     width: 450px;
@@ -244,11 +275,12 @@
     display: flex;
     align-items: center;
     justify-content: space-around;
+    z-index: 1;
 
     .tcontent-l {
       flex: 1;
-      height: 70%;
-      font-size: 20px;
+      height: 100%;
+      font-size: 16px;
       font-weight: bold;
       background-image: url(/@/assets/images/home-container/configurable/firehome/img-5.png),
         url(/@/assets/images/home-container/configurable/firehome/ggxt.png);
@@ -260,14 +292,13 @@
         center,
         center top;
       text-align: center;
-      padding-top: 40px;
-      line-height: 50px;
-      cursor: pointer;
+      padding-top: 35px;
+      line-height: 40px;
     }
     .tcontent-r {
       flex: 1;
-      height: 70%;
-      font-size: 20px;
+      height: 100%;
+      font-size: 16px;
       font-weight: bold;
       background-image: url(/@/assets/images/home-container/configurable/firehome/img-5.png),
         url(/@/assets/images/home-container/configurable/firehome/zjxt.png);
@@ -279,9 +310,8 @@
         center,
         center top;
       text-align: center;
-      padding-top: 40px;
-      line-height: 50px;
-      cursor: pointer;
+      padding-top: 35px;
+      line-height: 40px;
     }
   }