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:
@@ -32,7 +32,7 @@ export const useAuthStore = defineStore(AUTH_STORE_KEY, {
|
||||
},
|
||||
async getAuthMenuList() {
|
||||
const { data: menuData } = await getAuthMenuListApi()
|
||||
this.authMenuList = filterBusinessMenus(menuData)
|
||||
this.authMenuList = normalizeBusinessMenus(filterBusinessMenus(menuData))
|
||||
},
|
||||
async setRouteName(name: string) {
|
||||
this.routeName = name
|
||||
@@ -121,6 +121,42 @@ function filterBusinessMenus(menuList: any[]): any[] {
|
||||
})
|
||||
}
|
||||
|
||||
function normalizeBusinessMenus(menuList: any[]): any[] {
|
||||
return menuList.map(menu => normalizeBusinessMenu(menu))
|
||||
}
|
||||
|
||||
function normalizeBusinessMenu(menu: any): any {
|
||||
if (Array.isArray(menu.children) && menu.children.length > 0) {
|
||||
menu.children = normalizeBusinessMenus(menu.children)
|
||||
}
|
||||
|
||||
if (isEventListMenu(menu)) {
|
||||
// 后端菜单历史配置不统一,前端统一收敛到静态 eventList 页面入口。
|
||||
menu.path = '/eventList/index'
|
||||
menu.name = 'eventList'
|
||||
menu.component = '@/views/event/eventList/index.vue'
|
||||
}
|
||||
|
||||
return menu
|
||||
}
|
||||
|
||||
function isEventListMenu(menu: any): boolean {
|
||||
const normalizedName = String(menu?.name ?? '').toLowerCase().replace(/[-_]/g, '')
|
||||
const normalizedPath = String(menu?.path ?? '').toLowerCase().replace(/[-_]/g, '')
|
||||
const normalizedComponent = String(menu?.component ?? '').toLowerCase().replace(/[-_]/g, '')
|
||||
const title = String(menu?.meta?.title ?? menu?.title ?? '')
|
||||
|
||||
if (normalizedName === 'eventlist') return true
|
||||
if (normalizedPath.includes('eventlist')) return true
|
||||
if (normalizedComponent.includes('eventlist')) return true
|
||||
|
||||
return title.includes('事件列表') && (title.includes('暂降') || title.includes('暂态'))
|
||||
}
|
||||
|
||||
export function resolveBusinessMenuPath(menu: Menu.MenuOptions): string {
|
||||
return isEventListMenu(menu) ? '/eventList/index' : menu.path
|
||||
}
|
||||
|
||||
function normalizeActivateInfo(rawData: unknown): Activate.ActivationCodePlaintext {
|
||||
if (!rawData || typeof rawData !== 'object' || Array.isArray(rawData)) {
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user