From 98a42074ebf90555e86047d4252a96640fa2b2e0 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 13 Jun 2024 15:15:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=86=E5=8F=B2=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/api/log.ts | 15 ++++++++++++- ui/src/components/ai-chat/index.vue | 1 - ui/src/stores/modules/log.ts | 12 ++++++++++ ui/src/views/chat/embed/index.vue | 27 ++++++++++++++++++---- ui/src/views/chat/pc/index.vue | 35 +++++++++++++++++++++-------- 5 files changed, 75 insertions(+), 15 deletions(-) diff --git a/ui/src/api/log.ts b/ui/src/api/log.ts index 67b88ab8f..de4716a3f 100644 --- a/ui/src/api/log.ts +++ b/ui/src/api/log.ts @@ -186,6 +186,18 @@ const getChatLogClient: ( ) } +/** + * 客户端删除日志 + * @param 参数 application_id, chat_id, + */ +const delChatClientLog: ( + application_id: string, + chat_id: string, + loading?: Ref +) => Promise> = (application_id, chat_id, loading) => { + return del(`${prefix}/${application_id}/chat/client/${chat_id}`, undefined, {}, loading) +} + export default { getChatLog, delChatLog, @@ -195,5 +207,6 @@ export default { getRecordDetail, delMarkRecord, exportChatLog, - getChatLogClient + getChatLogClient, + delChatClientLog } diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index c4522978e..c66739cb2 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -96,7 +96,6 @@ plain size="small" @click="openParagraph(item)" - :disabled="!item.paragraph_list || item.paragraph_list?.length === 0" >引用分段:{{ item.paragraph_list?.length || 0 }} diff --git a/ui/src/stores/modules/log.ts b/ui/src/stores/modules/log.ts index cc08ad303..d7a8d6498 100644 --- a/ui/src/stores/modules/log.ts +++ b/ui/src/stores/modules/log.ts @@ -48,6 +48,18 @@ const useLogStore = defineStore({ reject(error) }) }) + }, + async asyncDelChatClientLog(id: string, chatId: string, loading?: Ref) { + return new Promise((resolve, reject) => { + logApi + .delChatClientLog(id, chatId, loading) + .then((data) => { + resolve(data) + }) + .catch((error) => { + reject(error) + }) + }) } } }) diff --git a/ui/src/views/chat/embed/index.vue b/ui/src/views/chat/embed/index.vue index b2903af23..22b97286b 100644 --- a/ui/src/views/chat/embed/index.vue +++ b/ui/src/views/chat/embed/index.vue @@ -43,9 +43,16 @@ @click="clickListHandle" >