Browse Source

[修正] 粘贴位置

develop
徐振升 4 years ago
parent
commit
924783b519
  1. 24
      src/app/working-area/working-area.component.ts

24
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));
});
}

Loading…
Cancel
Save