From db07346a1814e8da2a69a9ab6ab91ce194e4a7e2 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sun, 17 May 2026 06:16:35 +0800 Subject: [PATCH] auto-sync: 2026-05-17 06:16:35 --- src/frontend/src/components/TaskModal.tsx | 87 +++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/frontend/src/components/TaskModal.tsx diff --git a/src/frontend/src/components/TaskModal.tsx b/src/frontend/src/components/TaskModal.tsx new file mode 100644 index 0000000..56c0176 --- /dev/null +++ b/src/frontend/src/components/TaskModal.tsx @@ -0,0 +1,87 @@ +// 任务详情弹窗 + +import React from 'react'; +import type { Task } from '../types'; + +interface Props { + task: Task | null; + onClose: () => void; +} + +export function TaskModal({ task, onClose }: Props) { + if (!task) return null; + + const fields = [ + ['ID', task.id], + ['标题', task.title], + ['状态', task.status], + ['类型', task.task_type || '-'], + ['负责人', task.assignee || '未分配'], + ['分配者', task.assigned_by], + ['优先级', String(task.priority)], + ['风险级别', task.risk_level || '-'], + ['描述', task.description || '-'], + ['必须完成', task.must_haves || '-'], + ['依赖', task.depends_on || '-'], + ['输出路径', task.output_path || '-'], + ['结果摘要', task.result_summary || '-'], + ['重试', `${task.retry_count}/${task.max_retries}`], + ['创建时间', task.created_at?.substring(0, 19) || '-'], + ['更新时间', task.updated_at?.substring(0, 19) || '-'], + ['完成时间', task.completed_at?.substring(0, 19) || '-'], + ]; + + return ( +
+
e.stopPropagation()} + > +
+

{task.title}

+ +
+ + + + {fields.map(([label, value]) => ( + + + + + ))} + +
+ {label} + + {label === '状态' ? ( + {value} + ) : ( + value + )} +
+
+
+ ); +}