From 44f322bb35ccead50e12068068cf4228c6df41d2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 7 Jul 2024 22:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E8=81=8A=E5=A4=A9=E5=AF=B9=E8=AF=9D=20inde?= =?UTF-8?q?x.vue=20=E4=BB=A3=E7=A0=81=E6=A2=B3=E7=90=86=2030%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/chat/message/index.ts | 6 +- .../conversation/ConversationList.vue | 2 +- .../message/MessageList.vue} | 6 +- .../message/MessageListEmpty.vue} | 0 .../message}/MessageLoading.vue | 0 .../message/MessageNewConversation.vue} | 11 +- .../role/RoleCategoryList.vue | 0 .../index/{ => components}/role/RoleList.vue | 0 .../index/{ => components}/role/index.vue | 2 +- src/views/ai/chat/index/index.vue | 424 ++++++++---------- 10 files changed, 205 insertions(+), 246 deletions(-) rename src/views/ai/chat/index/{Message.vue => components/message/MessageList.vue} (97%) rename src/views/ai/chat/index/{ChatEmpty.vue => components/message/MessageListEmpty.vue} (100%) rename src/views/ai/chat/index/{ => components/message}/MessageLoading.vue (100%) rename src/views/ai/chat/index/{MessageNewChat.vue => components/message/MessageNewConversation.vue} (78%) rename src/views/ai/chat/index/{ => components}/role/RoleCategoryList.vue (100%) rename src/views/ai/chat/index/{ => components}/role/RoleList.vue (100%) rename src/views/ai/chat/index/{ => components}/role/index.vue (99%) diff --git a/src/api/ai/chat/message/index.ts b/src/api/ai/chat/message/index.ts index 90736266..ef1196ac 100644 --- a/src/api/ai/chat/message/index.ts +++ b/src/api/ai/chat/message/index.ts @@ -30,7 +30,7 @@ export const ChatMessageApi = { // 发送 Stream 消息 // 为什么不用 axios 呢?因为它不支持 SSE 调用 - sendStream: async ( + sendChatMessageStream: async ( conversationId: number, content: string, ctrl, @@ -60,11 +60,11 @@ export const ChatMessageApi = { }, // 删除消息 - delete: async (id: string) => { + deleteChatMessage: async (id: string) => { return await request.delete({ url: `/ai/chat/message/delete?id=${id}` }) }, - // 删除消息 - 对话所有消息 + // 删除指定对话的消息 deleteByConversationId: async (conversationId: number) => { return await request.delete({ url: `/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}` diff --git a/src/views/ai/chat/index/components/conversation/ConversationList.vue b/src/views/ai/chat/index/components/conversation/ConversationList.vue index 59874096..911f0fbb 100644 --- a/src/views/ai/chat/index/components/conversation/ConversationList.vue +++ b/src/views/ai/chat/index/components/conversation/ConversationList.vue @@ -98,7 +98,7 @@