fix: 优化回测功能UI和修复问题
## 主要修改 ### UI 优化 - 将回测功能移到跟单交易菜单下作为子菜单 - 创建回测改为使用 Modal 方式(移除独立页面) - 优化导航路径,使用 useNavigate 替代 window.location.href ### 功能修复 - 修复 API 路径问题:移除重复的 /api 前缀(/api/backtest -> /backtest) - 修复 copyRatio 输入框单位:改为百分比输入(100 表示 100%),与跟单配置保持一致 - 修复回测列表中 leader 列显示为空的问题:优先显示 leaderName,为空时显示 leaderAddress ### 多语言完善 - 补充缺失的多语言 key: - common.ascending / common.descending / common.day - backtest.sortBy / backtest.sortOrder / backtest.createdAt - backtest.copyRatioTooltip / backtest.copyRatioPlaceholder - 以及其他表单验证相关的 key - 为中文简体、中文繁体、英文三种语言都添加了完整的翻译 ## 修改的文件 - frontend/src/App.tsx - 移除 BacktestCreate 路由 - frontend/src/components/Layout.tsx - 调整菜单结构 - frontend/src/pages/BacktestList.tsx - Modal 创建、修复 leader 显示 - frontend/src/pages/BacktestDetail.tsx - 优化导航 - frontend/src/pages/BacktestCreate.tsx - 同步 copyRatio 修改 - frontend/src/services/api.ts - 修复 API 路径 - frontend/src/locales/* - 补充多语言配置
This commit is contained in:
@@ -756,7 +756,7 @@ export const backtestService = {
|
||||
keywordFilterMode?: 'DISABLED' | 'WHITELIST' | 'BLACKLIST'
|
||||
keywords?: string[]
|
||||
maxMarketEndDate?: number | null
|
||||
}) => apiClient.post('/api/backtest/tasks', data),
|
||||
}) => apiClient.post('/backtest/tasks', data),
|
||||
|
||||
/**
|
||||
* 查询回测任务列表
|
||||
@@ -768,12 +768,12 @@ export const backtestService = {
|
||||
sortOrder?: 'asc' | 'desc'
|
||||
page: number
|
||||
size: number
|
||||
}) => apiClient.post('/api/backtest/tasks/list', data),
|
||||
}) => apiClient.post('/backtest/tasks/list', data),
|
||||
|
||||
/**
|
||||
* 查询回测任务详情
|
||||
*/
|
||||
detail: (data: { id: number }) => apiClient.post('/api/backtest/tasks/detail', data),
|
||||
detail: (data: { id: number }) => apiClient.post('/backtest/tasks/detail', data),
|
||||
|
||||
/**
|
||||
* 查询回测交易记录
|
||||
@@ -782,16 +782,16 @@ export const backtestService = {
|
||||
taskId: number
|
||||
page: number
|
||||
size: number
|
||||
}) => apiClient.post('/api/backtest/tasks/trades', data),
|
||||
}) => apiClient.post('/backtest/tasks/trades', data),
|
||||
|
||||
/**
|
||||
* 停止回测任务
|
||||
*/
|
||||
stop: (data: { id: number }) => apiClient.post('/api/backtest/tasks/stop', data),
|
||||
stop: (data: { id: number }) => apiClient.post('/backtest/tasks/stop', data),
|
||||
|
||||
/**
|
||||
* 删除回测任务
|
||||
*/
|
||||
delete: (data: { id: number }) => apiClient.post('/api/backtest/tasks/delete', data)
|
||||
delete: (data: { id: number }) => apiClient.post('/backtest/tasks/delete', data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user