diff --git a/src/frontend/src/components/TaskModal.tsx b/src/frontend/src/components/TaskModal.tsx index 262f741..b1f587a 100644 --- a/src/frontend/src/components/TaskModal.tsx +++ b/src/frontend/src/components/TaskModal.tsx @@ -41,18 +41,26 @@ const MOCK_EXPERIENCES = [ // ── 常量 ── const STATUS_META: Record = { - pending: { color: '#7a9aff', label: '待认领' }, - claimed: { color: '#a07aff', label: '已认领' }, - working: { color: '#6a9eff', label: '执行中' }, - done: { color: '#2ecc8a', label: '已完成' }, - failed: { color: '#ff5270', label: '失败' }, + pending: { color: '#7a9aff', label: '待认领' }, + claimed: { color: '#a07aff', label: '已认领' }, + working: { color: '#6a9eff', label: '执行中' }, + review: { color: '#818cf8', label: '审查中' }, + done: { color: '#2ecc8a', label: '已完成' }, + failed: { color: '#ff5270', label: '失败' }, + blocked: { color: '#f59e0b', label: '阻塞' }, + cancelled: { color: '#6b7280', label: '已取消' }, }; +// P1: 对齐后端 VALID_TRANSITIONS(db.py) const VALID_TRANSITIONS: Record = { - pending: ['cancelled'], - claimed: ['working', 'cancelled'], - working: ['done', 'failed', 'cancelled'], - failed: ['pending', 'cancelled'], + pending: ['claimed', 'cancelled'], + claimed: ['working', 'pending', 'cancelled'], + working: ['review', 'blocked', 'failed', 'cancelled'], + review: ['done', 'pending', 'failed', 'cancelled'], + blocked: ['pending', 'cancelled'], + failed: ['pending'], + done: [], + cancelled: [], }; const AGENT_EMOJI: Record = { @@ -99,9 +107,12 @@ function SectionLabel({ icon, title, count }: { icon: string; title: string; cou function StatusButtons({ status }: { status: string }) { const transitions = VALID_TRANSITIONS[status] || []; const btnMap: Record = { + claimed: { label: '认领任务', icon: '👤', bg: '#a07aff22', color: '#a07aff', border: '#a07aff44' }, working: { label: '开始执行', icon: '⚔️', bg: '#2ecc8a22', color: '#2ecc8a', border: '#2ecc8a44' }, + review: { label: '提交审查', icon: '🔍', bg: '#818cf822', color: '#818cf8', border: '#818cf844' }, done: { label: '标记完成', icon: '✅', bg: '#2ecc8a22', color: '#2ecc8a', border: '#2ecc8a44' }, failed: { label: '标记失败', icon: '❌', bg: '#ff527022', color: '#ff5270', border: '#ff527044' }, + blocked: { label: '标记阻塞', icon: '🚧', bg: '#f59e0b22', color: '#f59e0b', border: '#f59e0b44' }, pending: { label: '重置待认领', icon: '🔄', bg: '#6a9eff22', color: '#6a9eff', border: '#6a9eff44' }, cancelled: { label: '取消任务', icon: '🚫', bg: '#6b728022', color: '#6b7280', border: '#6b728044' }, }; @@ -164,7 +175,7 @@ export default function TaskModal() { status: 'working', assignee: 'zhangfei-dev', assigned_by: 'pangtong-fujunshi', - priority: 'high', + priority: 7, task_type: 'backtest', created_at: '2026-05-17T08:30:00', updated_at: '2026-05-17T11:20:00', @@ -213,7 +224,7 @@ export default function TaskModal() {
{task.id} {sm.label} - 高优先级 + 紧急优先级
{task.title}