diff --git a/app/api/document-types/document-types.ts b/app/api/document-types/document-types.ts index 8d9ab01..c1e214f 100644 --- a/app/api/document-types/document-types.ts +++ b/app/api/document-types/document-types.ts @@ -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) { diff --git a/app/api/files/files-upload.ts b/app/api/files/files-upload.ts index e9e1ba4..aa90d76 100644 --- a/app/api/files/files-upload.ts +++ b/app/api/files/files-upload.ts @@ -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, diff --git a/app/routes/document-types.new.tsx b/app/routes/document-types.new.tsx index 5451dcb..57db2dc 100644 --- a/app/routes/document-types.new.tsx +++ b/app/routes/document-types.new.tsx @@ -79,6 +79,7 @@ export default function DocumentTypeNew() { rs.ruleType, rs.status, String(rs.id), + String(rs.usableRuleCount || 0), rs.currentVersionId ? String(rs.currentVersionId) : "", rs.fallbackVersionId ? String(rs.fallbackVersionId) : "", ].some((value) => value.toLowerCase().includes(normalizedRuleSetKeyword)); @@ -102,7 +103,7 @@ export default function DocumentTypeNew() { else if (!/^[a-zA-Z][a-zA-Z0-9_.]*$/.test(code.trim())) errs.code = "编码格式:字母开头,可含字母数字._"; if (!name.trim()) errs.name = "名称不能为空"; if (selectedUnavailableRuleSets.length > 0) { - errs.ruleSetIds = "已选择的规则集中包含不可用于上传评查的项,请先发布/回滚可用版本"; + errs.ruleSetIds = "已选择的规则集中包含不可用于上传评查的项,请先确认可用规则数是否正常"; } setErrors(errs); return Object.keys(errs).length === 0; @@ -334,7 +335,7 @@ export default function DocumentTypeNew() { 当前选择里存在不可执行的规则集 {selectedUnavailableRuleSets.map((item) => item.ruleName).join("、")} - {" "}尚未绑定可用版本;若直接上传,后端会拒绝发起评查。 + {" "}当前不可用于评查;若直接上传,后端会拒绝发起评查。 @@ -376,20 +377,20 @@ export default function DocumentTypeNew() { 规则集 ID #{rs.id} {rs.hasUsableVersion - ? `可用版本 ${rs.currentVersionId || rs.fallbackVersionId}` - : "无可用版本"} + ? `可用规则数:${rs.usableRuleCount || 0}` + : "可用规则数:0"} {!rs.hasUsableVersion && (