serv\web-侧边栏 标签统一
This commit is contained in:
@@ -17,6 +17,8 @@ const LAYOUT_MAP: Record<string, () => Promise<any>> = {
|
||||
'BasicLayout': () => import('@/layouts/BasicLayout.vue'),
|
||||
// 导航布局(新版,顶部导航+动态侧边栏)
|
||||
'NavigationLayout': () => import('@/layouts/NavigationLayout.vue'),
|
||||
// 侧边栏布局(管理后台专用,顶层SIDEBAR菜单)
|
||||
'SidebarLayout': () => import('@/layouts/SidebarLayout.vue'),
|
||||
// 空白布局
|
||||
'BlankLayout': () => import('@/layouts/BlankLayout.vue'),
|
||||
// 页面布局
|
||||
@@ -126,10 +128,11 @@ function generateRouteFromMenu(menu: SysMenu, isTopLevel = true): RouteRecordRaw
|
||||
route.component = getComponent(layout);
|
||||
} else if (hasChildren && isTopLevel) {
|
||||
// 如果有子菜单但没有指定布局,根据菜单类型选择默认布局
|
||||
if (isTopLevel && menu.type === MenuType.NAVIGATION) {
|
||||
if (menu.type === MenuType.NAVIGATION) {
|
||||
route.component = getComponent('NavigationLayout');
|
||||
} else if (menu.type === MenuType.SIDEBAR) {
|
||||
route.component = getComponent('BlankLayout');
|
||||
} else if (menu.type === MenuType.SIDEBAR && !menu.parentID) {
|
||||
// 顶层SIDEBAR菜单(管理后台)默认使用SidebarLayout
|
||||
route.component = getComponent('SidebarLayout');
|
||||
} else {
|
||||
route.component = getComponent('BasicLayout');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user