diff --git a/frontend/src/admin/nav.ts b/frontend/src/admin/nav.ts index 7b67e7d..91af3c5 100644 --- a/frontend/src/admin/nav.ts +++ b/frontend/src/admin/nav.ts @@ -20,18 +20,25 @@ export interface NavItem { hideFromSidebar?: boolean } -/** 唯一的导航配置源。顺序 = 侧栏渲染顺序(命令面板分组内顺序与之相同)。 */ +/** 唯一的导航配置源。顺序 = 侧栏渲染顺序(命令面板分组内顺序与之相同)。 + * + * 分组按用户心智模型: 数据(往里灌) → 预测(算出来) → 系统(保证它活着)。 + * 「预测历史/回测/评估」同属预测生命周期,不再挂在「数据流水线」名下。 + */ export const NAV_ITEMS: NavItem[] = [ { to: '/admin', label: '仪表盘', group: '概览', icon: 'chart' }, - { to: '/admin/collection', label: '数据采集', group: '数据流水线', icon: 'collection' }, - { to: '/admin/data-completeness', label: '数据完整性', group: '数据流水线', icon: 'chart' }, - { to: '/admin/data-pipeline', label: '数据管线', group: '数据流水线', icon: 'chart', hideFromSidebar: true }, - { to: '/admin/predictions', label: '预测历史', group: '数据流水线', icon: 'logs' }, - { to: '/admin/backtest', label: '回测', group: '数据流水线', icon: 'repeat' }, - { to: '/admin/eval', label: '评估', group: '评估与监控', icon: 'eval' }, - { to: '/admin/monitoring', label: '监控', group: '评估与监控', icon: 'monitor' }, - { to: '/admin/settings', label: '设置', group: '系统', icon: 'settings' }, + // ── 数据:采集、核对、管线内部视图 ── + { to: '/admin/collection', label: '数据采集', group: '数据', icon: 'collection' }, + { to: '/admin/data-completeness', label: '数据完整性', group: '数据', icon: 'eval' }, + { to: '/admin/data-pipeline', label: '数据管线', group: '数据', icon: 'chart', hideFromSidebar: true }, + // ── 预测:历史 → 回测 → 评估闭环 ── + { to: '/admin/predictions', label: '预测历史', group: '预测', icon: 'target' }, + { to: '/admin/backtest', label: '回测', group: '预测', icon: 'repeat' }, + { to: '/admin/eval', label: '评估', group: '预测', icon: 'eval' }, + // ── 系统:活着吗、发生了什么、怎么调 ── + { to: '/admin/monitoring', label: '监控', group: '系统', icon: 'monitor' }, { to: '/admin/logs', label: '日志', group: '系统', icon: 'logs' }, + { to: '/admin/settings', label: '设置', group: '系统', icon: 'settings' }, ] /** 命令面板条目(原 NAV_PAGES 的唯一来源) */ @@ -42,11 +49,6 @@ export const ROUTE_LABELS: Record = Object.fromEntries( NAV_ITEMS.map(i => [i.to, i.label]), ) -/** 侧栏分组标题的历史显示名(仅侧栏使用;与面板分组名不同时在此映射) */ -const SIDEBAR_GROUP_TITLES: Record = { - 系统: '系统设置', -} - /** * 侧栏分组(原 NAV_SECTIONS 的唯一来源)。 * 仪表盘(group=概览)在 AdminLayout 中独立渲染于顶部,不进分组循环。 @@ -55,13 +57,12 @@ export const NAV_SECTIONS = (() => { const sidebarItems = NAV_ITEMS.filter(i => !i.hideFromSidebar && i.group !== '概览') const titles: string[] = [] for (const i of sidebarItems) { - const title = SIDEBAR_GROUP_TITLES[i.group] ?? i.group - if (!titles.includes(title)) titles.push(title) + if (!titles.includes(i.group)) titles.push(i.group) } return titles.map(title => ({ title, items: sidebarItems - .filter(i => (SIDEBAR_GROUP_TITLES[i.group] ?? i.group) === title) + .filter(i => i.group === title) .map(({ to, label, icon }) => ({ to, label, icon })), })) })()