feat: 增强处理历史详情导出与通知回执展示
This commit is contained in:
@@ -142,3 +142,25 @@ def build_history_rows(logs) -> list[dict]:
|
||||
}
|
||||
)
|
||||
return rows
|
||||
|
||||
|
||||
def build_detail_summary(log: AgentAuditLog, conversation, notifications) -> dict:
|
||||
"""
|
||||
组装处理历史详情页的导出摘要与通知回执信息。
|
||||
|
||||
详情页模板只负责展示,字段拼装与优先级判断统一放在服务层。
|
||||
"""
|
||||
structured_output = log.structured_output or {}
|
||||
export_node = None
|
||||
if conversation and conversation.node_results:
|
||||
export_node = next(
|
||||
(node for node in conversation.node_results if node.get("label") == "Word 回填导出"),
|
||||
None,
|
||||
)
|
||||
latest_notification = notifications.first() if hasattr(notifications, "first") else None
|
||||
return {
|
||||
"export_status": structured_output.get("export_status") or (export_node or {}).get("status", "-"),
|
||||
"download_url": structured_output.get("download_url", ""),
|
||||
"blocked_items": structured_output.get("blocked_items") or [],
|
||||
"notification_receipt": latest_notification.receipt if latest_notification else {},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user