Files
easy-tdx/web-ui/src/style.css
T
Justin Gu 6aab7a82b5 feat(web-ui): Vue3 + ECharts 回测前端(单标的 + 组合回测)
独立前端工程(web-ui/),Vue3 + Vite + TypeScript + Pinia + ECharts。
通过 vite proxy 对接后端 /api,开发期无跨域。

单标的回测(/):
- StrategyPicker: 策略下拉 + 按 schema 动态渲染参数表单
- SymbolPicker: 选标的 + 日期范围取行情(默认3年,结束日=今天)
- KlineChart: K线主图 + 买卖点 markPoint(按 datetime 对齐)
- EquityChart: 净值曲线 + 回撤双轴图
- MetricTable: 19 项绩效指标(收益/风险/交易分组)
- TradeTable: 成交记录表

组合回测(/portfolio):
- StocksPicker: 多标的输入(增删标签)
- PortfolioCompareChart: 各标的净值叠加(归一化对比)
- PortfolioSummaryTable: 各标的绩效横向对比
- 顶部导航切换单标的/组合

契约修复(/check 审计):
- fetchBars 归一化 date/datetime 列名(日线返回 date)
- K线买卖点按完整 datetime 对齐(分钟线不再折叠)
- count 上限对齐后端 800
- ECharts 注册内联 dark 主题
- 参数表单空输入不打断编辑
- 网络错误友好提示

技术栈:Vue 3.5 / Vite 8 / TS 6 / Pinia / ECharts(按需引入 725KB)
2026-07-03 03:35:20 +08:00

107 lines
1.8 KiB
CSS

/* 全局深色金融主题。MVP-A 不引 UI 组件库,用 CSS 变量统一设计 token。 */
:root {
--bg: #0f1117;
--bg-elevated: #1a1d26;
--bg-panel: #161922;
--border: #2a2e3a;
--text: #e6e8eb;
--text-muted: #8b919e;
--text-dim: #5c6370;
--accent: #4a9eff;
--up: #ef4146; /* A股惯例:红涨 */
--down: #18a058; /* 绿跌 */
--warn: #f0a020;
--radius: 6px;
--font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body,
#app {
height: 100%;
background: var(--bg);
color: var(--text);
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
}
button {
cursor: pointer;
border: 1px solid var(--border);
background: var(--bg-elevated);
color: var(--text);
padding: 6px 14px;
border-radius: var(--radius);
font-size: 13px;
transition: all 0.15s;
}
button:hover:not(:disabled) {
border-color: var(--accent);
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
button.primary {
background: var(--accent);
border-color: var(--accent);
color: #fff;
font-weight: 600;
}
button.primary:disabled {
background: var(--bg-elevated);
color: var(--text-dim);
}
input,
select,
textarea {
background: var(--bg);
border: 1px solid var(--border);
color: var(--text);
padding: 6px 10px;
border-radius: var(--radius);
font-size: 13px;
width: 100%;
}
input:focus,
select:focus,
textarea:focus {
outline: none;
border-color: var(--accent);
}
label {
display: block;
color: var(--text-muted);
font-size: 12px;
margin-bottom: 4px;
}
.field {
margin-bottom: 12px;
}
.row {
display: flex;
gap: 8px;
align-items: flex-end;
}
.row > * {
flex: 1;
}
a {
color: var(--accent);
}