|
|
|
@ -159,66 +159,26 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.selection.objects.forEach(item => { |
|
|
|
|
if (this.allowEdit |
|
|
|
|
&& this.canvasData.gameMode === item.assetData.GameMode) { |
|
|
|
|
console.log(this.canvasData.gameMode); |
|
|
|
|
switch (this.canvasData.gameMode) { |
|
|
|
|
case 0: |
|
|
|
|
delete this.canvasData.originaleveryStoreyData.data[item.assetData.Id]; |
|
|
|
|
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[item.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Increment[item.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Stock[item.assetData.Id]; |
|
|
|
|
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
break; |
|
|
|
|
switch (this.canvasData.gameMode) { |
|
|
|
|
case 0: |
|
|
|
|
delete this.canvasData.originaleveryStoreyData.data[item.assetData.Id]; |
|
|
|
|
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[item.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Increment[item.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Stock[item.assetData.Id]; |
|
|
|
|
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
this.emit('deleteIcon'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// 打印当前工作区信息
|
|
|
|
|
this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => { |
|
|
|
|
// console.log(event.keyCode);
|
|
|
|
|
if (event.keyCode === 32) { |
|
|
|
|
switch (this.paintMode) { |
|
|
|
|
case 0: |
|
|
|
|
console.log(`当前的绘制模式是:单点图标`); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
console.log(`当前的绘制模式是:线段图标`); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
console.log(`当前的绘制模式是:自定义多边形`); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
console.log(`当前的绘制模式是:水带多边形`); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
console.log(`当前的绘制模式是:暂无`); |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
console.log(`当前的绘制模式是:暂无`); |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
console.log(`当前的绘制模式是:结束绘制`); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
console.log('当前楼层的数据:'); |
|
|
|
|
console.log(this.canvasData.originaleveryStoreyData.data); |
|
|
|
|
|
|
|
|
|
console.log('绘制中的管线:'); |
|
|
|
|
console.log(this.paintingPipeline); |
|
|
|
|
|
|
|
|
|
console.log('处置预案数据:'); |
|
|
|
|
console.log(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 页面初始化 |
|
|
|
@ -321,6 +281,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.circleShadow.position = this.backgroundImage.toLocal(this.mousePosition); |
|
|
|
|
this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 显示框选 |
|
|
|
|
*/ |
|
|
|
|
if (this.rectToolGraphics.visible === true) { |
|
|
|
|
|
|
|
|
|
const init = this.initialScreenMousePos; |
|
|
|
@ -339,18 +302,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.rectToolGraphics.drawRect(final.x, final.y, init.x - final.x, init.y - final.y); |
|
|
|
|
} |
|
|
|
|
this.rectToolGraphics.endFill(); |
|
|
|
|
// this.rectToolGraphics.closePath();
|
|
|
|
|
} |
|
|
|
|
// if (this.paintingArrows !== null) {
|
|
|
|
|
// this.paintingArrows.assetData.pointB = new PIXI.Point(this.circleShadow.position.x, this.circleShadow.position.y);
|
|
|
|
|
// this.paintingArrows.refresh();
|
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 选中事件 |
|
|
|
|
*/ |
|
|
|
|
this.on('select', obj => { |
|
|
|
|
// this.moveIconToScreenCenter(obj);
|
|
|
|
|
if (this.allowEdit) { |
|
|
|
|
if (obj instanceof MultipointIcon) { |
|
|
|
|
if (obj.assetData.GameMode === this.canvasData.gameMode) { |
|
|
|
@ -388,6 +345,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
obj.filters = []; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 根据背景缩放事件 |
|
|
|
|
*/ |
|
|
|
|
this.on('backgroundScale', scale => { |
|
|
|
|
this.backgroundImage?.children.forEach(item => { |
|
|
|
|
if (item instanceof AxImageShape) { |
|
|
|
@ -414,9 +374,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 创建图标事件 |
|
|
|
|
*/ |
|
|
|
|
this.on('createIcon', obj => { |
|
|
|
|
if (obj.assetData.GameMode === GameMode.BasicInformation) { |
|
|
|
|
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; |
|
|
|
|
// 添加楼层数据
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; |
|
|
|
|
} else { |
|
|
|
|
if (this.canvasData.selectPanelPoint.Data === undefined |
|
|
|
|
|| this.canvasData.selectPanelPoint.Data === null) { |
|
|
|
|