web修改ai推荐

This commit is contained in:
2025-12-25 10:48:08 +08:00
parent 878133fb40
commit a69b3edba3
3 changed files with 111 additions and 21 deletions

View File

@@ -65,13 +65,13 @@
<!-- 对话内容区域 -->
<div class="current-chat-content" ref="chatContentRef">
<!-- 欢迎消息 -->
<div v-if="messages.length === 0" class="welcome-message">
<div v-if="!currentConversation && messages.length === 0" class="welcome-message">
<div class="welcome-icon">
<img v-if="agentAvatarUrl" :src="agentAvatarUrl" alt="AI助手" class="welcome-avatar" />
<img v-else src="@/assets/imgs/assistant.svg" alt="AI助手" class="welcome-avatar" />
</div>
<h2>你好我是{{ agentConfig?.name || 'AI助手' }}</h2>
<AIRecommend />
<AIRecommend v-if="isFirstLoad" />
</div>
<!-- 消息列表 -->
@@ -447,6 +447,8 @@ const conversations = ref<AiConversation[]>([]);
const currentConversation = ref<AiConversation | null>(null);
const hasMoreConversations = ref(false);
const conversationPage = ref(1);
// 是否是第一次加载(用于控制推荐内容只在首次加载时显示)
const isFirstLoad = ref(true);
// 加载最近对话
async function loadRecentConversations() {
@@ -482,6 +484,7 @@ async function loadMoreConversations() {
function prepareNewConversation() {
currentConversation.value = null;
messages.value = [];
isFirstLoad.value = false; // 新建对话时不再显示推荐
ElMessage.success('已准备新对话,发送消息后将自动创建');
}