From a76ebee61a1457ece3cc6b2008311154aa07d0ef Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 16 Jul 2025 20:12:34 +0800 Subject: [PATCH] feat: chat --- frontend/src/api/chat.ts | 1 + .../src/assets/svg/icon_down_outlined.svg | 3 + frontend/src/assets/svg/icon_up_outlined.svg | 3 + frontend/src/i18n/zh-CN.json | 6 +- frontend/src/views/chat/ChatBlock.vue | 42 -- frontend/src/views/chat/ChatRow.vue | 63 ++- frontend/src/views/chat/RecommendQuestion.vue | 42 +- .../src/views/chat/answer/AnalysisAnswer.vue | 199 +++++++ frontend/src/views/chat/answer/BaseAnswer.vue | 159 ++++++ .../src/views/chat/answer/ChartAnswer.vue | 230 ++++++++ .../src/views/chat/answer/PredictAnswer.vue | 200 +++++++ frontend/src/views/chat/index.vue | 526 ++++++------------ 12 files changed, 1025 insertions(+), 449 deletions(-) create mode 100644 frontend/src/assets/svg/icon_down_outlined.svg create mode 100644 frontend/src/assets/svg/icon_up_outlined.svg delete mode 100644 frontend/src/views/chat/ChatBlock.vue create mode 100644 frontend/src/views/chat/answer/AnalysisAnswer.vue create mode 100644 frontend/src/views/chat/answer/BaseAnswer.vue create mode 100644 frontend/src/views/chat/answer/ChartAnswer.vue create mode 100644 frontend/src/views/chat/answer/PredictAnswer.vue diff --git a/frontend/src/api/chat.ts b/frontend/src/api/chat.ts index def1f3bd..8fd367ed 100644 --- a/frontend/src/api/chat.ts +++ b/frontend/src/api/chat.ts @@ -24,6 +24,7 @@ export interface ChatMessage { isTyping?: boolean first_chat?: boolean recommended_question?: string + index: number } export class ChatRecord { diff --git a/frontend/src/assets/svg/icon_down_outlined.svg b/frontend/src/assets/svg/icon_down_outlined.svg new file mode 100644 index 00000000..67b56222 --- /dev/null +++ b/frontend/src/assets/svg/icon_down_outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/svg/icon_up_outlined.svg b/frontend/src/assets/svg/icon_up_outlined.svg new file mode 100644 index 00000000..268feb0b --- /dev/null +++ b/frontend/src/assets/svg/icon_up_outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 6feea927..66bb2feb 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -82,7 +82,9 @@ "continue_to_ask": "继续提问:", "data_analysis": "数据预测", "data_predict": "数据分析", - "chat_search": "搜索" + "chat_search": "搜索", + "thinking": "思考中", + "thinking_step": "思考过程" }, "ds": { "title": "数据源", @@ -354,4 +356,4 @@ "back_community": "还原至社区版", "confirm_tips": "确定还原至社区版?" } -} \ No newline at end of file +} diff --git a/frontend/src/views/chat/ChatBlock.vue b/frontend/src/views/chat/ChatBlock.vue deleted file mode 100644 index 1fa34cb6..00000000 --- a/frontend/src/views/chat/ChatBlock.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/frontend/src/views/chat/ChatRow.vue b/frontend/src/views/chat/ChatRow.vue index 99da6724..400e50de 100644 --- a/frontend/src/views/chat/ChatRow.vue +++ b/frontend/src/views/chat/ChatRow.vue @@ -1,8 +1,5 @@ diff --git a/frontend/src/views/chat/RecommendQuestion.vue b/frontend/src/views/chat/RecommendQuestion.vue index c8c19cfd..dc705406 100644 --- a/frontend/src/views/chat/RecommendQuestion.vue +++ b/frontend/src/views/chat/RecommendQuestion.vue @@ -37,11 +37,16 @@ function clickQuestion(question: string): void { @@ -49,19 +54,34 @@ function clickQuestion(question: string): void { diff --git a/frontend/src/views/chat/answer/BaseAnswer.vue b/frontend/src/views/chat/answer/BaseAnswer.vue new file mode 100644 index 00000000..cf211e63 --- /dev/null +++ b/frontend/src/views/chat/answer/BaseAnswer.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/frontend/src/views/chat/answer/ChartAnswer.vue b/frontend/src/views/chat/answer/ChartAnswer.vue new file mode 100644 index 00000000..72863475 --- /dev/null +++ b/frontend/src/views/chat/answer/ChartAnswer.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/frontend/src/views/chat/answer/PredictAnswer.vue b/frontend/src/views/chat/answer/PredictAnswer.vue new file mode 100644 index 00000000..bf157092 --- /dev/null +++ b/frontend/src/views/chat/answer/PredictAnswer.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index b91f96b4..3bfac12f 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -99,70 +99,77 @@ />