mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-05-13 11:50:35 +00:00
【解决todo】AI 删除对话,不默认选中
This commit is contained in:
@@ -174,15 +174,15 @@ const getChatConversationList = async () => {
|
||||
conversationList.value = res
|
||||
// 3、默认选中
|
||||
if (!activeId?.value) {
|
||||
await handleConversationClick(res[0].id)
|
||||
// await handleConversationClick(res[0].id)
|
||||
} else {
|
||||
// tip: 删除的刚好是选中的,那么需要重新挑选一个来进行选中
|
||||
const filterConversationList = conversationList.value.filter(item => {
|
||||
return item.id === activeId.value
|
||||
})
|
||||
if (filterConversationList.length <= 0) {
|
||||
await handleConversationClick(res[0].id)
|
||||
}
|
||||
// const filterConversationList = conversationList.value.filter(item => {
|
||||
// return item.id === activeId.value
|
||||
// })
|
||||
// if (filterConversationList.length <= 0) {
|
||||
// await handleConversationClick(res[0].id)
|
||||
// }
|
||||
}
|
||||
// 4、没有 任何对话情况
|
||||
if (conversationList.value.length === 0) {
|
||||
@@ -367,6 +367,9 @@ watch(activeId, async (newValue, oldValue) => {
|
||||
activeConversationId.value = newValue as string
|
||||
})
|
||||
|
||||
// 定义 public 方法
|
||||
defineExpose({createConversation})
|
||||
|
||||
onMounted(async () => {
|
||||
// 默认选中
|
||||
if (props.activeId != null) {
|
||||
|
||||
Reference in New Issue
Block a user