From be529d2f2acee95a74ee3e76d8bd485116076cca Mon Sep 17 00:00:00 2001 From: Wenyan Date: Tue, 25 Nov 2025 18:07:07 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(evaluation):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=85=A8=E9=83=A8=E8=AF=84=E6=9F=A5=E7=82=B9?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=97=B6=E7=9A=84=E7=AD=9B=E9=80=89=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 948e652201f9aff341a2daedae9fa4bd0a43f496. --- app/routes/rules.list.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/routes/rules.list.tsx b/app/routes/rules.list.tsx index 0846831..c00e657 100644 --- a/app/routes/rules.list.tsx +++ b/app/routes/rules.list.tsx @@ -320,16 +320,15 @@ export default function RulesIndex() { } // 构建查询参数 - // 🔑 当选择"全部"或未选择评查点类型时,不传递 ruleType 参数(后端会返回所有类型) + // 🔑 当选择"全部"或未选择评查点类型时,使用下拉框中所有评查点类型的 id 组合 let finalRuleType: string | undefined = undefined; if (ruleTypeParam && ruleTypeParam !== 'all') { // 选择了具体的评查点类型 finalRuleType = ruleTypeParam; - console.log("📋 [fetchData] 选择特定类型:", finalRuleType); - } else { - // 选择"全部"或未选择,不传递参数,让后端返回所有有权限的评查点 - finalRuleType = undefined; - console.log("📋 [fetchData] 选择全部类型,不传递 ruleType 参数"); + } else if (loadedRuleTypes && loadedRuleTypes.length > 0) { + // 选择"全部"或未选择,使用刚加载的评查点类型的 id + finalRuleType = loadedRuleTypes.map(type => type.id).join(','); + console.log("📋 [fetchData] 选择全部类型,使用 loadedRuleTypes 的 id 组合:", finalRuleType); } const queryParams = { @@ -530,14 +529,13 @@ export default function RulesIndex() { type: "warning", confirmText: "删除", cancelText: "取消", - confirmDelay: 4, onConfirm: () => { // 设置删除状态为true setIsDeleting(true); const form = new FormData(); form.append("_action", "delete"); form.append("ruleId", rule.id); - + fetcher.submit(form, { method: "post" }); } }); @@ -607,7 +605,6 @@ export default function RulesIndex() { type: "warning", confirmText: "删除", cancelText: "取消", - confirmDelay: 4, onConfirm: async () => { try { setLoading(true);