From 924783b5196f53d3a087de97316548ab2d8dd9d5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Tue, 25 Aug 2020 10:57:08 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20=20=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index ee803d4..92943d3 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -708,28 +708,30 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ public paste(companyId: string, buildingId: string, floorId: string): void { this.copyData.forEach(item => { - item.Id = Guid.NewGuid().ToString(); - item.CompanyId = companyId; - item.BuildingId = buildingId; - item.FloorId = floorId; item.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); - if (item.IsFromBuilding) { - this.canvasData.originalcompanyBuildingData.data[item.Id] = item; + const newData = JSON.parse(JSON.stringify(item)); + newData.Id = Guid.NewGuid().ToString(); + newData.CompanyId = companyId; + newData.BuildingId = buildingId; + newData.FloorId = floorId; + newData.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); + if (newData.IsFromBuilding) { + this.canvasData.originalcompanyBuildingData.data[newData.Id] = newData; } else { - this.canvasData.originaleveryStoreyData.data[item.Id] = item; + this.canvasData.originaleveryStoreyData.data[newData.Id] = newData; } switch (item.InteractiveMode) { case PaintMode.singlePointIcon: - const singleIcon = new SinglePointIcon(item, this); + const singleIcon = new SinglePointIcon(newData, this); break; case PaintMode.lineIcon: - const lineIcon = new MultipointIcon(item, this); + const lineIcon = new MultipointIcon(newData, this); break; case PaintMode.polygonIcon: - const polygonIcon = new PolygonIcon(item, this); + const polygonIcon = new PolygonIcon(newData, this); break; } - this.selection.select(this.backgroundImage.getChildByName(item.Id)); + this.selection.select(this.backgroundImage.getChildByName(newData.Id)); }); }