|
|
@ -64,6 +64,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
* 资源加载器 |
|
|
|
* 资源加载器 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public loader = PIXI.Loader.shared; |
|
|
|
public loader = PIXI.Loader.shared; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 背景容器 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public backgroundContainer = new PIXI.Container(); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 背景图 |
|
|
|
* 背景图 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -171,7 +175,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
* 重大调整-主版本号增加 |
|
|
|
* 重大调整-主版本号增加 |
|
|
|
* 日期变更-日期版本号增加 |
|
|
|
* 日期变更-日期版本号增加 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public VERSION = '1.4.3.20210415_rc'; |
|
|
|
public VERSION = '1.5.0.20210507_rc'; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 数据初始化 |
|
|
|
* 数据初始化 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -223,6 +227,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
this.camera2D.drag(); |
|
|
|
this.camera2D.drag(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 删除选中的图标 |
|
|
|
* 删除选中的图标 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -478,7 +483,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
this.deselectAll(); |
|
|
|
this.deselectAll(); |
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新2D相机 |
|
|
|
* 更新2D相机 |
|
|
@ -614,12 +618,31 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
this.canvasData.isChange = true; |
|
|
|
this.canvasData.isChange = true; |
|
|
|
this.updateCamera2D(); |
|
|
|
this.updateCamera2D(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 截屏 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
takeScreenshot() { |
|
|
|
|
|
|
|
this.backgroundContainer.setParent(this.app.stage); |
|
|
|
|
|
|
|
this.app.renderer.extract.canvas(this.backgroundContainer).toBlob((b) => { |
|
|
|
|
|
|
|
const a = document.createElement('a'); |
|
|
|
|
|
|
|
document.body.append(a); |
|
|
|
|
|
|
|
a.download = 'screenshot'; |
|
|
|
|
|
|
|
a.href = URL.createObjectURL(b); |
|
|
|
|
|
|
|
a.click(); |
|
|
|
|
|
|
|
a.remove(); |
|
|
|
|
|
|
|
}, 'image/png'); |
|
|
|
|
|
|
|
this.backgroundContainer.setParent(this.camera2D); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 重置画布 |
|
|
|
* 重置画布 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public resetCanvas() { |
|
|
|
public resetCanvas() { |
|
|
|
this.app.renderer.resize(this.content.nativeElement.clientWidth, this.content.nativeElement.clientHeight); |
|
|
|
this.app.renderer.resize(this.content.nativeElement.clientWidth, this.content.nativeElement.clientHeight); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置名称显示 |
|
|
|
* 设置名称显示 |
|
|
@ -785,6 +808,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
CanConnect: this.canvasData.selectTemplateData.canConnect, |
|
|
|
CanConnect: this.canvasData.selectTemplateData.canConnect, |
|
|
|
Pipelines: new Array(), |
|
|
|
Pipelines: new Array(), |
|
|
|
|
|
|
|
BuildingId: this.canvasData.selectStorey.buildingId, |
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
|
Color: this.canvasData.selectTemplateData.color, |
|
|
|
Color: this.canvasData.selectTemplateData.color, |
|
|
@ -808,6 +832,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
GameMode: this.canvasData.gameMode, |
|
|
|
GameMode: this.canvasData.gameMode, |
|
|
|
Tag: this.canvasData.selectTemplateData.tag |
|
|
|
Tag: this.canvasData.selectTemplateData.tag |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const singleIcon = new AxImageShape(assetData, this); |
|
|
|
const singleIcon = new AxImageShape(assetData, this); |
|
|
|
this.emit('createIcon', singleIcon); |
|
|
|
this.emit('createIcon', singleIcon); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1035,7 +1060,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
this.previewImage.visible = false; |
|
|
|
this.previewImage.visible = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.camera2D.addChild(this.backgroundImage); |
|
|
|
this.backgroundContainer.addChild(this.backgroundImage); |
|
|
|
|
|
|
|
this.camera2D.addChild(this.backgroundContainer); |
|
|
|
this.createPreviewImage(); |
|
|
|
this.createPreviewImage(); |
|
|
|
this.createPreviewLineSegment(); |
|
|
|
this.createPreviewLineSegment(); |
|
|
|
this.createCircleShadow(); |
|
|
|
this.createCircleShadow(); |
|
|
@ -1449,7 +1475,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
const property = new PropertyInfo(element); |
|
|
|
const property = new PropertyInfo(element); |
|
|
|
propertyList.push(property); |
|
|
|
propertyList.push(property); |
|
|
|
}); |
|
|
|
}); |
|
|
|
const assetData = { |
|
|
|
const assetData: AssetData = { |
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
@ -1460,6 +1486,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
FixedSize: this.canvasData.selectTemplateData.fixedSize, |
|
|
|
FixedSize: this.canvasData.selectTemplateData.fixedSize, |
|
|
|
Height: 32, |
|
|
|
Height: 32, |
|
|
|
Width: 32, |
|
|
|
Width: 32, |
|
|
|
|
|
|
|
BuildingId: this.canvasData.selectStorey.buildingId, |
|
|
|
|
|
|
|
CompanyId: "", |
|
|
|
|
|
|
|
FloorName: "", |
|
|
|
Id: ObjectID.default.generate(), |
|
|
|
Id: ObjectID.default.generate(), |
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode, |
|
|
|
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode, |
|
|
@ -1708,6 +1737,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
ids.forEach(item => { |
|
|
|
ids.forEach(item => { |
|
|
|
const obj = this.backgroundImage.getChildByName(item); |
|
|
|
const obj = this.backgroundImage.getChildByName(item); |
|
|
|
shapes.push(obj as AxShape); |
|
|
|
shapes.push(obj as AxShape); |
|
|
|
|
|
|
|
console.log((obj as AxShape).assetData); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.selectAllWithClear(shapes); |
|
|
|
this.selectAllWithClear(shapes); |
|
|
|
} |
|
|
|
} |
|
|
|