hongrunxia 1 year ago
parent
commit
8edcbd5735

+ 22 - 0
src/components/vent/micro/needAir.vue

@@ -0,0 +1,22 @@
+<template>
+  <div id="micro-need-air"></div>
+</template>
+<script lang="ts">
+  import { onMounted, onBeforeUnmount, defineComponent } from 'vue'
+  import { unmountMicroApps, mountMicroApp } from '/@/qiankun'
+  import { resetMicroContentWH } from '/@/utils/domUtils';
+  export default defineComponent({
+    name: 'NeedAir',
+    setup() {
+      onMounted(() => {
+        mountMicroApp('/micro-need-air')
+        resetMicroContentWH('micro-need-air')
+      })
+
+      onBeforeUnmount(async () => {
+        unmountMicroApps(['/micro-need-air'])
+      })
+    }
+  })
+</script>
+<style lang="less" scoped></style>

+ 24 - 0
src/components/vent/micro/ventModal.vue

@@ -0,0 +1,24 @@
+<template>
+  <div id="vent-model"></div>
+</template>
+<script lang="ts" >
+
+  import { onMounted, onBeforeUnmount, defineComponent } from 'vue';
+  import { unmountMicroApps, mountMicroApp } from '/@/qiankun';
+  import { resetMicroContentWH } from '/@/utils/domUtils';
+
+  export default defineComponent({
+    name: 'VentModel',
+    setup() {
+      onMounted(() => {
+        mountMicroApp('/micro-vent-3dModal')
+        resetMicroContentWH('vent-model')
+      })
+
+      onBeforeUnmount(async () => {
+        unmountMicroApps(['/micro-vent-3dModal'])
+      })
+    }
+  })
+</script>
+<style lang="less" scoped></style>

+ 1 - 1
src/router/constant.ts

@@ -12,7 +12,7 @@ export const QIANKUN_ROUTE_OUTER_NAME = 'MicroAppOuter';
 export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue');
 // export const EXCEPTION_COMPONENT = () => import('/@/views/vent/monitorManager/mainFanMonitor/index.vue');
 
-export const QIANKUN_COMPONENT = () => import('/@/views/sys/micro/index.vue');
+export const QIANKUN_COMPONENT = () => import('/@/components/vent/micro/ventModal.vue');
 
 /**
  * @description: default layout

+ 0 - 1
src/router/guard/permissionGuard.ts

@@ -197,7 +197,6 @@ export function createPermissionGuard(router: Router) {
         next();
       }
     }
-
     if (permissionStore.getIsDynamicAddedRoute) {
       // mountMicroApp(to.path);
       next();

+ 25 - 9
src/router/helper/routeHelper.ts

@@ -5,16 +5,18 @@ import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '/@/router/constant
 import { cloneDeep, omit } from 'lodash-es';
 import { warn } from '/@/utils/log';
 import { createRouter, createWebHashHistory } from 'vue-router';
-import { getTenantId, getToken } from "/@/utils/auth";
+import { getTenantId, getToken } from '/@/utils/auth';
 import { URL_HASH_TAB, _eval } from '/@/utils';
 //引入online lib路由
 import { packageViews } from '/@/utils/monorepo/dynamicRouter';
-import {useI18n} from "/@/hooks/web/useI18n";
+import { useI18n } from '/@/hooks/web/useI18n';
 
 export type LayoutMapKey = 'LAYOUT';
 const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue');
 // const IFRAME = () => import('/@/views/sys/iframe/index.vue');
 const LayoutContent = () => import('/@/layouts/default/content/index.vue');
+const QIANKUN_NEED_AIR = () => import('/@/components/vent/micro/needAir.vue');
+const QIANKUN_VENT_MODAL = () => import('/@/components/vent/micro/ventModal.vue');
 
 const LayoutMap = new Map<string, () => Promise<typeof import('*.vue')>>();
 
@@ -22,25 +24,27 @@ LayoutMap.set('LAYOUT', LAYOUT);
 LayoutMap.set('IFRAME', IFRAME);
 //微前端qiankun
 LayoutMap.set('LayoutsContent', LayoutContent);
-
+LayoutMap.set('VENTMODAL', QIANKUN_VENT_MODAL);
+LayoutMap.set('NEEDAIR', QIANKUN_NEED_AIR);
 
 let dynamicViewsModules: Record<string, () => Promise<Recordable>>;
+let microViews: Record<string, () => Promise<Recordable>>;
 
 // Dynamic introduction
 function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
   if (!dynamicViewsModules) {
+    microViews = import.meta.glob('../../components/vent/micro/**/*.{vue,tsx}');
     dynamicViewsModules = import.meta.glob('../../views/**/*.{vue,tsx}');
     //合并online lib路由
