feat: 增强规则资产管理与审计页面运行时调试

后端新增规则资产版本管理和规则文件 CRUD 接口,优化风险
规则生成模板执行和员工数据模型字段,知识库 RAG 增强本
地回退和文档提取能力,清理旧风险规则文件统一由生成引擎
管理,前端审计页面增加运行时调试面板和规则资产编辑交互,
补充单元测试覆盖。
This commit is contained in:
caoxiaozhu
2026-05-24 21:44:17 +08:00
parent 575f093c74
commit 50b1c3f9a9
113 changed files with 13896 additions and 5044 deletions

View File

@@ -155,6 +155,53 @@
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.review-submit-test-state,
.risk-rule-action-confirm,
.risk-rule-action-note {
display: grid;
gap: 6px;
padding: 10px 12px;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #f8fafc;
}
.review-submit-test-state span,
.risk-rule-action-confirm span,
.risk-rule-action-note span {
color: #64748b;
font-size: 12px;
font-weight: 800;
}
.review-submit-test-state strong,
.risk-rule-action-confirm strong {
color: #b45309;
font-size: 13px;
font-weight: 850;
}
.review-submit-test-state strong.passed {
color: #047857;
}
.review-submit-test-state p {
margin: 0;
color: #64748b;
font-size: 12px;
line-height: 1.5;
}
.risk-rule-action-note textarea {
width: 100%;
padding: 10px 12px;
border: 1px solid #cbd5e1;
border-radius: 8px;
resize: vertical;
color: #0f172a;
font-size: 13px;
}
.review-submit-hint {
margin: 0;
padding: 10px 12px;
@@ -847,6 +894,41 @@
grid-column: 1 / -1;
}
.risk-rule-create-toggle {
display: flex !important;
align-items: flex-start;
gap: 10px;
padding: 12px;
border: 1px solid #dbe5ef;
border-radius: 10px;
background: #f8fafc;
}
.risk-rule-create-toggle input {
width: 16px;
height: 16px;
margin-top: 3px;
accent-color: #0f766e;
}
.risk-rule-create-toggle span {
display: grid;
gap: 3px;
min-width: 0;
}
.risk-rule-create-toggle strong {
color: #0f172a;
font-size: 13px;
font-weight: 850;
}
.risk-rule-create-toggle small {
color: #64748b;
font-size: 12px;
line-height: 1.5;
}
.risk-rule-create-form label span {
color: #475569;
font-size: 12px;
@@ -949,6 +1031,20 @@
color: #059669;
}
.minor-action.enable-action {
border-color: rgba(100, 116, 139, 0.26);
color: #64748b;
}
.minor-action.enable-action.is-on {
border-color: rgba(5, 150, 105, 0.26);
color: #059669;
}
.minor-action.enable-action i {
font-size: 18px;
}
.minor-action.danger-action {
border-color: rgba(220, 38, 38, 0.2);
color: #dc2626;
@@ -1009,6 +1105,16 @@
color: #fff;
}
.mini-btn.danger {
border-color: rgba(220, 38, 38, 0.24);
color: #dc2626;
}
.mini-btn.warning {
border-color: rgba(245, 158, 11, 0.28);
color: #b45309;
}
@media (max-width: 1320px) {
.detail-hero {
grid-template-columns: 1fr;
@@ -1325,16 +1431,18 @@
padding-bottom: 2px;
}
.json-risk-summary-card,
.json-risk-flow-card,
.json-risk-description-card {
background: #ffffff;
border: 1px solid #e2e8f0;
}
.json-risk-flow-card {
min-width: 0;
overflow: hidden;
}
.json-risk-description-card {
border-color: #fecdd3;
background: linear-gradient(180deg, #fffafb 0%, #ffffff 100%);
}
.json-risk-description-text {
margin: 0;
padding: 0 4px 8px;
@@ -1348,36 +1456,109 @@
.json-risk-description-source {
margin: 0;
padding: 8px 12px 4px;
border-top: 1px solid #ffe4e6;
border-top: 1px solid #e2e8f0;
color: #94a3b8;
font-size: 12px;
line-height: 1.5;
}
.json-risk-summary-grid {
.json-risk-meta-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
column-gap: 36px;
row-gap: 0;
}
.json-risk-summary-grid span {
min-height: 34px;
.json-risk-meta-item {
display: flex;
flex-direction: column;
gap: 4px;
padding: 10px 12px;
border-radius: 10px;
background: #f8fafc;
color: #475569;
font-size: 12px;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #f1f5f9;
font-size: 13px;
min-height: 40px;
}
.json-risk-summary-grid strong {
.json-risk-meta-item.full-width {
grid-column: span 2;
}
.json-risk-meta-label {
width: 84px;
flex-shrink: 0;
color: #64748b;
font-weight: 500;
}
.json-risk-meta-value {
color: #0f172a;
font-weight: 600;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
min-width: 0;
}
.meta-value-hint {
color: #64748b;
font-size: 11.5px;
font-weight: 400;
margin-left: 2px;
}
.json-risk-meta-badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 11px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.04em;
line-height: 1.2;
}
.json-risk-meta-badge.high {
background: #fef2f2;
color: #dc2626;
}
.json-risk-meta-badge.medium {
background: #fff7ed;
color: #ea580c;
}
.json-risk-meta-badge.low {
background: #ecfdf5;
color: #059669;
}
.json-risk-meta-badge.test-passed {
background: #ecfdf5;
color: #047857;
}
.json-risk-meta-badge.test-pending {
background: #fff7ed;
color: #b45309;
}
.meta-status-indicator {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12.5px;
font-weight: 600;
}
.meta-status-indicator .indicator-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #94a3b8;
}
.meta-status-indicator.is-active .indicator-dot {
background: #10b981;
box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}
.json-risk-editor-toolbar {
@@ -1403,9 +1584,12 @@
@media (max-width: 760px) {
.risk-rule-create-form,
.json-risk-summary-grid {
.json-risk-meta-grid {
grid-template-columns: 1fr;
}
.json-risk-meta-item.full-width {
grid-column: span 1;
}
}
@media (max-width: 860px) {
@@ -1417,4 +1601,5 @@
.json-risk-editor-actions {
justify-content: flex-start;
}
}