From eb0b630fbbd11662cb3ed3eda6348d7797cc908a Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 7 Dec 2023 19:28:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E8=AF=9D=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/api/document.ts | 10 +- ui/src/api/log.ts | 37 +++- ui/src/api/type/application.ts | 2 +- ui/src/assets/logo.svg | 20 +- .../components/ai-chat/LogOperationButton.vue | 65 +++++++ ui/src/components/ai-chat/OperationButton.vue | 5 +- ui/src/components/ai-chat/index.vue | 56 ++++-- ui/src/layout/components/top-bar/index.vue | 11 +- ui/src/stores/index.ts | 4 +- ui/src/stores/modules/application.ts | 13 ++ ui/src/stores/modules/document.ts | 24 +++ ui/src/styles/element-plus.scss | 8 + ui/src/views/application/CreateAndSetting.vue | 8 +- .../views/log/component/ChatRecordDrawer.vue | 76 ++++++-- .../views/log/component/EditContentDialog.vue | 172 ++++++++++++++++++ ui/src/views/log/index.vue | 12 +- 16 files changed, 482 insertions(+), 41 deletions(-) create mode 100644 ui/src/components/ai-chat/LogOperationButton.vue create mode 100644 ui/src/stores/modules/document.ts create mode 100644 ui/src/views/log/component/EditContentDialog.vue diff --git a/ui/src/api/document.ts b/ui/src/api/document.ts index 6ee443c2e..2080c562e 100644 --- a/ui/src/api/document.ts +++ b/ui/src/api/document.ts @@ -25,7 +25,7 @@ const listSplitPattern: ( } /** - * 文档列表 + * 文档分页列表 * @param 参数 dataset_id, * page { "current_page": "string", @@ -49,6 +49,13 @@ const getDocument: ( ) } +const getAllDocument: (dataset_id: string, loading?: Ref) => Promise> = ( + dataset_id, + loading +) => { + return get(`${prefix}/${dataset_id}/document`, undefined, loading) +} + /** * 创建批量文档 * @param 参数 @@ -117,6 +124,7 @@ const getDocumentDetail: (dataset_id: string, document_id: string) => Promise +) => Promise> = ( + applicaiton_id, + chart_id, + chart_record_id, + dataset_id, + document_id, + data, + loading +) => { + return put( + `${prefix}/${applicaiton_id}/chat/${chart_id}/chat_record/${chart_record_id}/dataset/${dataset_id}/document_id/${document_id}/improve`, + data, + undefined, + loading + ) +} + export default { getChatLog, delChatLog, - getChatRecordLog + getChatRecordLog, + putChatRecordLog } diff --git a/ui/src/api/type/application.ts b/ui/src/api/type/application.ts index 6e15c8e5d..4728c54f2 100644 --- a/ui/src/api/type/application.ts +++ b/ui/src/api/type/application.ts @@ -23,7 +23,7 @@ interface chatType { */ is_stop?: boolean record_id: string - vote_status: string + vote_status: string, } export class ChatRecordManage { diff --git a/ui/src/assets/logo.svg b/ui/src/assets/logo.svg index 756566035..cf5f3ffb8 100644 --- a/ui/src/assets/logo.svg +++ b/ui/src/assets/logo.svg @@ -1 +1,19 @@ - + + + + + + + + + + + + + + + + + + + diff --git a/ui/src/components/ai-chat/LogOperationButton.vue b/ui/src/components/ai-chat/LogOperationButton.vue new file mode 100644 index 000000000..32d31fe9c --- /dev/null +++ b/ui/src/components/ai-chat/LogOperationButton.vue @@ -0,0 +1,65 @@ + + + diff --git a/ui/src/components/ai-chat/OperationButton.vue b/ui/src/components/ai-chat/OperationButton.vue index aa575adff..35b289735 100644 --- a/ui/src/components/ai-chat/OperationButton.vue +++ b/ui/src/components/ai-chat/OperationButton.vue @@ -71,7 +71,8 @@ const props = defineProps({ chartId: { type: String, default: '' - } + }, + log: Boolean }) const emit = defineEmits(['update:data', 'regeneration']) @@ -79,7 +80,7 @@ const emit = defineEmits(['update:data', 'regeneration']) const buttonData = ref(props.data) const loading = ref(false) -function regeneration() { +function regeneration() { emit('regeneration') } diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 141a9272a..711001170 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -22,7 +22,8 @@ diff --git a/ui/src/views/log/index.vue b/ui/src/views/log/index.vue index 11aab4fa9..6d2e5b883 100644 --- a/ui/src/views/log/index.vue +++ b/ui/src/views/log/index.vue @@ -62,7 +62,7 @@ - +