Selaa lähdekoodia

✨ feat: 智能注气视频中心跳转

Zimo 10 tuntia sitten
vanhempi
commit
cc2578330a

+ 12 - 1
src/layout/components/Menu/src/components/useRenderMenuItem.tsx

@@ -17,7 +17,18 @@ export const useRenderMenuItem = () =>
           if (currentSource === 'zhly') {
             return (
               !v.meta?.hidden &&
-              ['智慧连油', '连油11监控', '监控查询', '视频告警', '分屏管理','告警配置'].includes(v.meta?.title)
+              ['智慧连油', '连油监控', '监控查询', '视频告警', '分屏管理', '告警配置'].includes(
+                v.meta?.title
+              )
+            )
+          } else if (currentSource === 'znzq') {
+            return !v.meta?.hidden && ['设备成套监控'].includes(v.meta?.title)
+          } else if (currentSource === 'spzx') {
+            return (
+              !v.meta?.hidden &&
+              ['协议管理', '产品分类', '产品管理', '视频设备', '视频配置', '通道管理'].includes(
+                v.meta?.title
+              )
             )
           } else {
             return !v.meta?.hidden

+ 1 - 1
src/layout/components/TagsView/src/TagsView.vue

@@ -33,7 +33,7 @@ const route = useRoute()
 
 const routers = computed(() => {
   const currentSource = sessionStorage.getItem('LOGIN_SOURCE') || route.query.source
-  return currentSource === 'zhly'
+  return currentSource
     ? permissionStore.getRouters.filter((item) => item.path !== '/')
     : permissionStore.getRouters
 })

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

@@ -9,6 +9,13 @@ export const filterAffixTags = (routes: AppRouteRecordRaw[], parentPath = '') =>
     const currentSource = sessionStorage.getItem('LOGIN_SOURCE')
     if (currentSource === 'zhly' && tagPath === '/oli-connection/monitoring') {
       route.meta.affix = true
+    } else if (
+      currentSource === 'znzq' &&
+      tagPath === '/iotdayilyreport/IotRyXjDailyReport/summary'
+    ) {
+      route.meta.affix = true
+    } else if (currentSource === 'spzx' && tagPath === '/video_center/protocol') {
+      route.meta.affix = true
     }
     if (meta?.affix) {
       tags.push({ ...route, path: tagPath, fullPath: tagPath } as RouteLocationNormalizedLoaded)

+ 11 - 1
src/permission.ts

@@ -98,11 +98,21 @@ router.beforeEach(async (to, from, next) => {
 
       authUtil.setToken(res)
       const source = to.query.source
-      if (source) {
+      if (source && source === 'zhly') {
         sessionStorage.setItem('LOGIN_SOURCE', source as string)
         next({ path: '/oli-connection/monitoring' })
       }
 
+      if (source && source === 'znzq') {
+        sessionStorage.setItem('LOGIN_SOURCE', source as string)
+        next({ path: '/iotdayilyreport/IotRyXjDailyReport/summary' })
+      }
+
+      if (source && source === 'spzx') {
+        sessionStorage.setItem('LOGIN_SOURCE', source as string)
+        next({ path: '/video_center/protocol' })
+      }
+
       next({ path: '/' })
     } else {
       // 获取所有字典

+ 1 - 1
src/views/Error/404.vue

@@ -1,5 +1,5 @@
 <template>
-  <Error :show-button="source !== 'zhly'" @error-click="push('/')" />
+  <Error :show-button="!source" @error-click="push('/')" />
 </template>
 <script lang="ts" setup>
 defineOptions({ name: 'Error404' })