From 2b38e62c85e62ff9ce27a30d12ce19b8e2f92240 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 17 May 2024 18:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/Conversation.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/views/ai/chat/Conversation.vue b/src/views/ai/chat/Conversation.vue index 7566e4d6..3ea2539e 100644 --- a/src/views/ai/chat/Conversation.vue +++ b/src/views/ai/chat/Conversation.vue @@ -106,8 +106,18 @@ const emits = defineEmits(['onConversationClick', 'onConversationClear', 'onConv /** * 对话 - 搜索 */ -const searchConversation = () => { - // TODO fan:待实现 +const searchConversation = (e) => { + // 恢复数据 + if (!searchName.value.trim().length) { + conversationMap.value = conversationTimeGroup(conversationList.value) + } else { + // 过滤 + const filterValues = conversationList.value.filter(item => { + console.log('ss', item.title.indexOf(searchName.value)) + return item.title.indexOf(searchName.value) !== -1 + }) + conversationMap.value = conversationTimeGroup(filterValues) + } } /**