feat: add portal home launcher, favorites UI, and WorkTab overflow eviction
Replace top-bar module navigation with a card home page, persist favorites via API, reopen favorite tabs on cold login, and enable portal multi-tabs with overflow-based eviction. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7898d65437
commit
2df2ef0808
17 files changed
+2242
-157
No files matched your search
@@ -52,7 +52,49 @@ export class MenuProcessor {
|
||||
this.validateMenuPaths(menuList)
|
||||
|
||||
// 规范化路径(将相对路径转换为完整路径)
|
||||
return this.normalizeMenuPaths(this.filterDashboardMenus(menuList))
|
||||
const normalized = this.normalizeMenuPaths(this.filterDashboardMenus(menuList))
|
||||
// 门户启动器首页:始终注入(不依赖后端 menuCodes)
|
||||
return this.ensurePortalHomeRoute(normalized)
|
||||
}
|
||||
|
||||
/** 确保 /home 启动器路由存在于菜单树(供动态注册) */
|
||||
private ensurePortalHomeRoute(menuList: AppRouteRecord[]): AppRouteRecord[] {
|
||||
const hasHome = menuList.some(
|
||||
(m) =>
|
||||
m.path === '/home-root' ||
|
||||
m.name === 'PortalHomeRoot' ||
|
||||
m.children?.some((c) => c.path === '/home' || c.name === 'PortalHome')
|
||||
)
|
||||
if (hasHome) {
|
||||
return menuList
|
||||
}
|
||||
|
||||
const homeRoute: AppRouteRecord = {
|
||||
id: 'HOME00000000000000000000000000001',
|
||||
name: 'PortalHomeRoot',
|
||||
path: '/home-root',
|
||||
component: '/index/index',
|
||||
meta: {
|
||||
title: '首页',
|
||||
keepAlive: false,
|
||||
isHide: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
id: 'HOME00000000000000000000000000002',
|
||||
name: 'PortalHome',
|
||||
path: '/home',
|
||||
component: '/portal/home/index',
|
||||
meta: {
|
||||
title: '首页',
|
||||
keepAlive: true,
|
||||
fixedTab: true,
|
||||
isHide: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
return [homeRoute, ...menuList]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,6 +216,17 @@ export class MenuProcessor {
|
||||
level = 1
|
||||
): AppRouteRecord[] {
|
||||
return menu.reduce((acc: AppRouteRecord[], item) => {
|
||||
// 门户启动器首页不参与 menuCodes 过滤
|
||||
if (
|
||||
item.path === '/home-root' ||
|
||||
item.path === '/home' ||
|
||||
item.name === 'PortalHomeRoot' ||
|
||||
item.name === 'PortalHome'
|
||||
) {
|
||||
acc.push({ ...item })
|
||||
return acc
|
||||
}
|
||||
|
||||
const rawCode = (item.meta as any)?.menuCode ?? item.name
|
||||
const code = this.normalizeMenuCode(rawCode)
|
||||
const hasSelfPermission = !!code && codes.has(code)
|
||||
|
||||
Reference in new issue
Block a user