From 4b66c9496920b2119fb407e632e63ac61c5fe19f Mon Sep 17 00:00:00 2001 From: sinohqb Date: Tue, 18 Aug 2026 11:03:26 +0800 Subject: [PATCH] fix(intelligent-eval): align stat chips so all == sum of states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 评估列表:STAT_CHIPS 补 cancelled(已取消 4 条),使 全部18 = 各状态和; 页头 title '智能评估' 统一为 '评估列表'(与菜单一致)。 任务队列:统计条去掉派生的 unresolved(待处理)chip——它与 pending/assigned 重叠重复计数,保留真实四态后 全部8 = 待认领0+执行中1+已完成7+失败0。 tsc 0 错误 vitest 16 passed --- .../web/src/components/intelligent_eval/TaskQueueMonitor.tsx | 2 +- frontend/web/src/pages/IntelligentEvals.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/web/src/components/intelligent_eval/TaskQueueMonitor.tsx b/frontend/web/src/components/intelligent_eval/TaskQueueMonitor.tsx index 24c40e1..ff7f713 100644 --- a/frontend/web/src/components/intelligent_eval/TaskQueueMonitor.tsx +++ b/frontend/web/src/components/intelligent_eval/TaskQueueMonitor.tsx @@ -72,9 +72,9 @@ export default function TaskQueueMonitor() { // 全部任务 = 四态之和(不含派生的 unresolved);与后端 stats 对齐 const totalAll = stats ? stats.pending + stats.assigned + stats.completed + stats.failed : allTasks.length + // 统计条只展示真实四态(unresolved 是派生字段,与 pending/assigned 重叠会重复计数) const chipMeta: { key: FilterKey; label: string; color?: string; get: () => number }[] = [ { key: 'all', label: '全部任务', get: () => totalAll }, - { key: 'unresolved', label: '待处理', color: colors.warning, get: () => stats?.unresolved ?? 0 }, { key: 'pending', label: '待认领', get: () => stats?.pending ?? 0 }, { key: 'assigned', label: '执行中', color: colors.primary, get: () => stats?.assigned ?? 0 }, { key: 'completed', label: '已完成', color: statusColors.completed, get: () => stats?.completed ?? 0 }, diff --git a/frontend/web/src/pages/IntelligentEvals.tsx b/frontend/web/src/pages/IntelligentEvals.tsx index df27c9d..7d3dd26 100644 --- a/frontend/web/src/pages/IntelligentEvals.tsx +++ b/frontend/web/src/pages/IntelligentEvals.tsx @@ -41,13 +41,14 @@ const TASKS_TAB: TabItem = { key: '/intelligent-evals/tasks', title: '任务队列', icon: , closable: true, } -// 状态统计条:全部 + 5 个主要状态(cancelled 不单列) +// 状态统计条:全部 + 各状态(含 cancelled,保证 全部 = 各状态之和;draft 为 0 不单列) const STAT_CHIPS: { key: string; label: string; color?: string }[] = [ { key: 'all', label: '全部评估' }, { key: 'planning', label: '规划中' }, { key: 'pending_approval', label: '待审批' }, { key: 'executing', label: '执行中' }, { key: 'completed', label: '已完成', color: statusColors.completed }, + { key: 'cancelled', label: '已取消' }, { key: 'failed', label: '失败', color: statusColors.failed }, ] @@ -200,7 +201,7 @@ export default function IntelligentEvalsPage() { return (