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
+44 -33
View File
@@ -5,6 +5,7 @@ import {
Button,
Input,
Spin,
Table,
Tag,
Toast,
} from "@douyinfe/semi-ui-19";
@@ -374,46 +375,56 @@ export function AccountPage({
))}
</div>
<div className="usage-table-wrap">
<table className="usage-table">
<thead>
<tr>
<th>用量类型</th>
<th>今日</th>
<th>昨日</th>
<th>每日上限</th>
<th>剩余额度</th>
</tr>
</thead>
<tbody>
{(
[
["submissions", "Alpha 提交"],
["simulations", "回测"],
] as const
).map(([key, label]) => (
<tr key={key}>
<th scope="row">{label}</th>
<td>
{usage?.[key]?.today == null
? "尚无当日记录"
: count(usage[key]?.today)}
</td>
<td title={usage?.[key]?.yesterday_date ?? undefined}>
<Table<{ key: "submissions" | "simulations"; label: string }>
className="usage-table"
dataSource={[
{ key: "submissions", label: "Alpha 提交" },
{ key: "simulations", label: "回测" },
]}
rowKey="key"
pagination={false}
size="small"
style={{ minWidth: 640 }}
columns={[
{ title: "用量类型", dataIndex: "label", width: 120 },
{
title: "今日",
key: "today",
render: (_, { key }) =>
usage?.[key]?.today == null
? "尚无当日记录"
: count(usage[key]?.today),
},
{
title: "昨日",
key: "yesterday",
render: (_, { key }) => (
<span title={usage?.[key]?.yesterday_date ?? undefined}>
{count(usage?.[key]?.yesterday)}
</td>
<td>
</span>
),
},
{
title: "每日上限",
key: "limit",
render: (_, { key }) => (
<>
{usage?.[key]?.limit == null
? "平台未返回"
: count(usage[key]?.limit)}
{key === "simulations" &&
usage?.simulations?.limit != null &&
"(本地设定)"}
</td>
<td>{count(usage?.[key]?.remaining)}</td>
</tr>
))}
</tbody>
</table>
</>
),
},
{
title: "剩余额度",
key: "remaining",
render: (_, { key }) => count(usage?.[key]?.remaining),
},
]}
/>
</div>
<p className="usage-note">
回测按本地每日额度计算剩余次数;活动统计可能延迟,当日次数未知时不估算余额。