新增文件点击,优化流式输出

This commit is contained in:
2026-07-28 16:52:15 +08:00
parent c90600c66e
commit 85ecfc4c5b
3 changed files with 78 additions and 68 deletions

View File

@@ -41,8 +41,7 @@
<view class="chat-sidebar" :class="{'sidebar-show' : isChatSidebar}">
<ChatSidebar :chatList="UserConversations" v-model:showNewChatModal="showNewChatModal"
v-model:currentSessionId="currentSessionId" v-model:chatType="ChatType"
@refresh-conversations="takeUserConversations"
@select-chat="isChatSidebar = false">
@refresh-conversations="takeUserConversations" @select-chat="isChatSidebar = false">
</ChatSidebar>
</view>
@@ -67,7 +66,7 @@
</view>
<view class="main-chat">
<scroll-view class="chat-messages" direction="vertical" scroll-y :scroll-into-view="scrollToView"
:upper-threshold="0" :scroll-with-animation="true" @scroll="onScroll">
:upper-threshold="0" :scroll-with-animation="!isThinking" @scroll="onScroll">
<!-- 消息加载中弹窗仅会话变化时显示 -->
<view v-if="isLoadingMessages" class="messages-loading-overlay">
<view class="messages-loading-card">
@@ -211,6 +210,10 @@
</view>
</view>
<!-- 底部锚点两个交替切换确保流式时每次都能触发滚动到底部 -->
<!-- <view>
<view id="chat-bottom-a" style="height: 0rpx;width: 1rpx;"></view>
<view id="chat-bottom-b" style="height: 0rpx;width: 1rpx;"></view>
</view> -->
<view id="chat-bottom-a" style="height: 1rpx;"></view>
<view id="chat-bottom-b" style="height: 1rpx;"></view>
</scroll-view>
@@ -587,6 +590,7 @@
})
return
}
closeNewChatModal();
takeUserConversations();
} catch (error) {
@@ -1035,8 +1039,8 @@
}, 1000)
}
//修改优先把消息加入列表
//修改优先把消息加入列表
// 发送AI消息
const sendAIMessage = async () => {
@@ -1048,7 +1052,7 @@
content: messageContent
}]
await handleConnect();
if (uploadedFiles.value.length) {
const fileJson = JSON.stringify(uploadedFiles.value)
messageContent = messageContent ?

View File

@@ -605,7 +605,10 @@
// 处理文件夹点击(非选择模式下进入文件夹,仅目录可点击进入)
const handleFolderClick = (folder) => {
if (folder.type !== 'directory') return;
if (folder.type !== 'directory') {
handleLongPress(folder)
return
}
folderStack.value.push({
path: folder.path,
name: folder.name