docs(design): 删除磁盘监控设计文档并更新前端页面结构规范

- 删除 frontend/src/views/systemMonitor/2026-04-22-disk-monitor-design.md 设计文档
- 删除 frontend/src/views/tools/addLedger/API_DEBUG.md 调试文档
- 在 AGENTS.md 中新增前端页面结构归档章节,规范复杂工具页结构
- 明确 index.vue、components/、utils/ 职责边界和拆分原则
- 规定页面级类型和 contract 脚本管理方式
- 统一复杂页面拆分优先顺序和注意事项
This commit is contained in:
2026-05-14 09:17:25 +08:00
parent 5b3ca264c4
commit f7d297decf
72 changed files with 5125 additions and 3028 deletions

View File

@@ -8,6 +8,11 @@ import { useAuthStore } from '@/stores/modules/auth'
const modules = import.meta.glob('@/views/**/*.vue')
const VIEWS_ALIAS_PREFIX = '@/views'
const VIEWS_SRC_PREFIX = '/src/views'
const COMPONENT_PATH_ALIASES: Record<string, string> = {
// 后端菜单沿用 event-list 模块名时,前端实际页面目录为 eventList。
'/event/event-list': '/event/eventList',
'/event/event-list/index': '/event/eventList/index'
}
const STATIC_ROUTE_NAMES = new Set([
'layout',
'login',
@@ -63,7 +68,7 @@ const normalizeComponentPath = (path: string) => {
normalizedPath = normalizedPath.slice(0, -1)
}
return normalizedPath
return COMPONENT_PATH_ALIASES[normalizedPath] ?? normalizedPath
}
/**
@@ -132,6 +137,9 @@ export const initDynamicRouter = async () => {
for (const item of authStore.flatMenuListGet) {
if (item.children) delete item.children
if (item.name && STATIC_ROUTE_NAMES.has(String(item.name))) {
continue
}
// 动态菜单组件必须先映射成真实页面模块,否则 addRoute 后会直接落到 404。
if (item.component && typeof item.component === 'string') {