Browse Source

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

lxh 4 months ago
parent
commit
a532b02c89

+ 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) {

+ 1 - 1
src/components/CADViewer/src/viewer.api.ts

@@ -2,7 +2,7 @@ import { ContentTypeEnum } from '/@/enums/httpEnum';
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
-  transformCadFile = '/safety/cadFile/transformCadFileType',
+  transformCadFile = '/fileServer/transformCadFileType',
 }
 /**
  * 列表接口

+ 7 - 7
src/views/vent/home/configurable/configurable.data.ts

@@ -970,9 +970,9 @@ export const testConfigBDDust: Config[] = [
       // mock: BDdustMock,
     },
     showStyle: {
-      size: 'width:450px;height:760px;',
+      size: 'width:450px;height:750px;',
       version: '保德',
-      position: 'top:160px;left:0;',
+      position: 'top:170px;left:0;',
     },
   },
   {
@@ -1970,7 +1970,7 @@ export const testConfigBDFire: Config[] = [
       },
       slice: {
         direction: 'column',
-        basis: ['40%', '60%'],
+        basis: ['50%', '50%'],
       },
       layout: ['board', 'complex_list'],
       board: [
@@ -2025,9 +2025,9 @@ export const testConfigBDFire: Config[] = [
       // mock: BDfireMock,
     },
     showStyle: {
-      size: 'width:450px;height:320px;',
+      size: 'width:450px;height:310px;',
       version: '保德',
-      position: 'top:160px;left:0;',
+      position: 'top:170px;left:0;',
     },
   },
   {
@@ -2421,9 +2421,9 @@ export const testConfigBDFire: Config[] = [
       // mock: BDfireMock,
     },
     showStyle: {
-      size: 'width:450px;height:240px;',
+      size: 'width:450px;height:230px;',
       version: '保德',
-      position: 'top:160px;right:0;',
+      position: 'top:170px;right:0;',
     },
   },
   {

+ 2 - 2
src/views/vent/home/configurable/dustBD.vue

@@ -173,7 +173,7 @@
   .left-t {
     position: absolute;
     height: 115px;
-    top: 30px;
+    top: 50px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
     background-color: #000723;
@@ -234,7 +234,7 @@
     position: absolute;
     height: 160px;
     right: 0;
-    top: 40px;
+    top: 50px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
     background-color: #000723;

+ 4 - 4
src/views/vent/home/configurable/fireBD.vue

@@ -64,9 +64,9 @@
       :visible="true"
       :page-type="pageType"
     />
-    <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
+    <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>
@@ -203,7 +203,7 @@
   .left-t {
     position: absolute;
     height: 115px;
-    top: 30px;
+    top: 40px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
     background-color: #000723;
@@ -265,7 +265,7 @@
     // height: 160px;
     height: 115px;
     right: 0;
-    top: 40px;
+    top: 50px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
     background-color: #000723;

+ 18 - 7
src/views/vent/home/configurable/index.vue

@@ -64,8 +64,9 @@
       :visible="true"
       :page-type="pageType"
     />
-    <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
-      <VentModal />
+    <div style="width: 1000px; height: 550px; position: absolute; left: calc(50% - 500px); top: 60px">
+      <!-- <VentModal /> -->
+      <iframe style="width: 1000px; height: 550px" :src="iframeUrl" ref="frameRef" @load="hideLoading"></iframe>
     </div>
   </div>
 </template>
@@ -77,12 +78,19 @@
   import ModuleBD from './components/ModuleBD.vue';
   import ModuleBDDual from './components/ModuleBDDual.vue';
   import { testConfigBDFire } from './configurable.data';
-  import VentModal from '/@/components/vent/micro/ventModal.vue';
+  // import VentModal from '/@/components/vent/micro/ventModal.vue';
   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()}`
+  ); //正式时用 `${location.protocol}//${location.hostname}:8091/url`
+  // const url = ref('http://localhost:8088/');
   // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
 
   const configs = ref(
@@ -101,11 +109,14 @@
     })
   );
   // const { configs, fetchConfigs } = useInitConfigs();
-
+  function hideLoading() {
+    loading.value = false;
+  }
   const homedata = ref<any>({});
 
   onMounted(() => {
     // configs.value = testConfigB;
+
     getBDFireData({}).then((r) => {
       homedata.value = r;
     });
@@ -192,7 +203,7 @@
   .left-t {
     position: absolute;
     height: 115px;
-    top: 30px;
+    top: 40px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
     background-color: #000723;
@@ -254,7 +265,7 @@
     // height: 160px;
     height: 115px;
     right: 0;
-    top: 40px;
+    top: 50px;
     width: 450px;
     background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
     background-color: #000723;

+ 27 - 21
src/views/vent/performance/comment/CADModal.vue

@@ -12,7 +12,7 @@
   >
     <!-- <button @click="mxcadmode = !mxcadmode">Switch Previewer</button> -->
     <div v-if="mxcadmode">
-      <CADViewer v-if="fileid" :id="fileid" :filename="filename" class="w-100%" :height="800" />
+      <CADViewer v-if="fileid" :id="fileid" class="w-100%" :height="800" />
     </div>
     <iframe v-else :src="iframesrc" class="w-100%" :height="800" ref="frameRef"></iframe>
   </BasicModal>
@@ -35,11 +35,17 @@
   import { onMounted } from 'vue';
   import CADViewer from '/@/views/vent/performance/fileDetail/commen/CADViewer.vue';
   // import { useGlobSetting } from '/@/hooks/setting';
-  import { useAutoLogin } from '/@/hooks/vent/useAutoLogin';
-  import { MOCK_LOGIN_UESRNAME } from '/@/store/constant';
+  // import { useAutoLogin } from '/@/hooks/vent/useAutoLogin';
+  // import { MOCK_LOGIN_UESRNAME } from '/@/store/constant';
 
+  defineProps({
+    fileid: {
+      type: String,
+      default: '',
+    },
+  });
   // const { sysOrgCode } = useGlobSetting();
-  const { getUrl } = useAutoLogin();
+  // const { getUrl } = useAutoLogin();
   // 不是布尔台的使用 mxcad 模式,是布尔台的使用 iframe 模式以避免“法律风险”
   // 暂时只允许本地预览模式,是因为认证需要机器码,目前仅在神东公司端有这个认证服务,前端也只有这一个码存好了
   const mxcadmode = ref(true);
@@ -49,29 +55,29 @@
   const iframesrc = ref('');
 
   // CAD预览器 DEMO 02
-  const fileid = ref('');
-  const filename = ref('');
+  // const fileid = ref('');
+  // const filename = ref('');
 
   //表单赋值
   const [registerModal, { setModalProps }] = useModalInner(async ({ record }) => {
     //重置表单
     setModalProps({ confirmLoading: false });
 
-    if (mxcadmode.value) {
-      fileid.value = record.id;
-      filename.value = record.fileName;
-    } else {
-      // 当以 iframe 模式运行时,origin 在生产模式下需要指向本项目公司端所部署的地址
-      const origin = import.meta.env.PROD ? 'http://10.248.235.101:8092' : window.location.origin;
-      // const origin = import.meta.env.DEV ? 'http://182.92.126.35:8092' : window.location.origin;
-      iframesrc.value = getUrl(`${origin}/fileManager/cad-viewer`, {
-        // [SKIP_SSO_URL_QUERY.key]: SKIP_SSO_URL_QUERY.val,
-        id: record.id,
-        filename: record.fileName,
-        workNo: MOCK_LOGIN_UESRNAME,
-      });
-      // iframesrc.value = `${origin}/fileManager/cad-viewer?${SKIP_SSO_URL_QUERY.key}=${SKIP_SSO_URL_QUERY.val}&${MOCK_LOGIN_URL_QUERY.key}=${MOCK_LOGIN_URL_QUERY.val}&id=${record.id}&filename=${record.fileName}`;
-    }
+    // if (mxcadmode.value) {
+    //   fileid.value = record.id;
+    //   filename.value = record.fileName;
+    // } else {
+    //   // 当以 iframe 模式运行时,origin 在生产模式下需要指向本项目公司端所部署的地址
+    //   const origin = import.meta.env.PROD ? 'http://10.248.235.101:8092' : window.location.origin;
+    //   // const origin = import.meta.env.DEV ? 'http://182.92.126.35:8092' : window.location.origin;
+    //   iframesrc.value = getUrl(`${origin}/fileManager/cad-viewer`, {
+    //     // [SKIP_SSO_URL_QUERY.key]: SKIP_SSO_URL_QUERY.val,
+    //     id: record.id,
+    //     filename: record.fileName,
+    //     workNo: MOCK_LOGIN_UESRNAME,
+    //   });
+    //   // iframesrc.value = `${origin}/fileManager/cad-viewer?${SKIP_SSO_URL_QUERY.key}=${SKIP_SSO_URL_QUERY.val}&${MOCK_LOGIN_URL_QUERY.key}=${MOCK_LOGIN_URL_QUERY.val}&id=${record.id}&filename=${record.fileName}`;
+    // }
   });
 
   onMounted(() => {});

+ 1 - 1
src/views/vent/performance/comment/NormalTable.vue

@@ -21,7 +21,7 @@
       </template>
     </BasicTable>
     <DeviceModal :editID="editID" :fileType="fileType" @register="registerDeviceModal" />
-    <CADModal @register="registerCADModal" />
+    <CADModal :fileid="editID" @register="registerCADModal" />
     <!-- 审批-提交弹窗 -->
     <a-modal v-model:visible="visibleTj" centered :width="600" title="提交文件" @ok="handleTjOk" @cancel="handleTjCancel">
       <a-form :model="formStateTj" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">

+ 0 - 2
src/views/vent/performance/fileDetail/commen/CADViewer.vue

@@ -6,7 +6,6 @@
   import { onMounted, onUnmounted } from 'vue';
   import { CADViewer, useCADViewer } from '/@/components/CADViewer';
   import { useRoute } from 'vue-router';
-  import { useGlobSetting } from '/@/hooks/setting';
 
   const props = defineProps<{
     // 文件共享中心中该文件的ID
@@ -39,7 +38,6 @@
   // let initByRoute = false;
 
   onMounted(() => {
-    console.log(useGlobSetting());
     const route = useRoute();
     if (route.query.id && route.query.filename) {
       // initByRoute = true;