Explorar el Código

🐞 fix: 连油跳转固定连油监控

Zimo hace 1 día
padre
commit
8f1d67bc2d

+ 9 - 2
src/layout/components/TagsView/src/TagsView.vue

@@ -1,5 +1,5 @@
 <script lang="ts" setup>
-import { computed, nextTick, onMounted, ref, unref, watch } from 'vue'
+import { computed, nextTick, ref, unref, watch } from 'vue'
 import type { RouteLocationNormalizedLoaded, RouterLinkProps } from 'vue-router'
 import { useRouter } from 'vue-router'
 import { usePermissionStore } from '@/store/modules/permission'
@@ -29,7 +29,14 @@ const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage }
 
 const permissionStore = usePermissionStore()
 
-const routers = computed(() => permissionStore.getRouters)
+const route = useRoute()
+
+const routers = computed(() => {
+  const currentSource = sessionStorage.getItem('LOGIN_SOURCE') || route.query.source
+  return currentSource === 'zhly'
+    ? permissionStore.getRouters.filter((item) => item.path !== '/')
+    : permissionStore.getRouters
+})
 
 const tagsViewStore = useTagsViewStore()
 

+ 4 - 0
src/layout/components/TagsView/src/helper.ts

@@ -6,6 +6,10 @@ export const filterAffixTags = (routes: AppRouteRecordRaw[], parentPath = '') =>
   routes.forEach((route) => {
     const meta = route.meta as RouteMeta
     const tagPath = pathResolve(parentPath, route.path)
+    const currentSource = sessionStorage.getItem('LOGIN_SOURCE')
+    if (currentSource === 'zhly' && tagPath === '/oli-connection/monitoring') {
+      route.meta.affix = true
+    }
     if (meta?.affix) {
       tags.push({ ...route, path: tagPath, fullPath: tagPath } as RouteLocationNormalizedLoaded)
     }