feat: 对话的调整

This commit is contained in:
zoujing
2026-03-06 14:41:59 +08:00
parent ed04eea481
commit 3fc26d6996
5 changed files with 42 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
<template>
<layout>
<div class="flex h-full w-full flex-col md:flex-row">
<ChatHistory class="flex-none w-50" @new-chat="guide = true" @select-chat="handleSelectChat" />
<ChatHistory class="flex-none w-50" @new-chat="handleNewChat" @select-chat="handleSelectChat" />
<div class="flex-1 mr-2 overflow-hidden bg-white rounded-xl">
<ChatBox v-model:guide="guide" :conversationId="selectedConversationId" />
</div>
@@ -20,6 +20,12 @@ const guide = ref(true)
/// 选择的历史会话ID
const selectedConversationId = ref('')
/// 处理新对话事件切换到引导页并清空选中的历史会话ID
const handleNewChat = () => {
guide.value = true;
selectedConversationId.value = '';
};
/// 选择历史会话
const handleSelectChat = (conversationId: string) => {
guide.value = false;