style: 对齐审核智能体节点与信息卡原型
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user