diff --git a/ui/src/views/chat/component/HistoryPanel.vue b/ui/src/views/chat/component/HistoryPanel.vue index c504be346..d134d9918 100644 --- a/ui/src/views/chat/component/HistoryPanel.vue +++ b/ui/src/views/chat/component/HistoryPanel.vue @@ -40,11 +40,7 @@
{{ $t('chat.history') }} - - + @@ -118,8 +114,7 @@
{{ $t('chat.history') }} - - + @@ -178,16 +173,14 @@ import { ref } from 'vue' import { isAppIcon } from '@/utils/common' import EditTitleDialog from './EditTitleDialog.vue' -import useStore from '@/stores' -const { common, chatUser } = useStore() const props = defineProps<{ applicationDetail: any chatLogData: any[] - leftLoading: boolean + leftLoading?: boolean currentChatId: string isPcCollapse?: boolean }>() -const emit = defineEmits(['newChat', 'clickLog', 'deleteLog', 'refreshFieldTitle','clearChat']) +const emit = defineEmits(['newChat', 'clickLog', 'deleteLog', 'refreshFieldTitle', 'clearChat']) const EditTitleDialogRef = ref() diff --git a/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue b/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue index 7d2c81b17..180d21da8 100644 --- a/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue +++ b/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue @@ -8,11 +8,7 @@ :size="280" style="--el-drawer-padding-primary: 0" > - + @@ -26,6 +22,7 @@ @clickLog="handleClickList" @delete-log="deleteChatLog" @refreshFieldTitle="refreshFieldTitle" + @clear-chat="clearChat" >
@@ -124,6 +125,16 @@ const customStyle = computed(() => { } }) +function clearChat() { + chatAPI.clearChat(left_loading).then(() => { + currentChatId.value = 'new' + paginationConfig.current_page = 1 + paginationConfig.total = 0 + currentRecordList.value = [] + getChatLog(applicationDetail.value.id) + }) +} + function deleteLog(row: any) { chatAPI.deleteChat(row.id, left_loading).then(() => { if (currentChatId.value === row.id) { diff --git a/ui/src/views/chat/mobile/component/ChatHistoryDrawer.vue b/ui/src/views/chat/mobile/component/ChatHistoryDrawer.vue index dbc03911a..466167e5c 100644 --- a/ui/src/views/chat/mobile/component/ChatHistoryDrawer.vue +++ b/ui/src/views/chat/mobile/component/ChatHistoryDrawer.vue @@ -17,6 +17,7 @@ @clickLog="handleClickList" @delete-log="deleteChatLog" @refreshFieldTitle="refreshFieldTitle" + @clear-chat="clearChat" >