diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue index 273fcdb..f3ab942 100644 --- a/src/views/Jyh/AI/Home/index.vue +++ b/src/views/Jyh/AI/Home/index.vue @@ -40,7 +40,7 @@
- + 猜你想问 @@ -251,6 +251,7 @@ const getAIAnswer = async (content) => { avatarPosition: 'side-left', avatarConfig: { ...aiModelAvatar }, loading: true, + question: content }); const response = await axios.post(`${VITE_AI_API_HOST}/api/v0/chat_use_sql`, { @@ -261,7 +262,7 @@ const getAIAnswer = async (content) => { if(response.data.type) { const {text,type,id} = response.data; - + messages.value[messages.value.length - 1].id = id; if(type==='text') { messages.value[messages.value.length - 1].content = text; messages.value[messages.value.length - 1].loading = false; @@ -365,6 +366,15 @@ const fetchFollowupQuestions = async (question,df_id,sql_id='') => { }); }; +// 刷新猜你想问 +const handleResetQuestions = () => { + const lastItem = messages.value[messages.value.length - 1] + if(lastItem.role = 'system') { + debugger + fetchFollowupQuestions(lastItem.question,lastItem.id); // 调用详情接口 + } +}; + const handleSelectConv = (convId: string) => { CONV_ID.value = convId; // 更新为选中的会话 ID getConversationDetail(convId); // 调用详情接口