-    dynamicViewsModules = Object.assign({}, dynamicViewsModules, packageViews);
+    dynamicViewsModules = Object.assign({}, dynamicViewsModules, packageViews, microViews);
   }
   if (!routes) return;
   routes.forEach((item) => {
-
     //【jeecg-boot/issues/I5N2PN】左侧动态菜单怎么做国际化处理  2022-10-09
     //菜单支持国际化翻译
     if (item?.meta?.title) {
       const { t } = useI18n();
-      if(item.meta.title.includes('t(\'') && t){
+      if (item.meta.title.includes("t('") && t) {
         // update-begin--author:liaozhiyang---date:20230906---for:【QQYUN-6390】eval替换成new Function,解决build警告
         item.meta.title = new Function('t', `return ${item.meta.title}`)(t);
         // update-end--author:liaozhiyang---date:20230906---for:【QQYUN-6390】eval替换成new Function,解决build警告
@@ -63,7 +67,10 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
     let tenantId = getTenantId();
     // URL支持{{ window.xxx }}占位符变量
     //update-begin---author:wangshuai ---date:20220711  for:[VUEN-1638]菜单tenantId需要动态生成------------
-    item.component = (item.component || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => _eval(s2)).replace('${token}', token).replace('${tenantId}', tenantId);
+    item.component = (item.component || '')
+      .replace(/{{([^}}]+)?}}/g, (s1, s2) => _eval(s2))
+      .replace('${token}', token)
+      .replace('${tenantId}', tenantId);
     //update-end---author:wangshuai ---date:20220711  for:[VUEN-1638]菜单tenantId需要动态生成------------
     // 适配 iframe
     if (/^\/?http(s)?/.test(item.component as string)) {
@@ -91,6 +98,7 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
     if (component) {
       const layoutFound = LayoutMap.get(component.toUpperCase());
       if (layoutFound) {
+        console.log('6666666666666666', layoutFound, component);
         item.component = layoutFound;
       } else {
         // update-end--author:zyf---date:20220307--for:VUEN-219兼容后台返回动态首页,目的适配跟v2版本配置一致 --------
@@ -108,12 +116,18 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
     }
     children && asyncImportRoute(children);
   });
+  console.log('------------------------>', routes);
 }
 
 function dynamicImport(dynamicViewsModules: Record<string, () => Promise<Recordable>>, component: string) {
   const keys = Object.keys(dynamicViewsModules);
   const matchKeys = keys.filter((key) => {
-    const k = key.replace('../../views', '');
+    let k = '';
+    if (key.startsWith('../../components')) {
+      k = key.replace('../../components', '');
+    } else {
+      k = key.replace('../../views', '');
+    }
     const startFlag = component.startsWith('/');
     const endFlag = component.endsWith('.vue') || component.endsWith('.tsx');
     const startIndex = startFlag ? 0 : 1;
@@ -231,8 +245,9 @@ export function addSlashToRouteComponent(routeList: AppRouteRecordRaw[]) {
   routeList.forEach((route) => {
     if (route.path.startsWith('/subSysmodal')) {
       route.path = '/micro-vent-3dModal' + route.path;
-      route.component = 'layouts/default/index';
+      route.component = 'VENTMODAL';
     }
+
     let component = route.component as string;
     if (component) {
       const layoutFound = LayoutMap.get(component);
@@ -242,5 +257,6 @@ export function addSlashToRouteComponent(routeList: AppRouteRecordRaw[]) {
     }
     route.children && addSlashToRouteComponent(route.children);
   });
+  console.log('9999999999999999999999999999>', routeList);
   return routeList as unknown as T[];
 }

+ 19 - 13
src/views/monitor/quartz/index.vue

@@ -21,18 +21,26 @@
         </a-dropdown>
       </template>
       <template #action="{ record }">
-        <TableAction :actions="getActions(record)" :dropDownActions="getDropDownAction(record)"/>
+        <div class="vent-row-center">
+          <a-popconfirm
+            v-if="record.status == -1"
+            title="是否启动选中任务?"
+            @confirm="handlerResume(record)"
+            style="display: inline-block"
+          >
+            <a class="table-action-link">启动</a>
+          </a-popconfirm>
+          <a-popconfirm
+            v-if="record.status == 0"
+            title="是否暂停选中任务?"
+            @confirm="handlerPause(record)"
+            style="display: inline-block"
+          >
+            <a class="table-action-link">停止</a>
+          </a-popconfirm>
+          <TableAction :dropDownActions="getDropDownAction(record)"/>
+        </div>
       </template>
-      <!-- <template #action="{ record }">
-        <a class="table-action-link" @click="handleEdit(record)">编辑</a>
-        <a-popconfirm
-          title="确定删除?"
-          @confirm="handleDelete(record)"
-        >
-          <a class="table-action-link">删除</a>
-        </a-popconfirm>
-        <slot name="action" v-bind="{ record }"></slot>
-      </template> -->
     </BasicTable>
     <QuartzModal @register="registerModal" @success="reload" />
   </div>
@@ -168,7 +176,6 @@
    * 暂停
    */
   async function handlerPause(record) {
-    debugger;
     await pauseJob({ id: record.id }, reload);
   }
 
@@ -176,7 +183,6 @@
    * 启动
    */
   async function handlerResume(record) {
-    debugger;
     await resumeJob({ id: record.id }, reload);
   }
 

+ 0 - 2
src/views/monitor/quartz/quartz.api.ts

@@ -63,7 +63,6 @@ export const deleteQuartz = (params, handleSuccess) => {
  * @param params
  */
 export const resumeJob = (params, handleSuccess) => {
-  debugger;
   return defHttp.get({ url: Api.resume, params }).then(() => {
     handleSuccess();
   });
@@ -74,7 +73,6 @@ export const resumeJob = (params, handleSuccess) => {
  * @param params
  */
 export const pauseJob = (params, handleSuccess) => {
-  debugger;
   return defHttp.get({ url: Api.pause, params }).then(() => {
     handleSuccess();
   });

+ 5 - 6
src/views/vent/home/colliery/index.vue

@@ -41,7 +41,7 @@
             </div>
             <div class="three-modal" id="modalBox" style="position: relative;">
               <div class="btn-icon" @click="goModalDetail"></div>
-              <div id="vent-model" style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute"></div>
+              <VentModal  style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute"/>
             </div>
           </div>
           <!-- 风量监测 -->
@@ -68,7 +68,7 @@
     <!-- <DeviceMonitor :pageType="pageType" @goHome="goHome" /> -->
 
   </div>
-  <div v-else id="vent-model" style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute"></div>
+  <VentModal  v-else style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute"/>
 </template>
 <script lang="ts" setup>
 import { reactive, onMounted, ref, nextTick, computed, unref, inject, onBeforeUnmount, onUnmounted } from 'vue';
@@ -89,8 +89,10 @@ import { router } from '/@/router';
 import moment from 'moment';
 import { getActions } from '/@/qiankun/state';
 import { unmountMicroApps, mountMicroApp } from '/@/qiankun'
-import { resetMicroContentWH } from '/@/utils/domUtils'
+
 import { getDate } from './clique.data'
+import VentModal from '/@/components/vent/micro/ventModal.vue'
+
 
 const { currentRoute } = useRouter();
 const { title, logoUrl } = useGlobSetting();
@@ -269,7 +271,6 @@ onMounted(() => {
   if (currentRouteObj && currentRouteObj['query'] && currentRouteObj['query']['deviceType']) {
     pageType.value = 'model3D'
   }
-  mountMicroApp('/micro-vent-3dModal', '/modelchannel/model3D/home')
   getNowTime()
   getList();
   timer = Number(
@@ -277,10 +278,8 @@ onMounted(() => {
       getList();
     }, 10000)
   );
-  resetMicroContentWH('vent-model')
 });
 onBeforeUnmount(() => {
-  unmountMicroApps(['/micro-vent-3dModal'])
   actions.setGlobalState({ url: { path: '', query: {} } });
   clearInterval(timer);
   timer = null

+ 0 - 18
src/views/vent/home/needAir.vue

@@ -1,18 +0,0 @@
-<template>
-  <div id="micro-need-air"></div>
-</template>
-<script lang="ts" setup>
-
-import { onMounted, onBeforeUnmount } from 'vue'
-import { unmountMicroApps, mountMicroApp } from '/@/qiankun'
-
-onMounted(() => {
-  mountMicroApp('/micro-need-air')
-})
-
-onBeforeUnmount(async () => {
-  unmountMicroApps(['/micro-need-air'])
-})
-
-</script>
-<style lang="less" scoped></style>

+ 9 - 9
src/views/vent/monitorManager/alarmMonitor/fire/gasPage.vue

@@ -103,14 +103,14 @@
             list: [
               // { name: '抽采泵流量', val: v.readData.FlowSensor_InputFlux || 0 },
               // { name: '报警状态', val: v.warnLevel || 0 },
-              { name: '输入管道内一氧化碳(ppm)', val: v.readData.coVal || 0 },
-              { name: '管路出口处瓦斯(%CH4)', val: v.readData.gas1 || 0 },
-              { name: '泵站内瓦斯(%CH4)', val: v.readData.gas2 || 0 },
-              { name: '输入管道内瓦斯(%CH4)', val: v.readData.gas3 || 0 },
-              { name: '管道输出瓦斯(%CH4)', val: v.readData.gas4 || 0 },
-              { name: '输入管道内工混流量(m³/min)', val: v.readData.mixedTraffic || 0 },
-              { name: '输入管道内标况流量(m³/min)', val: v.readData.standardTraffic || 0 },
-              { name: '瓦斯抽放量(m³)', val: v.readData.gas4 || 0 },
+              { name: '输入管道内一氧化碳(ppm)', val: v.readData.coVal == 0 || v.readData.coVal ? v.readData.coVal : '-' },
+              { name: '管路出口处瓦斯(%CH4)', val: v.readData.gas1 == 0 || v.readData.gas1 ? v.readData.gas1 : '-'  }, //v.readData.gas1 
+              { name: '泵站内瓦斯(%CH4)', val: v.readData.gas2 == 0 || v.readData.gas2 ? v.readData.gas2 : '-' }, //v.readData.gas2
+              { name: '输入管道内瓦斯(%CH4)', val: v.readData.gas3 == 0 || v.readData.gas3 ? v.readData.gas3 : '-' }, //v.readData.gas3
+              { name: '管道输出瓦斯(%CH4)', val: v.readData.gas4 == 0 || v.readData.gas4 ? v.readData.gas4 : '-' }, //v.readData.gas4
+              { name: '输入管道内工混流量(m³/min)', val: v.readData.mixedTraffic == 0 || v.readData.mixedTraffic ? v.readData.mixedTraffic : '-' }, //v.readData.mixedTraffic
+              { name: '输入管道内标况流量(m³/min)', val: v.readData.standardTraffic == 0 || v.readData.standardTraffic ? v.readData.standardTraffic : '-' }, //v.readData.standardTraffic
+              { name: '瓦斯抽放量(m³)', val: v.readData.totalGasDrainage == 0 || v.readData.totalGasDrainage ? v.readData.totalGasDrainage : '-' },
             ],
           });
         });
@@ -184,7 +184,7 @@
 
           .top-box {
             position: relative;
-            width: 524px;
+            width: 724px;
             height: 276px;
             background: url('../../../../../assets/images/fire/top-area.png') no-repeat center;
             background-size: 100% 100%;

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

@@ -298,6 +298,7 @@ export const haveDetailArr = [
   'fiber',
   'bundletube',
   // 'dusting',
+  'ballvalve',
   'pump',
   'safetymonitor',
   'nitrogen',

+ 1 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -590,7 +590,7 @@ function goDetail(record?) {
     } else if (deviceType.value.startsWith('bundletube')) {
       currentModal.value = BundleModal
       modalVisible.value = true;
-    } else if (deviceType.value.startsWith('BallvalveModal')) {
+    } else if (deviceType.value.startsWith('Ballvalve')) {
       currentModal.value = BallvalveModal
       modalVisible.value = true;
     } else if (deviceType.value.indexOf("gate") != -1) {

+ 2 - 9
src/views/vent/monitorManager/deviceMonitor/index.vue

@@ -3,7 +3,7 @@
     <DeviceVue ref="DeviceRef" v-if="routerParam !== 'home' && routerParam !== 'timesolution' && routerParam !== 'model3D'" :pageData="pageData" />
     <Network ref="NetworkRef" v-if="routerParam === 'timesolution'" :pageResult="pageResult" @changePageType="changePageType"/>
   </div>
-  <div id="vent-model" style="width: 100%; height: 100%; position: absolute"></div>
+  <VentModal style="width: 100%; height: 100%; position: absolute"/>
 </template>
 
 <script setup lang="ts">
@@ -15,6 +15,7 @@ import { useRoute } from 'vue-router';
 import { unmountMicroApps, mountMicroApp } from '/@/qiankun'
 import { onBeforeUnmount } from 'vue';
 import { resetMicroContentWH } from '/@/utils/domUtils'
+import VentModal from '/@/components/vent/micro/ventModal.vue'
 
 const route = useRoute()
 const actions = getActions();
@@ -45,8 +46,6 @@ watch(() => route.fullPath, (fullPath) => {
 
 onMounted(() => {
   const { type, deviceType } = route.query
-  mountMicroApp('/micro-vent-3dModal')
-
   if (type === 'network') {
     routerParam.value = 'network'
     actions.setGlobalState({ pageObj: { pageType: 'network' } });
@@ -75,15 +74,9 @@ onMounted(() => {
     }
   })
 
-  resetMicroContentWH('vent-model')
 })
 
 onBeforeUnmount(async() => {
-  unmountMicroApps(['/micro-vent-3dModal'])
-  const microDom = document.getElementById('vent-model')
-  if(microDom){
-    microDom.innerHTML = ''
-  }
 })
 
 </script>

+ 3 - 1
src/views/vent/monitorManager/deviceMonitor/index1.vue

@@ -2,7 +2,8 @@
   <div class="scene-box" >
     <DeviceVue ref="DeviceRef" :pageData="pageData" />
   </div>
-  <div id="vent-model" style="width: 100%; height: 100%; position: absolute"></div>
+  <VentModal style="width: 100%; height: 100%; position: absolute"/>
+  
 </template>
 
 <script setup lang="ts">
@@ -12,6 +13,7 @@ import Network from './components/network/index.vue'
 import { getActions } from '/@/qiankun/state';
 import { useRoute } from 'vue-router';
 import { onBeforeUnmount } from 'vue';
+import VentModal from '/@/components/vent/micro/ventModal.vue'
 
 
 const route = useRoute()