diff --git a/components/i/search/Content.vue b/components/i/search/Content.vue index 004564ac9d6ac637b736e420eee2f2bcb8ac1297..fd42693cfb032f05a2c6cb63db93ce45e9bbf4cb 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()