style: 对齐审核智能体节点与信息卡原型

This commit is contained in:
2026-06-04 00:58:11 +08:00
parent cac9a4aaeb
commit b8381b3ba1
4 changed files with 105 additions and 6 deletions

View File

@@ -72,6 +72,7 @@ def detail(request, conversation_id: str):
)
_persist_notification_records(result)
active_node = "risk"
workspace_summary = _build_workspace_summary(conversation, batch)
return render(
request,
@@ -88,6 +89,7 @@ def detail(request, conversation_id: str):
"task_modes": task_modes,
"node_results": conversation.node_results,
"active_node": active_node,
"workspace_summary": workspace_summary,
},
)
@@ -110,3 +112,20 @@ def _persist_notification_records(result: AgentResult) -> None:
web_detail_url="",
receipt={"status": result.status},
)
def _build_workspace_summary(conversation: Conversation, batch: SubmissionBatch | None) -> dict:
node_status_map = {node.get("label"): node.get("status", "") for node in conversation.node_results}
risk_status = node_status_map.get("风险预警", "待处理")
notify_status = node_status_map.get("飞书通知", "待处理")
export_status = node_status_map.get("Word 回填导出", "待处理")
highest_risk_level = "" if risk_status in {"已阻断", "待复核"} else ""
export_allowed = "" if risk_status in {"已阻断", "待复核"} else ""
return {
"highest_risk_level": highest_risk_level,
"export_allowed": export_allowed,
"notify_status": notify_status,
"export_status": export_status,
"file_count": batch.file_count if batch else 0,
"page_count": batch.page_count if batch else 0,
}