feat: add time period selector to competition chart (1D/3D/7D/30D/All)

This commit is contained in:
tinkle-community
2025-12-17 03:51:21 +08:00
parent 96d3ab6cc5
commit b169fcd3d2
3 changed files with 113 additions and 37 deletions

View File

@@ -409,10 +409,12 @@ export const api = {
},
// 批量获取多个交易员的历史数据(无需认证)
async getEquityHistoryBatch(traderIds: string[]): Promise<any> {
// hours: 可选参数获取最近N小时的数据0表示全部数据
// 常用值: 24=1天, 72=3天, 168=7天, 720=30天, 0=全部
async getEquityHistoryBatch(traderIds: string[], hours?: number): Promise<any> {
const result = await httpClient.post<any>(
`${API_BASE}/equity-history-batch`,
{ trader_ids: traderIds }
{ trader_ids: traderIds, hours: hours || 0 }
)
if (!result.success) throw new Error('获取批量历史数据失败')
return result.data!