From 61f5c545953bb4ee20b123bf9671ac35d7f1f3c1 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 12:03:32 +0800 Subject: [变更性质] feat(frontend) [新增功能] round3 页面组件全量迁移 shadcn-svelte(12 页面 + Modal/DatasetWizard/DatasetCard/Status) [实现方案] .btn→Button、.banner→Alert、table.data→Table.Root、.badge→Badge、.tabs→Tabs.Root、.metric-card/form.card→Card.Root;ProjectStrategyTab div 配对修复 [影响范围] src/pages/*.svelte、src/components/*.svelte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/RunsPage.svelte | 104 +++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 50 deletions(-) (limited to 'frontend/src/pages/RunsPage.svelte') diff --git a/frontend/src/pages/RunsPage.svelte b/frontend/src/pages/RunsPage.svelte index ad72b5d..911da2a 100644 --- a/frontend/src/pages/RunsPage.svelte +++ b/frontend/src/pages/RunsPage.svelte @@ -7,6 +7,10 @@ import { extractStatusMessage } from '../lib/state'; import { fmtDateTime, runStatusLabel, runStatusBadge, fmtPct, fmtNum, formatMoney } from '../lib/format'; import { capitalReporting } from '../lib/capitalMetrics'; + import { Alert } from '$lib/components/ui/alert'; + import { Badge } from '$lib/components/ui/badge'; + import * as Card from '$lib/components/ui/card'; + import * as Table from '$lib/components/ui/table'; import type { Run } from '../lib/types'; let runs: Run[] = $state([]); @@ -107,25 +111,25 @@ import { capitalReporting } from '../lib/capitalMetrics'; {/if} {#if !busy && !error && runs.length > 0} -
- - - - - - - - - - - - - - - + + + + + + 时间 + 状态 + 项目 + 数据集 + 资金/佣金/滑点 + 收益 + 最大回撤 + 操作 + + + {#each runs as r (r.id)} - - - - - - - - - - - + + {/each} - -
时间状态项目数据集资金/佣金/滑点收益最大回撤操作
+ + = 4 && !chosenIds.includes(r.id)} /> - {fmtDateTime(r.created_at)}{runStatusLabel[r.status]}{r.project_id?.slice(0, 8)}…{r.dataset_id?.slice(0, 8)}…{formatMoney(r.config?.capital)} · {fmtPct(r.config?.commission, 4)} / {fmtPct(r.config?.slippage, 4)}{r.result ? fmtPct(r.result.metrics.total_return) : '—'}{r.result ? fmtPct(r.result.metrics.max_drawdown) : '—'} + + {fmtDateTime(r.created_at)} + {runStatusLabel[r.status]} + {r.project_id?.slice(0, 8)}… + {r.dataset_id?.slice(0, 8)}… + {formatMoney(r.config?.capital)} · {fmtPct(r.config?.commission, 4)} / {fmtPct(r.config?.slippage, 4)} + {r.result ? fmtPct(r.result.metrics.total_return) : '—'} + {r.result ? fmtPct(r.result.metrics.max_drawdown) : '—'} + -
+ +

最多同时选中 4 个已完成的回测用于比较。

-
+ {#if selected.length > 0} -
+

条件差异

- - - - - {#each selected as r (r.id)}{/each} - - - + + + + 维度 + {#each selected as r (r.id)}Run {r.id.slice(0, 6)}.{/each} + + + {#each configDiffRows as row, i (i)} - - + + {row.label} {#each row.vals as v, j (j)} - + {v} {/each} - + {/each} - -
维度Run {r.id.slice(0, 6)}
{row.label}{v}
-
+ + + {#if comparable.length > 1} -
+

收益曲线对齐比较(首日归一)

起点对齐为 1,仅叠加不同起点的曲线时只在各自区间内展示。

-
+ {:else} {/if} -- cgit v1.2.3