|
@@ -30,19 +30,19 @@ const getMenuList = () => {
|
|
|
// path: '/dashboard'
|
|
// path: '/dashboard'
|
|
|
// },
|
|
// },
|
|
|
// {
|
|
// {
|
|
|
- // index: 2,
|
|
|
|
|
|
|
+ // index: '2',
|
|
|
// label: 'Booking',
|
|
// label: 'Booking',
|
|
|
// icon: 'icon_booking__fill_b',
|
|
// icon: 'icon_booking__fill_b',
|
|
|
// path: '/booking'
|
|
// path: '/booking'
|
|
|
// },
|
|
// },
|
|
|
// {
|
|
// {
|
|
|
- // index: 3,
|
|
|
|
|
|
|
+ // index: '3',
|
|
|
// label: 'Tracking',
|
|
// label: 'Tracking',
|
|
|
// icon: 'icon_tracking__fill_b',
|
|
// icon: 'icon_tracking__fill_b',
|
|
|
// path: '/tracking'
|
|
// path: '/tracking'
|
|
|
// },
|
|
// },
|
|
|
// {
|
|
// {
|
|
|
- // index: 4,
|
|
|
|
|
|
|
+ // index: '4',
|
|
|
// label: 'System Management',
|
|
// label: 'System Management',
|
|
|
// icon: 'icon_system__management_fill_b',
|
|
// icon: 'icon_system__management_fill_b',
|
|
|
// type: 'list',
|
|
// type: 'list',
|
|
@@ -82,6 +82,15 @@ handler()
|
|
|
|
|
|
|
|
const activeMenu = ref()
|
|
const activeMenu = ref()
|
|
|
activeMenu.value = (route.meta?.activeMenu as string) || route.path
|
|
activeMenu.value = (route.meta?.activeMenu as string) || route.path
|
|
|
|
|
+// 默认展开的菜单
|
|
|
|
|
+const openeds = computed(() => {
|
|
|
|
|
+ if (!activeMenu.value) return []
|
|
|
|
|
+ const parentItem = menuList.value?.find((item: any) =>
|
|
|
|
|
+ item.children?.some((child: any) => child.path === activeMenu.value)
|
|
|
|
|
+ )
|
|
|
|
|
+ console.log(parentItem, 'item')
|
|
|
|
|
+ return parentItem ? [parentItem.index] : []
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
// 未登录白名单
|
|
// 未登录白名单
|
|
|
const whiteList = ['/login', '/public-tracking', '/public-tracking/detail', '/reset-password']
|
|
const whiteList = ['/login', '/public-tracking', '/public-tracking/detail', '/reset-password']
|
|
@@ -170,6 +179,8 @@ const jumpLink = (link: string) => {
|
|
|
class="layout-menu"
|
|
class="layout-menu"
|
|
|
@select="changeRouter"
|
|
@select="changeRouter"
|
|
|
:default-active="activeMenu"
|
|
:default-active="activeMenu"
|
|
|
|
|
+ :default-openeds="openeds"
|
|
|
|
|
+ :unique-opened="true"
|
|
|
:collapse="isCollapse"
|
|
:collapse="isCollapse"
|
|
|
>
|
|
>
|
|
|
<template v-for="item in menuList" :key="item.index">
|
|
<template v-for="item in menuList" :key="item.index">
|
|
@@ -183,7 +194,7 @@ const jumpLink = (link: string) => {
|
|
|
<span class="font_family" :class="[`icon-${item.icon}`]"></span>
|
|
<span class="font_family" :class="[`icon-${item.icon}`]"></span>
|
|
|
<template #title>{{ item.label }}</template>
|
|
<template #title>{{ item.label }}</template>
|
|
|
</el-menu-item>
|
|
</el-menu-item>
|
|
|
- <el-sub-menu v-else :index="item.path">
|
|
|
|
|
|
|
+ <el-sub-menu v-else :index="item.index">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<div class="font_family" style="font-size: 16px" :class="[`icon-${item.icon}`]"></div>
|
|
<div class="font_family" style="font-size: 16px" :class="[`icon-${item.icon}`]"></div>
|
|
|
<span>{{ item.label }}</span>
|
|
<span>{{ item.label }}</span>
|