diff --git a/src/views/homePage.vue b/src/views/homePage.vue index f408a99..064263e 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -453,19 +453,19 @@ const enableInput = () => { const handleHistorySelect = (stockData) => { console.log("接收到历史记录数据:", stockData); - // 如果当前不在AiEmotion页面,切换到AiEmotion页面 - // if (activeTab.value !== 'AiEmotion') { - // setActiveTab('AiEmotion', 1); - // } - - // 等待组件渲染完成后调用addStock方法 - nextTick(() => { - if (aiEmotionRef.value && aiEmotionRef.value.addStock) { - aiEmotionRef.value.addStock(stockData); - } else { - console.error("AiEmotion组件或addStock方法不可用"); - } - }); + // 只在情绪大模型中处理历史记录选择 + if (activeTab.value === 'AiEmotion') { + // 等待组件渲染完成后调用addStock方法 + nextTick(() => { + if (aiEmotionRef.value && aiEmotionRef.value.addStock) { + aiEmotionRef.value.addStock(stockData); + } else { + console.error("AiEmotion组件或addStock方法不可用"); + } + }); + } else { + console.log("历史记录选择仅在情绪大模型中有效"); + } }; // 公告