Merge branch 'StableVersion' of http://18.167.251.121:10003/aidlab/aida_front into StableVersion
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user