diff --git a/src/views/components/HistoryRecord.vue b/src/views/components/HistoryRecord.vue index 8d1c1a6..b9d59a5 100644 --- a/src/views/components/HistoryRecord.vue +++ b/src/views/components/HistoryRecord.vue @@ -750,8 +750,12 @@ const selectRecord = async (record) => { } dataStore.isFeedback = false; historyData.value = result.data; - chatStore.dbqbClickRecord = historyData.value; - deepNineStore.dbqbClickRecord = historyData.value; + if (props.currentType == "AIchat") { + chatStore.dbqbClickRecord = historyData.value; + } + if (props.currentType == "deepNine") { + deepNineStore.dbqbClickRecord = historyData.value; + } // 构造股票数据对象,保持与现有结构一致 const stockData = { queryText: result.data.keyword, // 使用记录中的keyword字段作为查询文本 diff --git a/src/views/deepNine.vue b/src/views/deepNine.vue index c654723..fc073bf 100644 --- a/src/views/deepNine.vue +++ b/src/views/deepNine.vue @@ -2181,6 +2181,7 @@ watch( content: "该内容由AI生成,请注意甄别", end: true, }); + } catch (e) { ElMessage.error("历史数据获取出错!"); console.error("e", e); diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 2ed67b4..83974ff 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -820,7 +820,7 @@ watch( }, { deep: false, immediate: true } ); - +// 监听-当点击夺宝奇兵大模型的历史记录时,滚动到顶部 watch( () => chatStore.dbqbClickRecord, async (newValue, oldValue) => { @@ -831,6 +831,17 @@ watch( container.scrollTop = 0; } ); +// 监听-当点击深度九大模型的历史记录时,滚动到顶部 +watch( + () => deepNineStore.dbqbClickRecord, + async (newValue, oldValue) => { + const container = getCurrentScrollContainer(); + if (!container) return; + + await nextTick(); // 确保在DOM更新后执行 + container.scrollTop = 0; + } +); watch( () => chatStore.dbqbScrollToTop,