KouJin 1 anno fa
parent
commit
86b3e8af81
2 ha cambiato i file con 57 aggiunte e 14 eliminazioni
  1. 27 14
      src/layout/components/Menu/src/Menu.vue
  2. 30 0
      src/router/modules/remaining.ts

+ 27 - 14
src/layout/components/Menu/src/Menu.vue

@@ -1,17 +1,26 @@
1 1
 <script lang="tsx">
2
-import { PropType } from 'vue'
3
-import { ElMenu, ElScrollbar } from 'element-plus'
4
-import { useAppStore } from '@/store/modules/app'
5
-import { usePermissionStore } from '@/store/modules/permission'
6
-import { useRenderMenuItem } from './components/useRenderMenuItem'
7
-import { isUrl } from '@/utils/is'
8
-import { useDesign } from '@/hooks/web/useDesign'
9
-import { LayoutType } from '@/types/layout'
2
+import {PropType} from 'vue'
3
+import {ElMenu, ElScrollbar} from 'element-plus'
4
+import {useAppStore} from '@/store/modules/app'
5
+import {usePermissionStore} from '@/store/modules/permission'
6
+import {useRenderMenuItem} from './components/useRenderMenuItem'
7
+import {isUrl} from '@/utils/is'
8
+import {useDesign} from '@/hooks/web/useDesign'
9
+import {LayoutType} from '@/types/layout'
10 10
 
11
-const { getPrefixCls } = useDesign()
11
+const {getPrefixCls} = useDesign()
12 12
 
13 13
 const prefixCls = getPrefixCls('menu')
14
-
14
+let openWindowList = [
15
+  '/display/cf',
16
+  '/display/kq',
17
+  '/display/ksh'
18
+];
19
+const toPath = {
20
+  '/display/cf': '/DataVisualizationInitcf',
21
+  '/display/kq': '/DataVisualizationInitkq',
22
+  '/display/ksh': '/DataVisualizationInitksh',
23
+}
15 24
 export default defineComponent({
16 25
   // eslint-disable-next-line vue/no-reserved-component-names
17 26
   name: 'Menu',
@@ -26,7 +35,7 @@ export default defineComponent({
26 35
 
27 36
     const layout = computed(() => appStore.getLayout)
28 37
 
29
-    const { push, currentRoute } = useRouter()
38
+    const {push, currentRoute} = useRouter()
30 39
 
31 40
     const permissionStore = usePermissionStore()
32 41
 
@@ -50,7 +59,7 @@ export default defineComponent({
50 59
     const uniqueOpened = computed(() => appStore.getUniqueOpened)
51 60
 
52 61
     const activeMenu = computed(() => {
53
-      const { meta, path } = unref(currentRoute)
62
+      const {meta, path} = unref(currentRoute)
54 63
       // if set path, the sidebar will highlight the path you set
55 64
       if (meta.activeMenu) {
56 65
         return meta.activeMenu as string
@@ -66,7 +75,11 @@ export default defineComponent({
66 75
       if (isUrl(index)) {
67 76
         window.open(index)
68 77
       } else {
69
-        push(index)
78
+        if (openWindowList.includes(index)) {
79
+          window.open(toPath[index])
80
+        } else {
81
+          push(index)
82
+        }
70 83
       }
71 84
     }
72 85
 
@@ -99,7 +112,7 @@ export default defineComponent({
99 112
         >
100 113
           {{
101 114
             default: () => {
102
-              const { renderMenuItem } = useRenderMenuItem(unref(menuMode))
115
+              const {renderMenuItem} = useRenderMenuItem(unref(menuMode))
103 116
               return renderMenuItem(unref(routers))
104 117
             }
105 118
           }}

+ 30 - 0
src/router/modules/remaining.ts

@@ -71,6 +71,36 @@ const remainingRouter: AppRouteRecordRaw[] = [
71 71
     ]
72 72
   },
73 73
   {
74
+    path: '/DataVisualizationInitcf',
75
+    component: () => import('@/views/display/cf/index.vue'),
76
+    name: 'DataVisualizationInitcf',
77
+    meta: {
78
+      hidden: true,
79
+      title: '仓房',
80
+      noTagsView: true
81
+    }
82
+  },
83
+  {
84
+    path: '/DataVisualizationInitkq',
85
+    component: () => import('@/views/display/kq/index.vue'),
86
+    name: 'DataVisualizationInitkq',
87
+    meta: {
88
+      hidden: true,
89
+      title: '库区',
90
+      noTagsView: true
91
+    }
92
+  },
93
+  {
94
+    path: '/DataVisualizationInitksh',
95
+    component: () => import('@/views/display/ksh/index.vue'),
96
+    name: 'DataVisualizationInitksh',
97
+    meta: {
98
+      hidden: true,
99
+      title: '库区2',
100
+      noTagsView: true
101
+    }
102
+  },
103
+  {
74 104
     path: '/user',
75 105
     component: Layout,
76 106
     name: 'UserInfo',