feat: 支持研究素材删除并统一 Semi 表格

This commit is contained in:
yuxuanhui
2026-09-11 23:21:08 +08:00
parent f29063c9a2
commit 8eec12f0e0
26 changed files with 1008 additions and 562 deletions
+27 -20
View File
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { Toast } from "@douyinfe/semi-ui-19";
import { Table, Toast } from "@douyinfe/semi-ui-19";
import { api, formatNumber, formatTime, stateLabels } from "../api";
import { PnlChart } from "../components/PnlChart";
import type { Alpha, Pnl, Research } from "../types";
@@ -62,26 +62,33 @@ export function AlphaToolCard({ call, onAction, timezone }: ToolCardProps) {
<small>
{alpha.id} · {alpha.region ?? "地区未提供"}
</small>
<table>
<thead>
<tr>
<th>Sharpe</th>
<th>Fitness</th>
<th>Turnover</th>
</tr>
</thead>
<tbody>
<tr>
<td>{formatNumber(alpha.sharpe)}</td>
<td>{formatNumber(alpha.fitness)}</td>
<td>
{alpha.turnover == null
<Table<Alpha>
dataSource={[alpha]}
rowKey="id"
pagination={false}
size="small"
tableLayout="fixed"
columns={[
{
title: "Sharpe",
key: "sharpe",
render: (_, alpha) => formatNumber(alpha.sharpe),
},
{
title: "Fitness",
key: "fitness",
render: (_, alpha) => formatNumber(alpha.fitness),
},
{
title: "Turnover",
key: "turnover",
render: (_, alpha) =>
alpha.turnover == null
? "未提供"
: `${formatNumber(alpha.turnover * 100)}%`}
</td>
</tr>
</tbody>
</table>
: `${formatNumber(alpha.turnover * 100)}%`,
},
]}
/>
<small>本地快照 · {formatTime(alpha.synced_at, timezone)}</small>
</div>
))}