From 1cadee16bdbdcd715f094edd2bec6bf9c7c51aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 16 Sep 2026 15:15:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=90=8E=E5=8F=B0=E7=98=A6?= =?UTF-8?q?=E8=BA=AB=E2=80=94=E2=80=94=E6=95=B0=E6=8D=AE=E6=80=BB=E8=A7=88?= =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4=E9=A1=B5/=E7=B2=BE=E7=AE=80?= =?UTF-8?q?=E8=8F=9C=E5=8D=95/=E9=A1=B6=E6=A0=8F=E5=8E=BB=E6=BC=94?= =?UTF-8?q?=E7=A4=BA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 默认页:HOME_PAGE_PATH 指向 /tracker/dashboard,登录/根路径/logo 点击统一落数据总览 - 菜单:tracker 路由扁平为顶级三项(数据总览/访客管理/站点管理),访客详情保持 hidden; 移除模板演示路由(工作台/分析页、结果页、异常页、系统管理 mock 页),直达返回 404; system 仅保留隐藏的个人中心路由供头像菜单使用 - 顶栏:配置化停用通知铃铛/快捷入口/全局搜索(含 Ctrl+K)/聊天窗口,保留主题/语言/全屏/设置与头像菜单 - worktab:命中 catch-all 404 的遗留标签视为无效自动清理(如旧"工作台"标签) Co-Authored-By: Claude Code --- admin/src/config/modules/component.ts | 4 +- admin/src/config/modules/headerBar.ts | 16 ++-- admin/src/router/index.ts | 3 +- admin/src/router/modules/dashboard.ts | 24 ------ admin/src/router/modules/exception.ts | 46 ------------ admin/src/router/modules/index.ts | 17 ++--- admin/src/router/modules/result.ts | 33 -------- admin/src/router/modules/system.ts | 43 ++--------- admin/src/router/modules/tracker.ts | 104 ++++++++++++-------------- admin/src/store/modules/worktab.ts | 6 +- 10 files changed, 80 insertions(+), 216 deletions(-) delete mode 100644 admin/src/router/modules/dashboard.ts delete mode 100644 admin/src/router/modules/exception.ts delete mode 100644 admin/src/router/modules/result.ts diff --git a/admin/src/config/modules/component.ts b/admin/src/config/modules/component.ts index bc709e0..e5326c7 100644 --- a/admin/src/config/modules/component.ts +++ b/admin/src/config/modules/component.ts @@ -35,7 +35,7 @@ export const globalComponentsConfig: GlobalComponentConfig[] = [ component: defineAsyncComponent( () => import('@/components/core/layouts/art-global-search/index.vue') ), - enabled: true + enabled: false }, { name: '锁屏', @@ -51,7 +51,7 @@ export const globalComponentsConfig: GlobalComponentConfig[] = [ component: defineAsyncComponent( () => import('@/components/core/layouts/art-chat-window/index.vue') ), - enabled: true + enabled: false }, { name: '礼花效果', diff --git a/admin/src/config/modules/headerBar.ts b/admin/src/config/modules/headerBar.ts index a420e82..d3ac464 100644 --- a/admin/src/config/modules/headerBar.ts +++ b/admin/src/config/modules/headerBar.ts @@ -23,28 +23,28 @@ export const headerBarConfig: HeaderBarFeatureConfig = { description: '页面刷新按钮' }, fastEnter: { - enabled: true, - description: '快速入口功能,提供常用应用和链接的快速访问' + enabled: false, + description: '快速入口功能,提供常用应用和链接的快速访问(模板演示组件,已停用)' }, breadcrumb: { enabled: true, description: '面包屑导航,显示当前页面路径' }, globalSearch: { - enabled: true, - description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K' + enabled: false, + description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K(模板演示组件,已停用)' }, fullscreen: { enabled: true, description: '全屏切换功能' }, notification: { - enabled: true, - description: '通知中心,显示系统通知和消息' + enabled: false, + description: '通知中心,显示系统通知和消息(模板演示组件,已停用)' }, chat: { - enabled: true, - description: '聊天功能,提供实时沟通' + enabled: false, + description: '聊天功能,提供实时沟通(模板演示组件,已停用)' }, language: { enabled: true, diff --git a/admin/src/router/index.ts b/admin/src/router/index.ts index 286ae58..f3f2083 100644 --- a/admin/src/router/index.ts +++ b/admin/src/router/index.ts @@ -20,4 +20,5 @@ export function initRouter(app: App): void { } // 主页路径,默认使用菜单第一个有效路径,配置后使用此路径 -export const HOME_PAGE_PATH = '' +// 登录后/访问根路径时重定向到数据总览页 +export const HOME_PAGE_PATH = '/tracker/dashboard' diff --git a/admin/src/router/modules/dashboard.ts b/admin/src/router/modules/dashboard.ts deleted file mode 100644 index 5f9c3e9..0000000 --- a/admin/src/router/modules/dashboard.ts +++ /dev/null @@ -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 - } - } - ] -} diff --git a/admin/src/router/modules/exception.ts b/admin/src/router/modules/exception.ts deleted file mode 100644 index 07c5604..0000000 --- a/admin/src/router/modules/exception.ts +++ /dev/null @@ -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 - } - } - ] -} diff --git a/admin/src/router/modules/index.ts b/admin/src/router/modules/index.ts index 38b1998..7f946f4 100644 --- a/admin/src/router/modules/index.ts +++ b/admin/src/router/modules/index.ts @@ -1,17 +1,12 @@ 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 { systemRoutes } from './system' /** * 导出所有模块化路由 + * + * 业务瘦身:模板演示路由(工作台/分析页、结果页、异常页、 + * 系统管理 mock 页)已从聚合中移除,菜单与路由均不可达; + * system 仅保留隐藏的个人中心路由(顶栏头像菜单使用)。 */ -export const routeModules: AppRouteRecord[] = [ - dashboardRoutes, - systemRoutes, - resultRoutes, - exceptionRoutes, - trackerRoutes -] +export const routeModules: AppRouteRecord[] = [...trackerRoutes, systemRoutes] diff --git a/admin/src/router/modules/result.ts b/admin/src/router/modules/result.ts deleted file mode 100644 index 575a2f7..0000000 --- a/admin/src/router/modules/result.ts +++ /dev/null @@ -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 - } - } - ] -} diff --git a/admin/src/router/modules/system.ts b/admin/src/router/modules/system.ts index 16df585..47f35c3 100644 --- a/admin/src/router/modules/system.ts +++ b/admin/src/router/modules/system.ts @@ -1,5 +1,12 @@ import { AppRouteRecord } from '@/types/router' +/** + * 系统模块路由(精简版) + * + * 模板演示页(用户/角色/菜单管理)已移除。 + * 仅保留隐藏的个人中心路由,供顶栏头像菜单跳转使用, + * 不出现在侧边栏菜单中(父级与子级均 isHide)。 + */ export const systemRoutes: AppRouteRecord = { path: '/system', name: 'System', @@ -7,29 +14,10 @@ export const systemRoutes: AppRouteRecord = { meta: { title: 'menus.system.title', icon: 'ri:user-3-line', + isHide: true, roles: ['R_SUPER', 'R_ADMIN'] }, 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', name: 'UserCenter', @@ -40,21 +28,6 @@ export const systemRoutes: AppRouteRecord = { keepAlive: 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' } - ] - } } ] } diff --git a/admin/src/router/modules/tracker.ts b/admin/src/router/modules/tracker.ts index dabaf0e..afc05f0 100644 --- a/admin/src/router/modules/tracker.ts +++ b/admin/src/router/modules/tracker.ts @@ -1,61 +1,55 @@ import { AppRouteRecord } from '@/types/router' /** - * 访客统计模块路由 + * 访客统计模块路由(顶级扁平结构) * - * 菜单:数据总览 / 访客管理 / 站点管理;访客详情不进菜单(isHide), - * 由列表页跳转并携带 query: visitor_id,activePath 让"访客管理"保持高亮。 + * 菜单顶级即业务项:数据总览 / 访客管理 / 站点管理; + * 访客详情不进菜单(isHide),由列表页跳转并携带 query: visitor_id, + * activePath 让"访客管理"保持高亮。 */ -export const trackerRoutes: AppRouteRecord = { - path: '/tracker', - name: 'Tracker', - component: '/index/index', - meta: { - title: 'menus.tracker.title', - icon: 'ri:bar-chart-box-line', - roles: ['R_SUPER', 'R_ADMIN'] - }, - children: [ - { - 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'] - } +export const trackerRoutes: AppRouteRecord[] = [ + { + path: '/tracker/dashboard', + name: 'TrackerDashboard', + component: '/tracker/dashboard/index', + meta: { + title: 'menus.tracker.dashboard', + icon: 'ri:bar-chart-box-line', + 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'] + } + } +] diff --git a/admin/src/store/modules/worktab.ts b/admin/src/store/modules/worktab.ts index caa0d90..e6fb254 100644 --- a/admin/src/store/modules/worktab.ts +++ b/admin/src/store/modules/worktab.ts @@ -446,7 +446,11 @@ export const useWorktabStore = defineStore( path: tab.path, 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 } catch {