feat: 增强审核智能体页风险与通知能力卡展示

This commit is contained in:
2026-06-04 02:54:39 +08:00
parent 20f3883b8c
commit 5fdcc31c74
3 changed files with 251 additions and 53 deletions

View File

@@ -88,65 +88,154 @@
<article class="panel">
<h2 class="section-title">节点式结果</h2>
{% if export_card %}
{% if export_card or risk_card or notify_card %}
<div class="stack">
<div class="detail-item">
<strong>Word 导出能力卡</strong>
<div>模板:{{ export_card.template_name }} / {{ export_card.template_version|default:"-" }}</div>
<div>当前导出状态:{{ export_card.export_status|default:"-" }}</div>
</div>
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">回填字段表</h3>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr>
<th>占位符</th>
<th>字段名</th>
<th>字段值</th>
<th>来源</th>
<th>回填状态</th>
<th>是否必填</th>
</tr>
</thead>
<tbody>
{% for item in export_card.filled_fields %}
<tr>
<td>{{ item.placeholder }}</td>
<td>{{ item.field_name }}</td>
<td>{{ item.field_value }}</td>
<td>{{ item.source }}</td>
<td>{{ item.fill_status }}</td>
<td>{{ item.required|yesno:"是,否" }}</td>
</tr>
{% empty %}
<tr><td colspan="6">当前暂无回填字段。</td></tr>
{% endfor %}
</tbody>
</table>
{% if risk_card %}
<div class="detail-item">
<strong>风险预警能力卡</strong>
<div>总风险等级:{{ risk_card.highest_risk_level|default:"-" }}</div>
<div>是否通过:{{ risk_card.pass_status|default:"-" }}</div>
{% if risk_card.summary %}
<div>{{ risk_card.summary }}</div>
{% endif %}
</div>
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">待复核与风险项</h3>
<ul class="detail-list">
{% for item in risk_card.manual_review_items %}
<li class="detail-item">{{ item }}</li>
{% empty %}
{% for item in risk_card.risk_items %}
<li class="detail-item">
<strong>{{ item.title|default:item.issue }}</strong>
<div class="muted">{{ item.risk_level|default:"-" }}</div>
</li>
{% empty %}
<li class="detail-item">当前无待复核项。</li>
{% endfor %}
{% endfor %}
</ul>
</div>
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">责任角色</h3>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr>
<th>owner_role</th>
<th>owner_name</th>
<th>department</th>
<th>chapter_scope</th>
<th>risk_scope</th>
</tr>
</thead>
<tbody>
{% for item in risk_card.owner_roles %}
<tr>
<td>{{ item.owner_role }}</td>
<td>{{ item.owner_name }}</td>
<td>{{ item.department }}</td>
<td>{{ item.chapter_scope }}</td>
<td>{{ item.risk_scope }}</td>
</tr>
{% empty %}
<tr><td colspan="5">当前无责任角色。</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<div class="detail-item">
{% if export_card %}
<strong>Word 导出能力卡</strong>
<div>模板:{{ export_card.template_name }} / {{ export_card.template_version|default:"-" }}</div>
<div>当前导出状态:{{ export_card.export_status|default:"-" }}</div>
{% elif notify_card %}
<strong>飞书通知能力卡</strong>
<div>通知原因:{{ notify_card.notify_reason|default:"-" }}</div>
<div>消息状态:{{ notify_card.message_status|default:"-" }}</div>
{% endif %}
</div>
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">拦截项区</h3>
<ul class="detail-list">
{% for item in export_card.blocked_fields %}
<li class="detail-item">
<strong>{{ item.field_name }}</strong>
<div>拦截原因:{{ item.block_reason }}</div>
<div class="muted">来源:{{ item.risk_source }}</div>
</li>
{% empty %}
<li class="detail-item">当前无拦截项。</li>
{% endfor %}
</ul>
</div>
{% if export_card %}
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">回填字段表</h3>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr>
<th>占位符</th>
<th>字段名</th>
<th>字段值</th>
<th>来源</th>
<th>回填状态</th>
<th>是否必填</th>
</tr>
</thead>
<tbody>
{% for item in export_card.filled_fields %}
<tr>
<td>{{ item.placeholder }}</td>
<td>{{ item.field_name }}</td>
<td>{{ item.field_value }}</td>
<td>{{ item.source }}</td>
<td>{{ item.fill_status }}</td>
<td>{{ item.required|yesno:"是,否" }}</td>
</tr>
{% empty %}
<tr><td colspan="6">当前暂无回填字段。</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if export_card %}
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">拦截项区</h3>
<ul class="detail-list">
{% for item in export_card.blocked_fields %}
<li class="detail-item">
<strong>{{ item.field_name }}</strong>
<div>拦截原因:{{ item.block_reason }}</div>
<div class="muted">来源:{{ item.risk_source }}</div>
</li>
{% empty %}
<li class="detail-item">当前无拦截项。</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if notify_card %}
<div class="panel" style="padding: 14px;">
<h3 class="section-title" style="font-size: 1rem;">飞书通知能力卡</h3>
<ul class="detail-list">
<li class="detail-item"><strong>通知原因</strong><div>{{ notify_card.notify_reason|default:"-" }}</div></li>
<li class="detail-item"><strong>消息状态</strong><div>{{ notify_card.message_status|default:"-" }}</div></li>
<li class="detail-item"><strong>被 @ 处理人</strong><div>{{ notify_card.mentioned_users|join:" / "|default:"-" }}</div></li>
<li class="detail-item"><strong>Web 详情链接</strong><div>{{ notify_card.web_detail_url|default:"-" }}</div></li>
</ul>
</div>
{% endif %}
<div class="button-row">
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=template_mappings">维护 Word 模板</a>
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=field_schemas">维护字段映射</a>
<a class="button" href="{% url 'audit:list' %}">查看导出记录</a>
{% if export_card %}
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=template_mappings">维护 Word 模板</a>
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=field_schemas">维护字段映射</a>
<a class="button" href="{% url 'audit:list' %}">查看导出记录</a>
{% endif %}
{% if risk_card %}
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=owner_mappings">查看责任人映射</a>
{% endif %}
{% if notify_card %}
<a class="button" href="{% url 'platform_ui:knowledge-base' %}?view=feishu_configs">查看飞书配置</a>
{% endif %}
</div>
</div>
{% elif result and result.structured_output %}