feat: 对话中消息编辑与重新生成与删除功能

This commit is contained in:
Gsh
2026-01-31 17:39:23 +08:00
parent 4441244575
commit ec382995b4
9 changed files with 943 additions and 102 deletions

View File

@@ -109,18 +109,22 @@ export const useChatStore = defineStore('chat', () => {
return {
...item,
key: item.id,
id: item.id, // 保留后端返回的消息ID
key: item.id ?? Math.random().toString(36).substring(2, 9),
placement: isUser ? 'end' : 'start',
// 用户消息气泡形状AI消息无气泡形状宽度100%
isMarkdown: !isUser,
avatar: isUser
? getUserProfilePicture()
: systemProfilePicture,
avatarSize: '32px',
// 头像不显示(后续可能会显示)
// avatar: isUser ? getUserProfilePicture() : systemProfilePicture,
// avatarSize: '32px',
typing: false,
reasoning_content: thinkContent,
thinkingStatus: 'end',
content: finalContent,
thinlCollapse: false,
// AI消息使用 noStyle 去除气泡样式
noStyle: !isUser,
shape: isUser ? 'corner' : undefined,
// 保留图片和文件信息(优先使用解析出来的,如果没有则使用原有的)
images: images.length > 0 ? images : item.images,
files: files.length > 0 ? files : item.files,