diff --git a/frontend/src/api/backtest.ts b/frontend/src/api/backtest.ts index 725b92d..82a77f8 100644 --- a/frontend/src/api/backtest.ts +++ b/frontend/src/api/backtest.ts @@ -105,6 +105,9 @@ export interface TaskListItem { start: string end: string instance?: string + created_at?: string + finished_at?: string + duration_s?: number | null } export async function getTasks(type?: string): Promise { @@ -112,6 +115,27 @@ export async function getTasks(type?: string): Promise { return data.tasks } +export interface TaskParamsInfo { + task_id: string + type: string + status: string + strategy: string + symbol: string + params: Record + start: string + end: string +} + +export async function getTaskParams(taskId: string): Promise { + const { data } = await apiClient.get(`/task/${taskId}/params`) + return data +} + +export async function deleteTask(taskId: string): Promise<{ deleted: number }> { + const { data } = await apiClient.delete<{ deleted: number }>(`/task/${taskId}`) + return data +} + export interface OptimizeSubmit { symbol: string strategy: string diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index f26d5ad..78179b6 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -33,7 +33,7 @@ const quickActions = [ { label: '新建回测', desc: 'CTA 策略历史回测', path: '/backtest/new', mark: 'BT' }, { label: '因子分析', desc: 'IC / 分层回测', path: '/factor/new', mark: 'FA' }, { label: '新建模拟盘', desc: '回放 / 实盘模式', path: '/paper/new', mark: 'PA' }, - { label: '历史任务', desc: '全部回测记录', path: '/backtest/history', mark: 'HI' }, + { label: '任务列表', desc: '全部回测记录', path: '/backtest/history', mark: 'HI' }, ] as const function go(path: string): void { diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index 3ae0122..5cc6cad 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -25,7 +25,7 @@ const PAGE_TITLE: Array<{ match: RegExp; group: string; title: string }> = [ { match: /^\/backtest\/new$/, group: '回测', title: '个股回测' }, { match: /^\/backtest\/portfolio$/, group: '回测', title: '组合回测' }, { match: /^\/backtest\/optimize$/, group: '回测', title: '参数优化' }, - { match: /^\/backtest\/history$/, group: '回测', title: '历史任务' }, + { match: /^\/backtest\/history$/, group: '回测', title: '任务列表' }, { match: /^\/backtest\/progress\//, group: '回测', title: '任务进度' }, { match: /^\/backtest\/result\//, group: '回测', title: '回测结果' }, { match: /^\/factor\/new$/, group: '投研', title: '因子分析' }, @@ -64,7 +64,7 @@ const CMD_ITEMS: CmdItem[] = [ { label: '个股回测', group: '回测', path: '/backtest/new' }, { label: '组合回测', group: '回测', path: '/backtest/portfolio' }, { label: '参数优化', group: '回测', path: '/backtest/optimize' }, - { label: '历史任务', group: '回测', path: '/backtest/history' }, + { label: '任务列表', group: '回测', path: '/backtest/history' }, { label: '因子分析', group: '投研', path: '/factor/new' }, { label: '模拟盘列表', group: '模拟', path: '/paper' }, { label: '新建模拟盘', group: '模拟', path: '/paper/new' }, @@ -164,7 +164,7 @@ function onLogout(): void { 个股回测 组合回测 参数优化 - 历史任务 + 任务列表 diff --git a/frontend/src/views/backtest/History.vue b/frontend/src/views/backtest/History.vue index f457d70..2ec6fee 100644 --- a/frontend/src/views/backtest/History.vue +++ b/frontend/src/views/backtest/History.vue @@ -1,20 +1,25 @@