This commit is contained in:
zlwu committed 2026-05-26 19:04:27 +08:00
1 parent 4a00f21bfb
commit edf88dc016
1503 files changed
+329728 -41987

No files matched your search

+1 -3
View File
@@ -54,9 +54,7 @@ export const useMenuStore = defineStore('menuStore', () => {
*/
const setMenuList = (list: AppRouteRecord[]) => {
menuList.value = list
setHomePath(
HOME_PAGE_PATH || getFirstSecondLevelMenuPath(list) || getFirstMenuPath(list)
)
setHomePath(HOME_PAGE_PATH || getFirstSecondLevelMenuPath(list) || getFirstMenuPath(list))
}
/**
+17 -18
View File
@@ -44,10 +44,7 @@ import { LocationQueryRaw, Router } from 'vue-router'
import { WorkTab } from '@/types'
import { useCommon } from '@/hooks/core/useCommon'
import { useMenuStore } from '@/store/modules/menu'
import {
getFirstSecondLevelMenuPath,
isWorkbenchRoute
} from '@/utils/navigation/route'
import { getFirstSecondLevelMenuPath, isWorkbenchRoute } from '@/utils/navigation/route'
interface WorktabState {
current: Partial<WorkTab>
@@ -94,20 +91,20 @@ export const useWorktabStore = defineStore(
return !tab.fixedTab
}
/**
* 过滤不应展示在 worktab 中的父级占位路由。
* `/system` 仅用于承载与重定向,真实标签页为其子路由(如 `/system/tenant`)。
*/
const shouldIgnoreTab = (tab: Partial<WorkTab>): boolean => {
if (tab.path === '/system') {
return true
/**
* 过滤不应展示在 worktab 中的父级占位路由。
* `/system` 仅用于承载与重定向,真实标签页为其子路由(如 `/system/tenant`)。
*/
const shouldIgnoreTab = (tab: Partial<WorkTab>): boolean => {
if (tab.path === '/system') {
return true
}
if (isWorkbenchRoute(tab.path)) {
return true
}
const title = String(tab.title ?? tab.customTitle ?? '')
return title === '工作台' || title === 'menus.dashboard.console'
}
if (isWorkbenchRoute(tab.path)) {
return true
}
const title = String(tab.title ?? tab.customTitle ?? '')
return title === '工作台' || title === 'menus.dashboard.console'
}
/**
* 标签全部关闭后的默认落点:侧栏第一个二级菜单(无则回退首页路径)
@@ -474,7 +471,9 @@ export const useWorktabStore = defineStore(
}
// 过滤出有效的标签页
const validTabs = opened.value.filter((tab) => !shouldIgnoreTab(tab) && isTabRouteValid(tab))
const validTabs = opened.value.filter(
(tab) => !shouldIgnoreTab(tab) && isTabRouteValid(tab)
)
if (validTabs.length !== opened.value.length) {
console.warn('发现无效的标签页路由,已自动清理')