feat: show usable rule counts
This commit is contained in:
@@ -43,6 +43,7 @@ export interface RuleSetOption {
|
||||
currentVersionId?: number | null;
|
||||
fallbackVersionId?: number | null;
|
||||
hasUsableVersion?: boolean;
|
||||
usableRuleCount?: number;
|
||||
}
|
||||
|
||||
export interface EntryModuleOption {
|
||||
@@ -264,6 +265,7 @@ export async function getRuleSets(
|
||||
currentVersionId: r.currentVersionId ?? null,
|
||||
fallbackVersionId: r.fallbackVersionId ?? null,
|
||||
hasUsableVersion: !!r.hasUsableVersion,
|
||||
usableRuleCount: Number(r.usableRuleCount || 0),
|
||||
})),
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
@@ -360,20 +360,20 @@ export function buildUploadErrorDetails(
|
||||
if (ruleSetDisplayName || payloadRuleSetId) {
|
||||
detailLines.push(`疑似异常规则集:${ruleSetDisplayName || `规则集 ID ${payloadRuleSetId}`}`);
|
||||
} else if (documentType?.ruleSetIds && documentType.ruleSetIds.length > 1) {
|
||||
detailLines.push('该文档类型绑定了多个规则集,需要逐个确认是否都已发布可用版本。');
|
||||
detailLines.push('该文档类型绑定了多个规则集,需要逐个确认可用规则数是否正常。');
|
||||
} else {
|
||||
detailLines.push('后端没有返回具体规则集名称,建议优先检查该文档类型绑定的规则集是否已发布版本。');
|
||||
detailLines.push('后端没有返回具体规则集名称,建议优先检查该文档类型绑定的规则集是否存在可用规则。');
|
||||
}
|
||||
|
||||
detailLines.push(`后端返回:${message}`);
|
||||
|
||||
return {
|
||||
title: '审核规则未配置完整',
|
||||
summary: `${documentTypeDisplayName} 目前没有可用的审核规则版本,所以系统无法接收本次上传。`,
|
||||
summary: `${documentTypeDisplayName} 目前没有可用的审核规则,所以系统无法接收本次上传。`,
|
||||
detailLines,
|
||||
actionLines: [
|
||||
'到“系统设置 / 文档类型管理”检查该文档类型是否绑定了正确的规则集。',
|
||||
'到“规则管理 / 规则集管理”确认对应规则集至少有一个已发布、可用的版本。',
|
||||
'到“规则管理 / 规则集管理”确认对应规则集的可用规则数是否正常。',
|
||||
'如果首页入口也异常,请同时到“系统设置 / 入口模块管理”检查入口模块绑定。',
|
||||
],
|
||||
rawMessage: message,
|
||||
@@ -391,11 +391,11 @@ export function buildUploadErrorDetails(
|
||||
];
|
||||
|
||||
return {
|
||||
title: '规则集版本不可用',
|
||||
summary: '当前上传入口关联的规则集或规则版本不可用,文件无法开始审核。',
|
||||
title: '规则集不可用',
|
||||
summary: '当前上传入口关联的规则集不可用,文件无法开始审核。',
|
||||
detailLines,
|
||||
actionLines: [
|
||||
'到“规则管理 / 规则集管理”检查对应规则集是否存在、是否已发布版本。',
|
||||
'到“规则管理 / 规则集管理”检查对应规则集是否存在、可用规则数是否正常。',
|
||||
'如文档类型绑定了错误的规则集,请到“系统设置 / 文档类型管理”修正绑定关系。',
|
||||
],
|
||||
rawMessage: message,
|
||||
|
||||
Reference in New Issue
Block a user