|
|
@@ -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
|
}}
|