From bb0e1c7e94edc4070c55b90bab6bea6fd296f59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Thu, 17 Jul 2025 10:00:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(property-marketing):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8A=95=E8=B5=84=E6=8C=87=E5=8D=97=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改搜索事件处理逻辑,提取公共代码到 handleSearch 方法 - 在搜索后添加 AI 结果获取逻辑 - 优化页面加载和搜索后的数据处理流程 --- .../investment-guidelines/index.vue | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/views/property-marketing/put-account/investment-guidelines/index.vue b/src/views/property-marketing/put-account/investment-guidelines/index.vue index 9b9eb51..1bb9d3b 100644 --- a/src/views/property-marketing/put-account/investment-guidelines/index.vue +++ b/src/views/property-marketing/put-account/investment-guidelines/index.vue @@ -19,7 +19,7 @@ class="ignore-export" @onReset="handleReset" v-model:query="query" - @onSearch="onSearch" + @onSearch="handleSearch" :disabled="loading" > @@ -29,6 +29,7 @@ @onSearch="onSearch" @updateQuery="handleUpdateQuery" /> +
+ - - +
@@ -132,12 +136,9 @@ const onSearch = async () => { let result; if (tabData.value === 'placement_guide') { result = await getPlacementGuide(query); + console.log(1); + placementGuideList.value = result?.data?.data || []; - if (placementGuideList.value.length > 0 && isGetAi.value) { - loading.value = true; - syncGetAiResult(); - startTask(); - } } else { result = await getPlacementGuideHistory(query); guideHistoryList.value = result?.data?.data || []; @@ -145,6 +146,16 @@ const onSearch = async () => { listData.total = result.data.total; isGetAi.value = true; }; + +const handleSearch = async () => { + await onSearch(); + if (placementGuideList.value.length > 0 && isGetAi.value) { + loading.value = true; + syncGetAiResult(); + startTask(); + } +}; + const aiResult = reactive({ optimization: [], // 投放建议优化 action_guide: [], // 新投放建议生成