fix(intelligent-eval): align stat chips so all == sum of states
All checks were successful
CI / test (push) Successful in 3m58s

评估列表:STAT_CHIPS 补 cancelled(已取消 4 条),使 全部18 = 各状态和;
页头 title '智能评估' 统一为 '评估列表'(与菜单一致)。
任务队列:统计条去掉派生的 unresolved(待处理)chip——它与 pending/assigned
重叠重复计数,保留真实四态后 全部8 = 待认领0+执行中1+已完成7+失败0。
tsc 0 错误 vitest 16 passed
This commit is contained in:
sinohqb 2026-08-18 11:03:26 +08:00
parent 2fc3671140
commit 4b66c94969
2 changed files with 4 additions and 3 deletions

View File

@ -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 },

View File

@ -41,13 +41,14 @@ const TASKS_TAB: TabItem = {
key: '/intelligent-evals/tasks', title: '任务队列', icon: <UnorderedListOutlined />, 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 (
<PageWrapper
title="智能评估"
title="评估列表"
description="描述评估目标,由 OpenClaw 自主规划、执行并产出结构化报告"
inline
fullHeight