fix: align case-file rule filters with business types
This commit is contained in:
@@ -53,6 +53,14 @@ function getMessage(payload: unknown, fallback: string): string {
|
||||
}
|
||||
|
||||
function mapApiPackToRuleYamlPack(item: RuleConfigPackApi): RuleYamlPack {
|
||||
const ruleTypeCode = String(item.ruleType || '').trim();
|
||||
const businessType = (() => {
|
||||
const segments = ruleTypeCode.split('.').map(segment => segment.trim()).filter(Boolean);
|
||||
if (segments.length >= 2) {
|
||||
return segments[1];
|
||||
}
|
||||
return item.mainType || item.documentType || '';
|
||||
})();
|
||||
const yamlSource = (item.yamlText || '').trim() ? String(item.yamlText) : EMPTY_RULE_YAML;
|
||||
const sourceStatus = item.sourceStatus || ((item.yamlText || '').trim() ? 'ready' : 'empty');
|
||||
|
||||
@@ -64,6 +72,8 @@ function mapApiPackToRuleYamlPack(item: RuleConfigPackApi): RuleYamlPack {
|
||||
moduleType: item.moduleType || (item.documentType ? `${item.documentType}评查` : '规则配置'),
|
||||
mainType: item.mainType || item.documentType || '',
|
||||
subtype: item.subtype || '通用',
|
||||
businessType,
|
||||
ruleTypeCode,
|
||||
},
|
||||
yamlSource,
|
||||
sourceStatus,
|
||||
|
||||
Reference in New Issue
Block a user