feat: 历史消息的加载

This commit is contained in:
zoujing
2026-02-03 16:34:16 +08:00
parent aff9233ce2
commit ff5355855f
5 changed files with 158 additions and 114 deletions

View File

@@ -1,9 +1,9 @@
<template>
<layout>
<div class="flex h-full w-full flex-col md:flex-row ">
<ChatHistory class="flex-none w-50" @new-chat="guide = true" />
<ChatHistory class="flex-none w-50" @new-chat="guide = true" @select-chat="handleSelectChat" />
<div class="flex-1 mr-2 overflow-hidden bg-white rounded-xl">
<ChatBox v-model:guide="guide" />
<ChatBox v-model:guide="guide" :conversationId="selectedConversationId" />
</div>
<TaskList />
</div>
@@ -15,6 +15,15 @@ import TaskList from '@renderer/components/TaskList/index.vue'
import ChatHistory from './ChatHistory.vue'
import ChatBox from './ChatBox.vue'
import { ref } from 'vue'
/// 是否显示引导页
const guide = ref(true)
/// 选择的历史会话ID
const selectedConversationId = ref('')
/// 选择历史会话
const handleSelectChat = (conversationId: string) => {
guide.value = false;
selectedConversationId.value = conversationId;
};
</script>