feat(admin): 后台瘦身——数据总览为默认页/精简菜单/顶栏去演示组件

- 默认页:HOME_PAGE_PATH 指向 /tracker/dashboard,登录/根路径/logo 点击统一落数据总览
- 菜单:tracker 路由扁平为顶级三项(数据总览/访客管理/站点管理),访客详情保持 hidden;
  移除模板演示路由(工作台/分析页、结果页、异常页、系统管理 mock 页),直达返回 404;
  system 仅保留隐藏的个人中心路由供头像菜单使用
- 顶栏:配置化停用通知铃铛/快捷入口/全局搜索(含 Ctrl+K)/聊天窗口,保留主题/语言/全屏/设置与头像菜单
- worktab:命中 catch-all 404 的遗留标签视为无效自动清理(如旧"工作台"标签)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-16 15:15:52 +08:00
parent 58659b0ec9
commit 1cadee16bd
10 changed files with 80 additions and 216 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ export const globalComponentsConfig: GlobalComponentConfig[] = [
component: defineAsyncComponent( component: defineAsyncComponent(
() => import('@/components/core/layouts/art-global-search/index.vue') () => import('@/components/core/layouts/art-global-search/index.vue')
), ),
enabled: true enabled: false
}, },
{ {
name: '锁屏', name: '锁屏',
@@ -51,7 +51,7 @@ export const globalComponentsConfig: GlobalComponentConfig[] = [
component: defineAsyncComponent( component: defineAsyncComponent(
() => import('@/components/core/layouts/art-chat-window/index.vue') () => import('@/components/core/layouts/art-chat-window/index.vue')
), ),
enabled: true enabled: false
}, },
{ {
name: '礼花效果', name: '礼花效果',
+8 -8
View File
@@ -23,28 +23,28 @@ export const headerBarConfig: HeaderBarFeatureConfig = {
description: '页面刷新按钮' description: '页面刷新按钮'
}, },
fastEnter: { fastEnter: {
enabled: true, enabled: false,
description: '快速入口功能,提供常用应用和链接的快速访问' description: '快速入口功能,提供常用应用和链接的快速访问(模板演示组件,已停用)'
}, },
breadcrumb: { breadcrumb: {
enabled: true, enabled: true,
description: '面包屑导航,显示当前页面路径' description: '面包屑导航,显示当前页面路径'
}, },
globalSearch: { globalSearch: {
enabled: true, enabled: false,
description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K' description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K(模板演示组件,已停用)'
}, },
fullscreen: { fullscreen: {
enabled: true, enabled: true,
description: '全屏切换功能' description: '全屏切换功能'
}, },
notification: { notification: {
enabled: true, enabled: false,
description: '通知中心,显示系统通知和消息' description: '通知中心,显示系统通知和消息(模板演示组件,已停用)'
}, },
chat: { chat: {
enabled: true, enabled: false,
description: '聊天功能,提供实时沟通' description: '聊天功能,提供实时沟通(模板演示组件,已停用)'
}, },
language: { language: {
enabled: true, enabled: true,
+2 -1
View File
@@ -20,4 +20,5 @@ export function initRouter(app: App<Element>): void {
} }
// 主页路径,默认使用菜单第一个有效路径,配置后使用此路径 // 主页路径,默认使用菜单第一个有效路径,配置后使用此路径
export const HOME_PAGE_PATH = '' // 登录后/访问根路径时重定向到数据总览页
export const HOME_PAGE_PATH = '/tracker/dashboard'
-24
View File
@@ -1,24 +0,0 @@
import { AppRouteRecord } from '@/types/router'
export const dashboardRoutes: AppRouteRecord = {
name: 'Dashboard',
path: '/dashboard',
component: '/index/index',
meta: {
title: 'menus.dashboard.title',
icon: 'ri:pie-chart-line',
roles: ['R_SUPER', 'R_ADMIN']
},
children: [
{
path: 'console',
name: 'Console',
component: '/dashboard/console',
meta: {
title: 'menus.dashboard.console',
keepAlive: false,
fixedTab: true
}
}
]
}
-46
View File
@@ -1,46 +0,0 @@
import { AppRouteRecord } from '@/types/router'
export const exceptionRoutes: AppRouteRecord = {
path: '/exception',
name: 'Exception',
component: '/index/index',
meta: {
title: 'menus.exception.title',
icon: 'ri:error-warning-line'
},
children: [
{
path: '403',
name: 'Exception403',
component: '/exception/403',
meta: {
title: 'menus.exception.forbidden',
keepAlive: true,
isHideTab: true,
isFullPage: true
}
},
{
path: '404',
name: 'Exception404',
component: '/exception/404',
meta: {
title: 'menus.exception.notFound',
keepAlive: true,
isHideTab: true,
isFullPage: true
}
},
{
path: '500',
name: 'Exception500',
component: '/exception/500',
meta: {
title: 'menus.exception.serverError',
keepAlive: true,
isHideTab: true,
isFullPage: true
}
}
]
}
+6 -11
View File
@@ -1,17 +1,12 @@
import { AppRouteRecord } from '@/types/router' import { AppRouteRecord } from '@/types/router'
import { dashboardRoutes } from './dashboard'
import { systemRoutes } from './system'
import { resultRoutes } from './result'
import { exceptionRoutes } from './exception'
import { trackerRoutes } from './tracker' import { trackerRoutes } from './tracker'
import { systemRoutes } from './system'
/** /**
* 导出所有模块化路由 * 导出所有模块化路由
*
* 业务瘦身:模板演示路由(工作台/分析页、结果页、异常页、
* 系统管理 mock 页)已从聚合中移除,菜单与路由均不可达;
* system 仅保留隐藏的个人中心路由(顶栏头像菜单使用)。
*/ */
export const routeModules: AppRouteRecord[] = [ export const routeModules: AppRouteRecord[] = [...trackerRoutes, systemRoutes]
dashboardRoutes,
systemRoutes,
resultRoutes,
exceptionRoutes,
trackerRoutes
]
-33
View File
@@ -1,33 +0,0 @@
import { AppRouteRecord } from '@/types/router'
export const resultRoutes: AppRouteRecord = {
path: '/result',
name: 'Result',
component: '/index/index',
meta: {
title: 'menus.result.title',
icon: 'ri:checkbox-circle-line'
},
children: [
{
path: 'success',
name: 'ResultSuccess',
component: '/result/success',
meta: {
title: 'menus.result.success',
icon: 'ri:checkbox-circle-line',
keepAlive: true
}
},
{
path: 'fail',
name: 'ResultFail',
component: '/result/fail',
meta: {
title: 'menus.result.fail',
icon: 'ri:close-circle-line',
keepAlive: true
}
}
]
}
+8 -35
View File
@@ -1,5 +1,12 @@
import { AppRouteRecord } from '@/types/router' import { AppRouteRecord } from '@/types/router'
/**
* 系统模块路由(精简版)
*
* 模板演示页(用户/角色/菜单管理)已移除。
* 仅保留隐藏的个人中心路由,供顶栏头像菜单跳转使用,
* 不出现在侧边栏菜单中(父级与子级均 isHide)。
*/
export const systemRoutes: AppRouteRecord = { export const systemRoutes: AppRouteRecord = {
path: '/system', path: '/system',
name: 'System', name: 'System',
@@ -7,29 +14,10 @@ export const systemRoutes: AppRouteRecord = {
meta: { meta: {
title: 'menus.system.title', title: 'menus.system.title',
icon: 'ri:user-3-line', icon: 'ri:user-3-line',
isHide: true,
roles: ['R_SUPER', 'R_ADMIN'] roles: ['R_SUPER', 'R_ADMIN']
}, },
children: [ children: [
{
path: 'user',
name: 'User',
component: '/system/user',
meta: {
title: 'menus.system.user',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'role',
name: 'Role',
component: '/system/role',
meta: {
title: 'menus.system.role',
keepAlive: true,
roles: ['R_SUPER']
}
},
{ {
path: 'user-center', path: 'user-center',
name: 'UserCenter', name: 'UserCenter',
@@ -40,21 +28,6 @@ export const systemRoutes: AppRouteRecord = {
keepAlive: true, keepAlive: true,
isHideTab: true isHideTab: true
} }
},
{
path: 'menu',
name: 'Menus',
component: '/system/menu',
meta: {
title: 'menus.system.menu',
keepAlive: true,
roles: ['R_SUPER'],
authList: [
{ title: '新增', authMark: 'add' },
{ title: '编辑', authMark: 'edit' },
{ title: '删除', authMark: 'delete' }
]
}
} }
] ]
} }
+49 -55
View File
@@ -1,61 +1,55 @@
import { AppRouteRecord } from '@/types/router' import { AppRouteRecord } from '@/types/router'
/** /**
* 访客统计模块路由 * 访客统计模块路由(顶级扁平结构)
* *
* 菜单:数据总览 / 访客管理 / 站点管理;访客详情不进菜单(isHide), * 菜单顶级即业务项:数据总览 / 访客管理 / 站点管理;
* 由列表页跳转并携带 query: visitor_id,activePath 让"访客管理"保持高亮。 * 访客详情不进菜单(isHide),由列表页跳转并携带 query: visitor_id,
* activePath 让"访客管理"保持高亮。
*/ */
export const trackerRoutes: AppRouteRecord = { export const trackerRoutes: AppRouteRecord[] = [
path: '/tracker', {
name: 'Tracker', path: '/tracker/dashboard',
component: '/index/index', name: 'TrackerDashboard',
meta: { component: '/tracker/dashboard/index',
title: 'menus.tracker.title', meta: {
icon: 'ri:bar-chart-box-line', title: 'menus.tracker.dashboard',
roles: ['R_SUPER', 'R_ADMIN'] icon: 'ri:bar-chart-box-line',
}, keepAlive: true,
children: [ roles: ['R_SUPER', 'R_ADMIN']
{
path: 'dashboard',
name: 'TrackerDashboard',
component: '/tracker/dashboard/index',
meta: {
title: 'menus.tracker.dashboard',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'visitor',
name: 'TrackerVisitor',
component: '/tracker/visitor/index',
meta: {
title: 'menus.tracker.visitor',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'visitor/detail',
name: 'TrackerVisitorDetail',
component: '/tracker/visitor/detail',
meta: {
title: 'menus.tracker.visitorDetail',
isHide: true,
keepAlive: true,
activePath: '/tracker/visitor'
}
},
{
path: 'site',
name: 'TrackerSite',
component: '/tracker/site/index',
meta: {
title: 'menus.tracker.site',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
} }
] },
} {
path: '/tracker/visitor',
name: 'TrackerVisitor',
component: '/tracker/visitor/index',
meta: {
title: 'menus.tracker.visitor',
icon: 'ri:group-line',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: '/tracker/visitor/detail',
name: 'TrackerVisitorDetail',
component: '/tracker/visitor/detail',
meta: {
title: 'menus.tracker.visitorDetail',
isHide: true,
keepAlive: true,
activePath: '/tracker/visitor'
}
},
{
path: '/tracker/site',
name: 'TrackerSite',
component: '/tracker/site/index',
meta: {
title: 'menus.tracker.site',
icon: 'ri:global-line',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
}
]
+5 -1
View File
@@ -446,7 +446,11 @@ export const useWorktabStore = defineStore(
path: tab.path, path: tab.path,
query: (tab.query as LocationQueryRaw) || undefined query: (tab.query as LocationQueryRaw) || undefined
}) })
return resolved.matched.length > 0 // 仅命中 404 兜底路由(catch-all)视为无效:
// 说明该标签对应的路由已被移除(如模板演示页遗留标签)
const lastMatched = resolved.matched[resolved.matched.length - 1]
const isCatchAll = lastMatched?.path === '/:pathMatch(.*)*'
return resolved.matched.length > 0 && !isCatchAll
} }
return false return false
} catch { } catch {