From 6f13184de55705b4c40a210b86cf48fd6e502be3 Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Tue, 4 Jun 2024 14:52:00 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/search/Process.vue | 13 +------------ pages/search/[id].vue | 15 +++------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/components/i/search/Process.vue b/components/i/search/Process.vue index 82c7cf4..f615197 100644 --- a/components/i/search/Process.vue +++ b/components/i/search/Process.vue @@ -68,17 +68,6 @@ function handleCollapse (state) { } watch(() => props.collapse, () => { openCollapse.value = props.collapse -}) -watch( - () => props.item.ansLoading, - (value, oldValue) => { - if (oldValue === undefined && value) { - setTimeout(() => { - handleCollapse(false) - }, 500) - } - }, - { immediate: true } -) +}, { immediate: true}) defineExpose({ handleCollapse }) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index c367b0f..bc0e980 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -141,13 +141,7 @@ const scrollToView = () => { } const handleReGenerate = () => { const { question } = askingData.value - askingData.value = { - question, - desLoading: true - } - nextTick(() => { - askingData.value.collapse = true - }) + askingData.value = { question, desLoading: true, collapse: true } generateFetchData(`根据上述回答,对问题"${question}"重新生成`) } @@ -161,10 +155,7 @@ const createGenerateInitItem = (question) => { if (askingData.value.question) { data.value.push(askingData.value) } - askingData.value = { question, desLoading: true } - nextTick(() => { - askingData.value.collapse = true - }) + askingData.value = { question, desLoading: true, collapse: true } } const handleContinueAsk = (question) => { if (asking.value) return @@ -220,7 +211,7 @@ const handleFormFetchData = (fetchData) => { handleStopGenerate() } if (meta.type === 'answer') { - Object.assign(askingData.value, { ansLoading: true, desLoading: false, searchLoading: false, article: message.choices[0].message.content }) + Object.assign(askingData.value, { ansLoading: true, desLoading: false, searchLoading: false, article: message.choices[0].message.content, collapse: false }) return } if (meta.type !== 'log') return -- GitLab