From 164613e3e25a152a205fb3cc3e5af05e96b9b383 Mon Sep 17 00:00:00 2001 From: JenniferW <1627055433@qq.com> Date: Mon, 22 Dec 2025 14:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/intention/search.vue | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/views/order/intention/search.vue b/src/views/order/intention/search.vue index 5eb5688..876ba55 100644 --- a/src/views/order/intention/search.vue +++ b/src/views/order/intention/search.vue @@ -2139,14 +2139,23 @@ const buildFieldConditionsPayload = () => { }; } - // 3)只有值(如直接选了某个值,没有字段) + // 3)只有值(没有字段):需要区分是从下拉框选择的还是纯手输的 + // 如果值在 allValues 中存在,说明可能是从下拉框选择的,放在 fieldValue 里 if (!condition.field && condition.value && !condition.fieldLabel) { - return { - fieldName: "", - fieldValue: condition.value, - keyword: "", - queryType, - }; + const isValueFromSuggestion = allValues.value.some( + (item) => String(item.value) === String(condition.value) + ); + + if (isValueFromSuggestion) { + // 从下拉框选择的值,放在 fieldValue 里 + return { + fieldName: "", + fieldValue: condition.value, + keyword: "", + queryType, + }; + } + // 否则继续走方案4,放在 keyword 里 } // 4)其它情况(例如纯手输、无法识别字段),作为关键字查询