mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 23:54:17 +08:00
选 2-4 个已完成的回测 task,叠加净值曲线 + 横向指标对比。 后端(最小增量): - task_runner.list_recent(limit):返回最近 N 个任务摘要(LRU 倒序) - GET /backtest/tasks?limit=20:任务摘要列表端点(不含完整 result) - TaskSummary / TaskListResponse schema 前端(/compare 对比页): - CompareView:左栏勾选已完成 task,右栏叠加对比 - CompareChart:多 task 净值叠加图(归一化为初始=1) - CompareTable:多 task 指标横向对比表(8 项指标) - 按 result 结构判断可对比性(仅单标的 BacktestResult 可对比) 复用现有 task_runner LRU 表,无新增存储。测试:823 passed(+2 列表端点)
65 lines
1.3 KiB
Vue
65 lines
1.3 KiB
Vue
<script setup lang="ts">
|
|
// 根组件:顶部标题栏 + 路由出口。
|
|
</script>
|
|
|
|
<template>
|
|
<div class="app">
|
|
<header class="app-header">
|
|
<h1>easy-tdx 回测</h1>
|
|
<nav class="app-nav">
|
|
<RouterLink to="/" active-class="active">单标的回测</RouterLink>
|
|
<RouterLink to="/portfolio" active-class="active">组合回测</RouterLink>
|
|
<RouterLink to="/optimize" active-class="active">参数寻优</RouterLink>
|
|
<RouterLink to="/compare" active-class="active">结果对比</RouterLink>
|
|
</nav>
|
|
</header>
|
|
<main class="app-main">
|
|
<RouterView />
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.app {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100vh;
|
|
}
|
|
.app-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 24px;
|
|
padding: 0 20px;
|
|
height: 48px;
|
|
background: var(--bg-panel);
|
|
border-bottom: 1px solid var(--border);
|
|
flex-shrink: 0;
|
|
}
|
|
.app-header h1 {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
}
|
|
.app-nav {
|
|
display: flex;
|
|
gap: 16px;
|
|
}
|
|
.app-nav a {
|
|
color: var(--text-dim);
|
|
text-decoration: none;
|
|
font-size: 13px;
|
|
padding: 4px 0;
|
|
border-bottom: 2px solid transparent;
|
|
}
|
|
.app-nav a:hover {
|
|
color: var(--text);
|
|
}
|
|
.app-nav a.active {
|
|
color: var(--accent);
|
|
border-bottom-color: var(--accent);
|
|
}
|
|
.app-main {
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|