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>
|
||||
))}
|
||||
|
||||
@@ -369,26 +369,10 @@
|
||||
text-align: left;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.ai-alpha-results table {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
.ai-alpha-results .semi-table {
|
||||
margin-top: var(--space-2);
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.ai-alpha-results th,
|
||||
.ai-alpha-results td {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 400;
|
||||
padding: var(--space-1) 0;
|
||||
}
|
||||
.ai-alpha-results th {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.ai-resize {
|
||||
position: absolute;
|
||||
left: -4px;
|
||||
|
||||
Reference in New Issue
Block a user