Merge branch 'StableVersion' of http://18.167.251.121:10003/aidlab/aida_front into StableVersion

This commit is contained in:
李志鹏
2026-01-21 16:31:09 +08:00
59 changed files with 3956 additions and 2206 deletions

View File

@@ -993,7 +993,21 @@ export class CanvasManager {
throw new Error("获取画布JSON失败");
}
}
/** 修复JSON数据中的ID丢失问题 */
FixJsonIdLoss(json){
const layers = json?.layers || [];
const objects = json?.canvas?.objects || [];
layers.forEach((layer) => {
if(!layer.fabricObjects?.length && !layer.fabricObject){
const obj = objects?.find((o) => o.layerId === layer.id);
if(!obj) return;
layer.fabricObjects = [{
id: obj.id,
type: obj.type,
}]
}
})
}
loadJSON(json, calllBack) {
console.log("加载画布JSON数据:", json);