diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index dd77fe8..dda3e4a 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -14,6 +14,27 @@ const activeMenu = computed(() => { return p }) +// 顶栏动态页名(按路由推断,替代静态口号占位) +const PAGE_TITLE: Array<{ match: RegExp; group: string; title: string }> = [ + { match: /^\/dashboard$/, group: '工作台', title: '工作台' }, + { match: /^\/backtest\/new$/, group: '回测', title: '新建回测' }, + { match: /^\/backtest\/optimize$/, group: '回测', title: '参数优化' }, + { match: /^\/backtest\/history$/, group: '回测', title: '历史任务' }, + { match: /^\/backtest\/progress\//, group: '回测', title: '任务进度' }, + { match: /^\/backtest\/result\//, group: '回测', title: '回测结果' }, + { match: /^\/factor\/new$/, group: '投研', title: '因子分析' }, + { match: /^\/factor\/progress\//, group: '投研', title: '因子分析进度' }, + { match: /^\/factor\/result\//, group: '投研', title: '因子分析结果' }, + { match: /^\/paper\/new$/, group: '模拟', title: '新建模拟盘' }, + { match: /^\/paper\/result\//, group: '模拟', title: '模拟盘结果' }, + { match: /^\/paper\/live\//, group: '模拟', title: '实走监控' }, + { match: /^\/paper$/, group: '模拟', title: '模拟交易' }, +] +const pageMeta = computed(() => { + const p = route.path + return PAGE_TITLE.find((r) => r.match.test(p)) ?? { group: '', title: '控制台' } +}) + function navigate(path: string): void { router.push(path) } @@ -64,9 +85,13 @@ function onLogout(): void {
-