From 7458beb8b2202a1fe7990691535e1f3af3ad9a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Fri, 17 Apr 2026 10:56:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9F=A5=E8=AF=A2=E9=A2=86?= =?UTF-8?q?=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoPromotionWizardContent.vue | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/page/components/autoPromotion/AutoPromotionWizardContent.vue b/src/components/page/components/autoPromotion/AutoPromotionWizardContent.vue index 5678b7c..5e14cd8 100644 --- a/src/components/page/components/autoPromotion/AutoPromotionWizardContent.vue +++ b/src/components/page/components/autoPromotion/AutoPromotionWizardContent.vue @@ -191,13 +191,26 @@ export default { } }, sortedFilteredFields() { - const kw = (this.fieldSearchText || '').trim().toLowerCase(); - const list = (this.availableFields || []).filter((item) => { - if (!kw) return true; - return String(item.label || '').toLowerCase().includes(kw); - }); - return list.slice().sort((a, b) => String(a.label || '').localeCompare(String(b.label || ''))); - }, + const kwRaw = String(this.fieldSearchText || ''); + const normalize = (s) => + String(s || '') + .trim() + .replace(/\s+/g, ' ') + .toLowerCase(); + const tokens = kwRaw + ? kwRaw + .split(/[\r\n,,;;]+/g) + .map((s) => normalize(s)) + .filter(Boolean) + : []; + const list = (this.availableFields || []).filter((item) => { + if (!tokens.length) return true; + const label = normalize(item.label || ''); + // 严格匹配:必须与字段名完全一致(忽略大小写与空白差异) + return tokens.some((t) => t === label); + }); + return list.slice().sort((a, b) => String(a.label || '').localeCompare(String(b.label || ''))); + }, selectedFieldLabels() { const map = {}; (this.availableFields || []).forEach((i) => { map[String(i.id)] = i.label; });