From ef124255e0e9caf9ce728896d1dd0ec6cfeb45b5 Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Fri, 24 May 2024 10:02:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=AD=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=90=9C=E7=B4=A2=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/search/[id].vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index 4e5c1ac..9f3524c 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -15,6 +15,7 @@ { generateFetchData(question) } -// todo 唯一key const data = ref([]) const askingData = ref({ question: state.query, desLoading: true }) const recommendQuestions = ref([]) const askingRef = ref(null) +const historyAskRefs = ref([]) // git url const baseGitUrl = computed(() => { const endWidthGit = state.gitPath.endsWith('.git') @@ -119,9 +120,19 @@ let asking = ref(false) // 处理ai generate let aiChatController = null // 用户取消操作方法 const markedEnd = '[DONE]' +const handleCloseHistoryAsk = () => { + historyAskRefs.value.forEach(item => { + if (item && item.handleCollapse) { + item.handleCollapse(false) + } + }) +} const createGenerateInitItem = (question) => { data.value.push(askingData.value) - askingData.value = { question, desLoading: true } + nextTick(() => { + handleCloseHistoryAsk() + askingData.value = { question, desLoading: true } + }) } const handleContinueAsk = (question) => { if (asking.value) return -- GitLab