diff --git a/frontend/src/api/paper.ts b/frontend/src/api/paper.ts index 13fb091..8c8bde6 100644 --- a/frontend/src/api/paper.ts +++ b/frontend/src/api/paper.ts @@ -37,6 +37,7 @@ export interface PaperAccount { initial_capital?: number start_date?: string end_date?: string + created_at?: string last_run_date?: string | null next_run_at?: string | null checkpoint_date?: string | null diff --git a/frontend/src/styles/chips.css b/frontend/src/styles/chips.css index 859338d..7fecc3d 100644 --- a/frontend/src/styles/chips.css +++ b/frontend/src/styles/chips.css @@ -40,6 +40,11 @@ border-color: rgba(0, 229, 255, 0.3); margin-left: 4px; } +.chip-cta { + color: #6ee7a8; + background: rgba(110, 231, 168, 0.1); + border-color: rgba(110, 231, 168, 0.3); +} .chip-portfolio { color: var(--amber); background: rgba(255, 176, 0, 0.08); diff --git a/frontend/src/views/backtest/PortfolioBacktest.vue b/frontend/src/views/backtest/PortfolioBacktest.vue index 8f420bd..e3983f1 100644 --- a/frontend/src/views/backtest/PortfolioBacktest.vue +++ b/frontend/src/views/backtest/PortfolioBacktest.vue @@ -83,6 +83,7 @@ const strategyOptions = [ { label: '牛熊动量', value: 'momentum_timing' }, { label: '价值精选', value: 'value_selection' }, { label: '小市值轮动', value: 'small_cap' }, + { label: '通路测试(影子vs实盘双轨)', value: 'channel_test' }, ] const BENCHMARK_OPTIONS = [ { label: '沪深300', value: '000300.XSHG' }, diff --git a/frontend/src/views/paper/List.vue b/frontend/src/views/paper/List.vue index 8a3633a..334a1f6 100644 --- a/frontend/src/views/paper/List.vue +++ b/frontend/src/views/paper/List.vue @@ -57,11 +57,22 @@ function num(v: number | null | undefined): string { } function symbolsShort(s: string | undefined): string { if (!s) return '—' - const arr = typeof s === 'string' ? s.split(',') : [] - return arr.length > 3 ? arr.slice(0, 3).join(',') + ` +${arr.length - 3}` : s + let arr: string[] = [] + try { + arr = JSON.parse(s) + } catch { + arr = String(s).split(',').map((x) => x.trim()) + } + if (!arr.length) return '—' + return arr.length > 3 ? arr.slice(0, 3).join(',') + ` +${arr.length - 3}` : arr.join(',') +} +const typeLabel: Record = { cta: '个股', portfolio: '组合' } +function createdShort(v: string | undefined): string { + if (!v) return '—' + return v.replace('T', ' ').slice(0, 16) } function open(a: PaperAccount): void { - router.push(a.mode === 'live' ? `/paper/live/${a.id}` : `/paper/result/${a.id}`) + router.push(a.mode === 'replay' ? `/paper/result/${a.id}` : `/paper/live/${a.id}`) } function goNew(): void { router.push('/paper/new') @@ -170,6 +181,7 @@ async function saveEdit(): Promise { + @@ -181,51 +193,55 @@ async function saveEdit(): Promise { - + - + + + + - - + + - - - - + - + - + - - + + - + - +