|
|
|
@ -157,8 +157,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。 |
|
|
|
|
* RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 |
|
|
|
|
* Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 |
|
|
|
|
* 修改-修订版本号增加 |
|
|
|
|
* 新增-子版本号增加 |
|
|
|
|
* 重大调整-主版本号增加 |
|
|
|
|
* 日期变更-日期版本号增加 |
|
|
|
|
*/ |
|
|
|
|
public VERSION = '1.0.18.20210205_beta'; |
|
|
|
|
public VERSION = '1.2.2.20210220_beta'; |
|
|
|
|
/** |
|
|
|
|
* 数据初始化 |
|
|
|
|
*/ |
|
|
|
@ -201,7 +205,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (this.allowEdit && this.canvasData.gameMode === axShape.assetData.GameMode) { |
|
|
|
|
// 删除图例对象
|
|
|
|
|
const temp = this.backgroundImage.getChildByName('图例') as AxLegend; |
|
|
|
|
if ( temp !== undefined |
|
|
|
|
if (temp !== undefined |
|
|
|
|
&& temp !== null |
|
|
|
|
&& axShape.assetData.Name !== '图例') { |
|
|
|
|
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
@ -249,7 +253,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} else if (window.console) { |
|
|
|
|
window.console.log('\n %c 版本号 - ' + this.VERSION + '\n'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 页面初始化 |
|
|
|
|
*/ |
|
|
|
@ -384,7 +388,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.rectToolGraphics.visible = false; |
|
|
|
|
const shapes: AxShape[] = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if ( item instanceof AxShape |
|
|
|
|
if (item instanceof AxShape |
|
|
|
|
&& item instanceof AxPreviewImageShape === false) { |
|
|
|
|
// 判断2个矩形是否相交
|
|
|
|
|
const rect1 = this.rectToolGraphics.getBounds(); |
|
|
|
@ -403,7 +407,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.rectToolGraphics.visible = false; |
|
|
|
|
const shapes: AxShape[] = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if ( item instanceof AxShape |
|
|
|
|
if (item instanceof AxShape |
|
|
|
|
&& item instanceof AxPreviewImageShape === false) { |
|
|
|
|
// 判断2个矩形是否相交
|
|
|
|
|
const rect1 = this.rectToolGraphics.getBounds(); |
|
|
|
@ -468,8 +472,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 缩放适应 |
|
|
|
|
*/ |
|
|
|
|
public zoomFit() { |
|
|
|
|
const imageWidth = this.backgroundImage.texture.width; |
|
|
|
|
const imageHeight = this.backgroundImage.texture.height; |
|
|
|
|
const imageWidth = this.backgroundImage.width; |
|
|
|
|
const imageHeight = this.backgroundImage.height; |
|
|
|
|
const appWidth = this.app.view.width - 470; |
|
|
|
|
const appHeight = this.app.view.height; |
|
|
|
|
const wScale = appWidth / imageWidth; |
|
|
|
@ -561,7 +565,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const temp = this.backgroundImage.getChildByName('图例') as AxLegend; |
|
|
|
|
if ( temp !== undefined |
|
|
|
|
if (temp !== undefined |
|
|
|
|
&& temp !== null |
|
|
|
|
&& axShape.assetData.Name !== '图例') { |
|
|
|
|
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
@ -748,19 +752,19 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
FillMode: this.canvasData.selectTemplateData.fillMode, |
|
|
|
|
FireElementId: this.canvasData.selectTemplateData.fireElementId, |
|
|
|
|
FixedSize: this.canvasData.selectTemplateData.fixedSize, |
|
|
|
|
Height : 32, |
|
|
|
|
Width : 32, |
|
|
|
|
Height: 32, |
|
|
|
|
Width: 32, |
|
|
|
|
Id: ObjectID.default.generate(), |
|
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
|
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode, |
|
|
|
|
MultiPoint : null, |
|
|
|
|
MultiPoint: null, |
|
|
|
|
Point: new PIXI.Point(this.previewImage.x, this.previewImage.y), |
|
|
|
|
Name : this.canvasData.selectTemplateData.name, |
|
|
|
|
Name: this.canvasData.selectTemplateData.name, |
|
|
|
|
PropertyInfos: list, |
|
|
|
|
Border : this.canvasData.selectTemplateData.border, |
|
|
|
|
DrawMode : this.canvasData.selectTemplateData.drawMode, |
|
|
|
|
Thickness : this.canvasData.selectTemplateData.thickness, |
|
|
|
|
IsFromBuilding : this.canvasData.selectTemplateData.isFromBuilding, |
|
|
|
|
Border: this.canvasData.selectTemplateData.border, |
|
|
|
|
DrawMode: this.canvasData.selectTemplateData.drawMode, |
|
|
|
|
Thickness: this.canvasData.selectTemplateData.thickness, |
|
|
|
|
IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, |
|
|
|
|
GameMode: this.canvasData.gameMode, |
|
|
|
|
Tag: this.canvasData.selectTemplateData.tag |
|
|
|
|
}; |
|
|
|
@ -905,7 +909,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this, true, true); |
|
|
|
|
} else if (this.canvasData.selectTemplateData.name === '普通墙' || this.canvasData.selectTemplateData.name === '承重墙') { |
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this, false, false); |
|
|
|
|
} else if (this.canvasData.selectTemplateData.name === '水带' ) { |
|
|
|
|
} else if (this.canvasData.selectTemplateData.name === '水带') { |
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this, false, true); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -974,26 +978,60 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
/** |
|
|
|
|
* 刷新背景图 |
|
|
|
|
*/ |
|
|
|
|
public async refreshBackgroundImage(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise<void> { |
|
|
|
|
public async refreshBackgroundImage( |
|
|
|
|
imageUrl: string = this.canvasData.selectStorey.imageUrl, |
|
|
|
|
imageAngle: number = this.canvasData.selectStorey.imageAngle, |
|
|
|
|
imageWidth: number = this.canvasData.selectStorey.imageWidth, |
|
|
|
|
imageHeight: number = this.canvasData.selectStorey.imageHeight, |
|
|
|
|
): Promise<void> { |
|
|
|
|
if (imageAngle === undefined || imageAngle === null) { |
|
|
|
|
imageAngle = 0; |
|
|
|
|
} |
|
|
|
|
this.backgroundImage.scale.set(1); |
|
|
|
|
// this.backgroundImage.pivot.set(0);
|
|
|
|
|
if (imageUrl === undefined || imageUrl === null || imageUrl === '') { |
|
|
|
|
this.backgroundImage.texture = this.backgroundTexture; |
|
|
|
|
} else { |
|
|
|
|
this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); |
|
|
|
|
// this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl);
|
|
|
|
|
if (imageWidth !== undefined |
|
|
|
|
&& imageWidth !== null |
|
|
|
|
&& imageWidth !== 0 |
|
|
|
|
&& imageHeight !== undefined |
|
|
|
|
&& imageHeight !== null |
|
|
|
|
&& imageHeight !== 0) { |
|
|
|
|
// console.log(imageWidth, imageHeight);
|
|
|
|
|
// this.backgroundImage.width = imageWidth;
|
|
|
|
|
// this.backgroundImage.height = imageHeight;
|
|
|
|
|
this.backgroundImage.texture = |
|
|
|
|
await PIXI.Texture.fromURL(imageUrl + '?x-oss-process=image/resize,m_fixed,h_' + imageHeight + ',w_' + imageWidth); // 图片处理
|
|
|
|
|
} else { |
|
|
|
|
// this.backgroundImage.width = this.backgroundImage.texture.width;
|
|
|
|
|
// this.backgroundImage.height = this.backgroundImage.texture.height;
|
|
|
|
|
this.backgroundImage.texture = |
|
|
|
|
await PIXI.Texture.fromURL(imageUrl); // 请求原图
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.backgroundImage.angle = imageAngle; |
|
|
|
|
|
|
|
|
|
// if (imageWidth !== undefined
|
|
|
|
|
// && imageWidth !== null
|
|
|
|
|
// && imageWidth !== 0
|
|
|
|
|
// && imageHeight !== undefined
|
|
|
|
|
// && imageHeight !== null
|
|
|
|
|
// && imageHeight !== 0) {
|
|
|
|
|
// console.log(imageWidth, imageHeight);
|
|
|
|
|
// this.backgroundImage.width = imageWidth;
|
|
|
|
|
// this.backgroundImage.height = imageHeight;
|
|
|
|
|
// } else {
|
|
|
|
|
// this.backgroundImage.width = this.backgroundImage.texture.width;
|
|
|
|
|
// this.backgroundImage.height = this.backgroundImage.texture.height;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
this.backgroundImage.x = this.backgroundImage.width / 2; |
|
|
|
|
this.backgroundImage.y = this.backgroundImage.height / 2; |
|
|
|
|
this.backgroundImage.angle = imageAngle; |
|
|
|
|
|
|
|
|
|
this.resetCamera2D(); |
|
|
|
|
// this.backgroundImage.children.forEach((item) => {
|
|
|
|
|
// if (item instanceof AxShape) {
|
|
|
|
|
// item.refresh();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 刷新 |
|
|
|
@ -1077,17 +1115,17 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
GameMode: this.canvasData.gameMode, |
|
|
|
|
PropertyInfos: [ |
|
|
|
|
{ |
|
|
|
|
Tag : '', |
|
|
|
|
Order : 0, |
|
|
|
|
Enabled : true, |
|
|
|
|
Visible : true, |
|
|
|
|
Required : false, |
|
|
|
|
RuleName : '', |
|
|
|
|
RuleValue : '', |
|
|
|
|
PhysicalUnit : '', |
|
|
|
|
PropertyName : '列', |
|
|
|
|
PropertyType : 2, |
|
|
|
|
PropertyValue : 2, |
|
|
|
|
Tag: '', |
|
|
|
|
Order: 0, |
|
|
|
|
Enabled: true, |
|
|
|
|
Visible: true, |
|
|
|
|
Required: false, |
|
|
|
|
RuleName: '', |
|
|
|
|
RuleValue: '', |
|
|
|
|
PhysicalUnit: '', |
|
|
|
|
PropertyName: '列', |
|
|
|
|
PropertyType: 2, |
|
|
|
|
PropertyValue: 2, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
Scale: 1, |
|
|
|
@ -1172,7 +1210,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.previewLineSegment.clear(); |
|
|
|
|
this.previewLineSegment.lineStyle(1 / this.backgroundImage.scale.x, 0x00ff00, 1); |
|
|
|
|
this.previewLineSegment.moveTo(pointA.x, pointA.y); |
|
|
|
|
this.previewLineSegment.lineTo(pointB.x, pointB.y ); |
|
|
|
|
this.previewLineSegment.lineTo(pointB.x, pointB.y); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 创建半径图标影子 |
|
|
|
@ -1249,7 +1287,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.previewImage.visible = false; |
|
|
|
|
} |
|
|
|
|
// 重置组件状态
|
|
|
|
|
if ( this.paintingIcon !== undefined |
|
|
|
|
if (this.paintingIcon !== undefined |
|
|
|
|
&& this.paintingIcon !== null) { |
|
|
|
|
this.backgroundImage.removeChild(this.paintingIcon); |
|
|
|
|
} |
|
|
|
|