From f34556b35b8b262a7199b198d57616c3b9d884d4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 26 Jul 2025 17:03:51 +0800 Subject: [PATCH] perf: Assistant empty chat --- frontend/src/views/chat/ChatListContainer.vue | 10 +++- frontend/src/views/chat/index.vue | 50 ++++++++++++++----- frontend/src/views/embedded/index.vue | 4 +- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/frontend/src/views/chat/ChatListContainer.vue b/frontend/src/views/chat/ChatListContainer.vue index 3618c47c..f8a54a81 100644 --- a/frontend/src/views/chat/ChatListContainer.vue +++ b/frontend/src/views/chat/ChatListContainer.vue @@ -114,9 +114,17 @@ function goEmpty(func?: (...p: any[]) => void, ...params: any[]) { const createNewChat = async () => { goEmpty(doCreateNewChat) } - +const isAssistantRepeatEmpty = () => { + return ( + isAssistant.value && + (_currentChatId.value === null || typeof _currentChatId.value === 'undefined') + ) +} async function doCreateNewChat() { if (isAssistant.value) { + if (isAssistantRepeatEmpty()) { + return + } const assistantChat = await assistantStore.setChat() if (assistantChat) { onChatCreated(assistantChat) diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index bf3334f5..f8b21d5e 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -58,7 +58,10 @@
@@ -66,11 +69,16 @@ - {{ t('qa.greeting') }} + {{ isAssistant ? t('embedded.i_am_sqlbot') : t('qa.greeting') }} +
+
+ {{ isAssistant ? t('embedded.predict_data_etc') : t('qa.hint_description') }} +
+
+ {{ t('embedded.intelligent_data_query') }}
-
{{ t('qa.hint_description') }}
- +
-
+