From 260405b517ccdbafce41b8980554fdf974caec02 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 18 十二月 2024 15:16:31 +0800 Subject: [PATCH] reports 取第一个 --- src/components/chat/Chat.vue | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index e087dd5..f73e6b0 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -426,14 +426,22 @@ }; break; + case AnswerType.Report: case AnswerType.Summary: - content = { - type: AnswerType.Summary, - values: res.summary?.map((item) => { - item.reportIsShow = reportIsShow; - return item; - }), - }; + if (res.answer_type === AnswerType.Report) { + content = { + type: AnswerType.Summary, + values: res.reports?.[0]?.summary, + }; + } else { + content = { + type: AnswerType.Summary, + values: res.summary?.map((item) => { + item.reportIsShow = reportIsShow; + return item; + }), + }; + } break; case AnswerType.Url: content = { @@ -562,7 +570,7 @@ // queryProcess(); resetStep(); let lastTimestamp = new Date().getTime(); - questionRes = {}; + questionRes = {}; const resultP = new Promise((resolve, reject) => { const currentSource = axios.CancelToken.source(); @@ -768,7 +776,6 @@ scrollToBottom(); }, 300); } catch (error: any) { - console.log("馃殌 ~ error:", error) // appendLastMessageContent({ // type: AnswerType.Text, // values: '鍙戠敓閿欒锛�', -- Gitblit v1.9.3