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

@@ -7,6 +7,13 @@ export const RULE_TABLE_COLUMNS = {
metric: '修改人'
}
export const RISK_RULE_TABLE_COLUMNS = {
...RULE_TABLE_COLUMNS,
owner: '审核人',
metric: '发布者',
updatedAt: '发布时间'
}
export const TYPE_META = {
rules: {
assetType: 'rule',
@@ -89,8 +96,8 @@ export const TAB_META = {
typeLabel: '风险规则',
createButtonLabel: '新建风险规则',
hintText: '仅展示平台风险规则;适用场景按差旅、发票、餐饮招待等分类,可用「使用场景」筛选。',
searchPlaceholder: '搜索风险规则名称、编码或负责人',
tableColumns: RULE_TABLE_COLUMNS,
searchPlaceholder: '搜索风险规则名称、编码或审核人',
tableColumns: RISK_RULE_TABLE_COLUMNS,
showRuntimeColumn: false,
showVersionColumn: false,
showStatusColumn: false,
@@ -249,6 +256,18 @@ export const STATUS_OPTIONS = [
{ value: 'disabled', label: '已停用' }
]
export const ONLINE_STATE_OPTIONS = [
{ value: '', label: '全部上线状态' },
{ value: 'online', label: '已上线' },
{ value: 'offline', label: '未上线' }
]
export const ENABLED_STATE_OPTIONS = [
{ value: '', label: '全部启用状态' },
{ value: 'enabled', label: '已启用' },
{ value: 'disabled', label: '已停用' }
]
export const EXPENSE_RULE_BLOCK_PATTERN = /```expense-rule\s*([\s\S]*?)\s*```/i
export const RULE_SPREADSHEET_BLOCK_PATTERN = /```rule-spreadsheet\s*([\s\S]*?)\s*```/i