>(action.payload);
const command = action.kind === "issue_command";
const canDecide = command ? task.permissions.can_decide_commands : task.permissions.can_decide_work_orders;
const canExecute = command ? task.permissions.can_execute_commands : task.permissions.can_execute_work_orders;
- const run = async (kind: "approve" | "reject" | "execute" | "reconcile") => {
+ const run = async (kind: "approve" | "reject" | "execute" | "reconcile" | "save" | "confirm") => {
setSubmitting(kind); setError(null);
try {
- if (kind === "execute") await onExecute(action.action_id, action.version);
+ if (kind === "save") {
+ if (!onDraftUpdate) throw new Error("工单草稿编辑不可用");
+ await onDraftUpdate(action.action_id, action.version, draft);
+ setSavedVersion(action.version);
+ setEditing(false);
+ } else if (kind === "confirm") {
+ if (!onConfirmDispatch) throw new Error("工单确认下发不可用");
+ await onConfirmDispatch(action.action_id, action.version);
+ } else if (kind === "execute") await onExecute(action.action_id, action.version);
else if (kind === "reconcile") await onReconcile(action.action_id, action.version);
else {
if (kind === "reject" && !rejectComment.trim()) {
@@ -397,6 +485,15 @@ function HumanActionCard({ task, action, onDecision, onExecute, onReconcile, onR
{command ? "命令下发确认" : "工单创建确认"}
{approvalLabel(action.approval_status)}{executionLabel(action.execution_status)}
原因:{action.reason}
+ {editing && !command ? : null}
{action.evidence_refs.length > 0 ? (
确认依据
@@ -409,6 +506,7 @@ function HumanActionCard({ task, action, onDecision, onExecute, onReconcile, onR
) : null}
{action.receipt ? : null}
+ {action.execution_detail && !action.receipt ? {action.execution_detail}
: null}
{JSON.stringify(action.payload, null, 2)}
确认版本 v{action.version}。内容或版本变化后必须重新确认。
{error ? {error} 当前状态未按成功处理。
: null}
@@ -416,9 +514,9 @@ function HumanActionCard({ task, action, onDecision, onExecute, onReconcile, onR
{!canDecide && action.approval_status === "pending" ? 当前账号仅可查看,需要具备此动作审批权限的人员确认。
: null}
{action.approval_status === "pending" && canDecide ? setRejectComment(event.target.value)} /> : null}
- {action.approval_status === "pending" && canDecide ? <>> : null}
+ {action.approval_status === "pending" && canDecide ? <>{!command && onDraftUpdate ? : null}> : null}
{action.approval_status === "approved" && action.execution_status === "not_submitted" ? : null}
- {action.approval_status === "approved" && ["submitted", "unknown", "failed", "unsupported"].includes(action.execution_status) ? : null}
+ {action.approval_status === "approved" && ["submitted", "unknown"].includes(action.execution_status) ? : null}