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; });