feat: 支持研究素材删除并统一 Semi 表格
This commit is contained in:
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user