From 4c259cd60fb20c696b98da464e4cc4e12bcc5c4b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 25 May 2024 08:59:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91AI=EF=BC=9A?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E7=AE=A1=E7=90=86=20100%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/chat/conversation/index.ts | 5 + src/api/ai/chat/message/index.ts | 17 +- .../ai/chat/manager/ChatConversationList.vue | 163 ++++++++++++++++ src/views/ai/chat/manager/ChatMessageList.vue | 175 ++++++++++++++++++ src/views/ai/chat/manager/index.vue | 173 +---------------- 5 files changed, 365 insertions(+), 168 deletions(-) create mode 100644 src/views/ai/chat/manager/ChatConversationList.vue create mode 100644 src/views/ai/chat/manager/ChatMessageList.vue diff --git a/src/api/ai/chat/conversation/index.ts b/src/api/ai/chat/conversation/index.ts index 07643255..08ad26a1 100644 --- a/src/api/ai/chat/conversation/index.ts +++ b/src/api/ai/chat/conversation/index.ts @@ -55,5 +55,10 @@ export const ChatConversationApi = { // 获得对话分页 getChatConversationPage: async (params: any) => { return await request.get({ url: `/ai/chat/conversation/page`, params }) + }, + + // 管理员删除消息 + deleteChatConversationByAdmin: async (id: number) => { + return await request.delete({ url: `/ai/chat/conversation/delete-by-admin?id=${id}` }) } } diff --git a/src/api/ai/chat/message/index.ts b/src/api/ai/chat/message/index.ts index 7b46f9c2..f9e807a1 100644 --- a/src/api/ai/chat/message/index.ts +++ b/src/api/ai/chat/message/index.ts @@ -55,7 +55,7 @@ export const ChatMessageApi = { body: JSON.stringify({ conversationId, content, - useContext: enableContext, + useContext: enableContext }), onmessage: onMessage, onerror: onError, @@ -71,7 +71,18 @@ export const ChatMessageApi = { // 删除消息 - 对话所有消息 deleteByConversationId: async (conversationId: string) => { - return await request.delete({ url: `/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}` }) - } + return await request.delete({ + url: `/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}` + }) + }, + // 获得消息分页 + getChatMessagePage: async (params: any) => { + return await request.get({ url: '/ai/chat/message/page', params }) + }, + + // 管理员删除消息 + deleteChatMessageByAdmin: async (id: number) => { + return await request.delete({ url: `/ai/chat/message/delete-by-admin?id=${id}` }) + } } diff --git a/src/views/ai/chat/manager/ChatConversationList.vue b/src/views/ai/chat/manager/ChatConversationList.vue new file mode 100644 index 00000000..23933f01 --- /dev/null +++ b/src/views/ai/chat/manager/ChatConversationList.vue @@ -0,0 +1,163 @@ + + + diff --git a/src/views/ai/chat/manager/ChatMessageList.vue b/src/views/ai/chat/manager/ChatMessageList.vue new file mode 100644 index 00000000..0d841840 --- /dev/null +++ b/src/views/ai/chat/manager/ChatMessageList.vue @@ -0,0 +1,175 @@ + + + diff --git a/src/views/ai/chat/manager/index.vue b/src/views/ai/chat/manager/index.vue index b36fa413..720ac1ea 100644 --- a/src/views/ai/chat/manager/index.vue +++ b/src/views/ai/chat/manager/index.vue @@ -1,174 +1,17 @@