bugfix: 图片加载问题

This commit is contained in:
2026-03-31 14:00:27 +08:00
parent 8870f5821e
commit 7123d361a4
2 changed files with 21 additions and 15 deletions

View File

@@ -345,9 +345,21 @@
if (hasSketch) {
hasSketchEvent = true
sketchList.value.push({
[Object.keys(jsonData)[0]]: jsonData[Object.keys(jsonData)[0]]
console.log('当前sketchList',sketchList.value);
console.log('当前收到的sketch',jsonData,typeof jsonData);
// Object.keys(jsonData).forEach((key) => {
// sketchList.value.push(jsonData[key])
// })
Object.keys(jsonData).forEach((key) => {
if (!sketchList.value.some((item) => item[key])) {
sketchList.value.push({
[key]: jsonData[key]
})
}
})
// sketchList.value.push({
// [Object.keys(jsonData)[0]]: jsonData[Object.keys(jsonData)[0]]
// })
// 通知 Preview 有新 sketch 正在加载,传入 sketch 索引
MyEvent.emit('loading-sketch', sketchList.value.length - 1)
MyEvent.emit('OpenSketch')
@@ -377,7 +389,6 @@
}
}
if (jsonData.type === 'end') {
console.log('end------hasSketch', hasSketch)
aiMessage.streaming = false
aiMessage.loading = false
isGenerating.value = false
@@ -387,7 +398,6 @@
} catch (e) {
// 检查是否为纯文本 [DONE]
if (jsonText.trim() === '[DONE]') {
console.log('done-----------hasSketch', hasSketch)
console.log('结束-----------------------')
aiMessage.text = contentBody