|
@@ -22,7 +22,7 @@ const props = defineProps({
|
|
default: ''
|
|
default: ''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
+const router = useRouter();
|
|
const onlyOneChild = ref({});
|
|
const onlyOneChild = ref({});
|
|
|
|
|
|
function hasOneShowingChild(children = [], parent) {
|
|
function hasOneShowingChild(children = [], parent) {
|
|
@@ -79,17 +79,30 @@ function getIconPath (iconName) {
|
|
const whitelist = ['workbench', 'call', 'notice', 'analyse','services', 'whiteList'];
|
|
const whitelist = ['workbench', 'call', 'notice', 'analyse','services', 'whiteList'];
|
|
return whitelist.includes(iconName) ? iconName + '-active' : iconName;
|
|
return whitelist.includes(iconName) ? iconName + '-active' : iconName;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function toPage(path) {
|
|
|
|
+ if ( path == "/voice/dashboard" ) {
|
|
|
|
+ const { href } = router.resolve({
|
|
|
|
+ path: '/voice/dashboard'
|
|
|
|
+ });
|
|
|
|
+ window.open(href, '_blank');
|
|
|
|
+ } else {
|
|
|
|
+ router.push(path)
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
<li v-if="!item.hidden" class="menu-item__inner">
|
|
<li v-if="!item.hidden" class="menu-item__inner">
|
|
<template v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
|
<template v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
|
- <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
|
+ <!-- <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> -->
|
|
|
|
+ <div v-if="onlyOneChild.meta" @click="toPage(resolvePath(onlyOneChild.path, onlyOneChild.query))">
|
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
|
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" v-show="activeKey !== resolvePath(onlyOneChild.path)"/>
|
|
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" v-show="activeKey !== resolvePath(onlyOneChild.path)"/>
|
|
<svg-icon :icon-class="getIconPath(onlyOneChild.meta.icon || (item.meta && item.meta.icon))" v-show="activeKey == resolvePath(onlyOneChild.path)"/>
|
|
<svg-icon :icon-class="getIconPath(onlyOneChild.meta.icon || (item.meta && item.meta.icon))" v-show="activeKey == resolvePath(onlyOneChild.path)"/>
|
|
<template #title><span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span></template>
|
|
<template #title><span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span></template>
|
|
</el-menu-item>
|
|
</el-menu-item>
|
|
- </app-link>
|
|
+ </div>
|
|
|
|
+ <!-- </app-link> -->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
|
|
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
|