task-138(记录与版本中心): 实现版本页面权限路由接入
新增 records-route.ts:按菜单 key 过滤可见的记录/版本页。 TDD: task-138.test.ts 8 用例 RED→GREEN。
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/** 记录与版本中心页可见性(任务 138):依据菜单 key 决定历史/版本/数字人版本页是否展示;纯逻辑。 */
|
||||
|
||||
export const RECORDS_PAGE_KEYS = ['history', 'version', 'digital-human-version'] as const
|
||||
export type RecordsPageKey = (typeof RECORDS_PAGE_KEYS)[number]
|
||||
|
||||
/** 由菜单 key 集合过滤出可见的记录页(按固定顺序)。 */
|
||||
export function visibleRecordsPages(menuKeys: readonly string[] | null | undefined): RecordsPageKey[] {
|
||||
if (!Array.isArray(menuKeys)) return []
|
||||
return RECORDS_PAGE_KEYS.filter((key) => menuKeys.includes(key))
|
||||
}
|
||||
Reference in New Issue
Block a user