From c8f6a21bf3b8fab8e305a8afaade4c20fddb887c Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Tue, 4 Jun 2024 14:39:53 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E4=BC=98=E5=8C=96process=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/search/Content.vue | 6 +++++- components/i/search/Process.vue | 3 +++ pages/search/[id].vue | 22 +++++----------------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/components/i/search/Content.vue b/components/i/search/Content.vue index 004564a..fd42693 100644 --- a/components/i/search/Content.vue +++ b/components/i/search/Content.vue @@ -1,4 +1,5 @@ @@ -27,10 +27,10 @@
- @@ -66,10 +66,8 @@ const state = reactive({ const historyStatus = ref(200) const data = ref([]) -const askingData = ref({ question: $setFirstRecordTitle.value, desLoading: true }) +const askingData = ref({ question: $setFirstRecordTitle.value, desLoading: true, collapse: true }) const recommendQuestions = ref([]) -const askingRef = ref(null) -const historyAskRefs = ref([]) let asking = ref(false) // 处理ai generate let aiChatController = null // 用户取消操作方法 @@ -148,7 +146,7 @@ const handleReGenerate = () => { desLoading: true } nextTick(() => { - askingRef.value && askingRef.value.handleCollapse(true) + askingData.value.collapse = true }) generateFetchData(`根据上述回答,对问题"${question}"重新生成`) } @@ -159,20 +157,13 @@ function baseGitUrl() { return endWidthGit ? state.gitPath.slice(0, state.gitPath.length - 4) : state.gitPath } -const handleCloseHistoryAsk = () => { - historyAskRefs.value.forEach(item => { - if (item && item.handleCollapse) { - item.handleCollapse(false) - } - }) -} const createGenerateInitItem = (question) => { if (askingData.value.question) { data.value.push(askingData.value) } askingData.value = { question, desLoading: true } nextTick(() => { - handleCloseHistoryAsk() + askingData.value.collapse = true }) } const handleContinueAsk = (question) => { @@ -181,9 +172,6 @@ const handleContinueAsk = (question) => { // 清空相关文件数据 recommendQuestions.value = [] createGenerateInitItem(question) - nextTick(() => { - askingRef.value && askingRef.value.handleCollapse(true) - }) generateFetchData(question) setTimeout(() => { scrollToView() -- GitLab