【增加】AI 对话增加搜索

This commit is contained in:
cherishsince 2024-05-17 22:44:04 +08:00
parent 2b38e62c85
commit 7acc2fcb1b

View File

@ -106,17 +106,16 @@ const emits = defineEmits(['onConversationClick', 'onConversationClear', 'onConv
/** /**
* 对话 - 搜索 * 对话 - 搜索
*/ */
const searchConversation = (e) => { const searchConversation = async (e) => {
// //
if (!searchName.value.trim().length) { if (!searchName.value.trim().length) {
conversationMap.value = conversationTimeGroup(conversationList.value) conversationMap.value = await conversationTimeGroup(conversationList.value)
} else { } else {
// //
const filterValues = conversationList.value.filter(item => { const filterValues = conversationList.value.filter(item => {
console.log('ss', item.title.indexOf(searchName.value)) return item.title.includes(searchName.value.trim())
return item.title.indexOf(searchName.value) !== -1
}) })
conversationMap.value = conversationTimeGroup(filterValues) conversationMap.value = await conversationTimeGroup(filterValues)
} }
} }
@ -196,6 +195,7 @@ const conversationTimeGroup = async (list: ChatConversationVO[]) => {
groupMap['三十天前'].push(conversation) groupMap['三十天前'].push(conversation)
} }
} }
console.log('----groupMap', groupMap)
return groupMap return groupMap
} }