- 知识源管理 - 传统 CRUD 列表,直接在表格里做查看、编辑、删除。 + RAG 文档源 + 支持法规、模板与业务资料分层管理。 @@ -72,32 +77,16 @@ 类型 范围 状态 - 负责人 - 更新时间 - 操作 {% for source in knowledge_sources %} - {{ source.code }} - {{ source.name }} - {{ source.type }} - {{ source.scope }} - - - {{ source.status }} - - - {{ source.owner }} - {{ source.updated_at }} - - - 查看 - 编辑 - 删除 - - + {{ source.code }} + {{ source.name }} + {{ source.type }} + {{ source.scope }} + {{ source.status }} {% endfor %} @@ -105,73 +94,69 @@
- {{ knowledge_form.title }} - - {% for field in knowledge_form.fields %} - - {{ field.label }} - - - {% endfor %} - - 保存知识源 - 重置 - - -
- 规则项管理 - 规则项也用传统表格管理,支持新增、编辑、删除。 + RAG 切片 + 展示切片摘要、章节与召回状态。 - 编码 + 切片 ID + 文档 章节 - 规则名称 - 模板字段 + 摘要 状态 - 操作 - {% for item in rule_tree %} + {% for chunk in rag_chunks %} - {{ item.code }} - {{ item.chapter }} - {{ item.item }} - {{ item.field }} - - - {{ item.status }} - - - - - 查看 - 编辑 - 删除 - - + {{ chunk.chunk_id }} + {{ chunk.document_name }} + {{ chunk.chapter }} + {{ chunk.summary }} + {{ chunk.status }} + + {% endfor %} + + + +
+ + + 字段 Schema + 维护强一致字段、回填字段和来源优先级。 + + + + + + + 字段编码 + 字段名称 + 类型 + 可回填 + 强一致 + 状态 + + + + {% for field in field_schemas %} + + {{ field.field_code }} + {{ field.field_name }} + {{ field.field_type }} + {{ field.fillable }} + {{ field.strict_consistency }} + {{ field.status }} {% endfor %} @@ -180,19 +165,77 @@ - {{ rule_form.title }} - - {% for field in rule_form.fields %} - - {{ field.label }} - - - {% endfor %} - - 保存规则项 - 删除规则项 + + + 责任人映射 + 责任人实体字段直接按通知载荷口径展示。 + + + + + owner_role + owner_name + department + chapter_scope + risk_scope + feishu_user_id + feishu_open_id + feishu_name + notify_enabled + + + + {% for item in owner_mappings %} + + {{ item.owner_role }} + {{ item.owner_name }} + {{ item.department }} + {{ item.chapter_scope }} + {{ item.risk_scope }} + {{ item.feishu_user_id }} + {{ item.feishu_open_id }} + {{ item.feishu_name }} + {{ item.notify_enabled }} + + {% endfor %} + + + + + + + + 飞书通知配置 + V1 Demo 固定支持 `task_completed` 与 `task_failed` 两类通知。 + + + + + + + 配置名称 + notify_reason + 渠道 + 消息模板 + 状态 + + + + {% for item in feishu_configs %} + + {{ item.config_name }} + {{ item.notify_reason }} + {{ item.channel }} + {{ item.message_template }} + {{ item.status }} + + {% endfor %} + + + + {% endblock %} diff --git a/tests/test_platform_ui.py b/tests/test_platform_ui.py new file mode 100644 index 0000000..934df90 --- /dev/null +++ b/tests/test_platform_ui.py @@ -0,0 +1,32 @@ +from django.urls import reverse + + +def test_knowledge_base_page_shows_governance_sections(client): + response = client.get(reverse("platform_ui:knowledge-base")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "法规规则包" in content + assert "RAG 文档源" in content + assert "RAG 切片" in content + assert "字段 Schema" in content + assert "责任人映射" in content + assert "飞书通知配置" in content + + +def test_knowledge_base_page_shows_owner_mapping_fields_and_notify_reasons(client): + response = client.get(reverse("platform_ui:knowledge-base")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "owner_role" in content + assert "owner_name" in content + assert "department" in content + assert "chapter_scope" in content + assert "risk_scope" in content + assert "feishu_user_id" in content + assert "feishu_open_id" in content + assert "feishu_name" in content + assert "notify_enabled" in content + assert "task_completed" in content + assert "task_failed" in content diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 1438fb9..130ee18 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -127,3 +127,14 @@ audit: assert "有效场景" in content assert "配置异常" in content assert "invalid.yaml" in content + + +def test_home_page_uses_four_top_level_product_entries(client): + response = client.get("/") + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "审核智能体" in content + assert "资料包" in content + assert "知识库" in content + assert "处理历史" in content
- {{ rule_form.title }} - - {% for field in rule_form.fields %} - - {{ field.label }} - - - {% endfor %} - - 保存规则项 - 删除规则项 + + + 责任人映射 + 责任人实体字段直接按通知载荷口径展示。 + + + + + owner_role + owner_name + department + chapter_scope + risk_scope + feishu_user_id + feishu_open_id + feishu_name + notify_enabled + + + + {% for item in owner_mappings %} + + {{ item.owner_role }} + {{ item.owner_name }} + {{ item.department }} + {{ item.chapter_scope }} + {{ item.risk_scope }} + {{ item.feishu_user_id }} + {{ item.feishu_open_id }} + {{ item.feishu_name }} + {{ item.notify_enabled }} + + {% endfor %} + + + + + + + + 飞书通知配置 + V1 Demo 固定支持 `task_completed` 与 `task_failed` 两类通知。 + + + + + + + 配置名称 + notify_reason + 渠道 + 消息模板 + 状态 + + + + {% for item in feishu_configs %} + + {{ item.config_name }} + {{ item.notify_reason }} + {{ item.channel }} + {{ item.message_template }} + {{ item.status }} + + {% endfor %} + + + + {% endblock %} diff --git a/tests/test_platform_ui.py b/tests/test_platform_ui.py new file mode 100644 index 0000000..934df90 --- /dev/null +++ b/tests/test_platform_ui.py @@ -0,0 +1,32 @@ +from django.urls import reverse + + +def test_knowledge_base_page_shows_governance_sections(client): + response = client.get(reverse("platform_ui:knowledge-base")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "法规规则包" in content + assert "RAG 文档源" in content + assert "RAG 切片" in content + assert "字段 Schema" in content + assert "责任人映射" in content + assert "飞书通知配置" in content + + +def test_knowledge_base_page_shows_owner_mapping_fields_and_notify_reasons(client): + response = client.get(reverse("platform_ui:knowledge-base")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "owner_role" in content + assert "owner_name" in content + assert "department" in content + assert "chapter_scope" in content + assert "risk_scope" in content + assert "feishu_user_id" in content + assert "feishu_open_id" in content + assert "feishu_name" in content + assert "notify_enabled" in content + assert "task_completed" in content + assert "task_failed" in content diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 1438fb9..130ee18 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -127,3 +127,14 @@ audit: assert "有效场景" in content assert "配置异常" in content assert "invalid.yaml" in content + + +def test_home_page_uses_four_top_level_product_entries(client): + response = client.get("/") + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "审核智能体" in content + assert "资料包" in content + assert "知识库" in content + assert "处理历史" in content