|
@@ -65,8 +65,8 @@
|
|
|
@onSelect="onSelect"
|
|
|
/>
|
|
|
<!-- 顶部菜单布局 -->
|
|
|
- <SingleWindowMenu
|
|
|
- v-else-if="layout === layoutEnum.SINGLEWINDOW"
|
|
|
+ <LeftMenu
|
|
|
+ v-else-if="layout === layoutEnum.LEFT"
|
|
|
:layout="layout"
|
|
|
:menuList="menuList"
|
|
|
:menu="menu"
|
|
@@ -101,7 +101,7 @@
|
|
|
import ClassicalMenu from '@/layout/menu/classicalMenu.vue'
|
|
|
import DoubleRowMenu from '@/layout/menu/doubleRowMenu.vue'
|
|
|
import TopMenu from '@/layout/menu/topMenu.vue'
|
|
|
- import SingleWindowMenu from '@/layout/menu/singleWindowMenu.vue'
|
|
|
+ import LeftMenu from '@/layout/menu/leftMenu.vue'
|
|
|
|
|
|
const store = globalStore()
|
|
|
const kStore = keepAliveStore()
|
|
@@ -186,7 +186,7 @@
|
|
|
active = traverseChild(pMenu.value.children, active).path
|
|
|
}
|
|
|
selectedKeys.value = new Array(active)
|
|
|
- const pidKey = getParentKeys(pMenu.value.children, active)
|
|
|
+ const pidKey = getParentKeys(layout.value === layoutEnum.LEFT ? [pMenu.value] : pMenu.value.children, active)
|
|
|
// 判断是隐藏的路由,找其上级
|
|
|
if (route.meta.hidden && pidKey) {
|
|
|
if (pidKey.length > 1) {
|
|
@@ -194,22 +194,25 @@
|
|
|
}
|
|
|
}
|
|
|
const nextTickMenu = pMenu.value.children
|
|
|
- if (pidKey) {
|
|
|
- const modelPidKey = getParentKeys(moduleMenu.value, route.path)
|
|
|
- moduleMenu.value.forEach((item) => {
|
|
|
- if (modelPidKey.includes(item.path)) {
|
|
|
- tagSwitchModule(item.id)
|
|
|
- }
|
|
|
- })
|
|
|
- const parentPath = pidKey[pidKey.length - 1]
|
|
|
- if (layout.value === layoutEnum.DOUBLEROW) {
|
|
|
- // 这一串操作下来只为取到最上面的路由的孩子们,最后成为双排菜单的第二排
|
|
|
- const nextMenuTemp = nextTickMenu.filter((item) => item.path === parentPath)[0].children
|
|
|
- if (nextMenuTemp) {
|
|
|
- nextMenu.value = nextTickMenu.filter((item) => item.path === parentPath)[0].children
|
|
|
+ if (layout.value !== layoutEnum.LEFT) {
|
|
|
+ if (pidKey) {
|
|
|
+ const modelPidKey = getParentKeys(moduleMenu.value, route.path)
|
|
|
+ moduleMenu.value.forEach((item) => {
|
|
|
+ if (modelPidKey.includes(item.path)) {
|
|
|
+ tagSwitchModule(item.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const parentPath = pidKey[pidKey.length - 1]
|
|
|
+ if (layout.value === layoutEnum.DOUBLEROW) {
|
|
|
+ // 这一串操作下来只为取到最上面的路由的孩子们,最后成为双排菜单的第二排
|
|
|
+ const nextMenuTemp = nextTickMenu.filter((item) => item.path === parentPath)[0].children
|
|
|
+ if (nextMenuTemp) {
|
|
|
+ nextMenu.value = nextTickMenu.filter((item) => item.path === parentPath)[0].children
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (!onSelectTag.value || sideUniqueOpen.value) {
|
|
|
openKeys.value = pidKey
|
|
|
}
|
|
@@ -223,17 +226,21 @@
|
|
|
// 执行-start
|
|
|
moduleMenu.value = router.getMenu()
|
|
|
// 获取缓存中的菜单模块是哪个
|
|
|
- const menuModuleId = tool.data.get('SNOWY_MENU_MODULE_ID')
|
|
|
- if (menuModuleId) {
|
|
|
- // 防止切换一个无此应用的人
|
|
|
- const module = router.getMenu().filter((item) => item.id === menuModuleId)
|
|
|
- if (module.length > 0) {
|
|
|
- menu.value = module[0].children
|
|
|
+ if (layout.value === layoutEnum.LEFT) {
|
|
|
+ menu.value = router.getMenu()
|
|
|
+ } else {
|
|
|
+ const menuModuleId = tool.data.get('SNOWY_MENU_MODULE_ID')
|
|
|
+ if (menuModuleId) {
|
|
|
+ // 防止切换一个无此应用的人
|
|
|
+ const module = router.getMenu().filter((item) => item.id === menuModuleId)
|
|
|
+ if (module.length > 0) {
|
|
|
+ menu.value = module[0].children
|
|
|
+ } else {
|
|
|
+ menu.value = router.getMenu()[0].children
|
|
|
+ }
|
|
|
} else {
|
|
|
menu.value = router.getMenu()[0].children
|
|
|
}
|
|
|
- } else {
|
|
|
- menu.value = router.getMenu()[0].children
|
|
|
}
|
|
|
showThis()
|
|
|
onMounted(() => {
|