|
|
|
@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
// Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。
|
|
|
|
|
// RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。
|
|
|
|
|
// Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。
|
|
|
|
|
public VERSION = '1.0.0.20210107_beta'; |
|
|
|
|
public VERSION = '1.0.4.20210109_beta'; |
|
|
|
|
/** |
|
|
|
|
* 数据初始化 |
|
|
|
|
*/ |
|
|
|
@ -354,6 +354,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 创建图标事件(数据处理) |
|
|
|
|
*/ |
|
|
|
|
this.on('createIcon', (axShape: AxShape) => { |
|
|
|
|
console.log("新增图标:"+axShape.assetData.Name); |
|
|
|
|
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
|
|
|
|
|
// 添加楼层数据
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
@ -383,6 +384,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
temp.addItem(itemLegend); |
|
|
|
|
} |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
@ -420,6 +422,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
this.backgroundImage.removeChild(axShape); |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -442,6 +445,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
item.setNameVisible(value, mode); |
|
|
|
|
} else if (item instanceof PolygonIcon) { |
|
|
|
|
item.setNameVisible(value, mode); |
|
|
|
|
} else if (item instanceof AxArrowConnector) { |
|
|
|
|
item.setNameVisible(value, mode); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -460,6 +465,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
icon.refresh(); |
|
|
|
|
} else if (icon instanceof AxArrowConnector) { |
|
|
|
|
icon.redraw(); |
|
|
|
|
} else if (icon instanceof AxLegend) { |
|
|
|
|
icon.refresh(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -491,17 +498,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.selection.select(obj); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// /**
|
|
|
|
|
// * 创建背景图
|
|
|
|
|
// */
|
|
|
|
|
// public createBackground(imageUrl:string,imageAngle:number) {
|
|
|
|
|
// if (this.backgroundImage !== null) {
|
|
|
|
|
// this.backgroundImage.destroy();
|
|
|
|
|
// this.backgroundImage = null;
|
|
|
|
|
// }
|
|
|
|
|
// this.createBackgroundImage()
|
|
|
|
|
// this.refreshBackgroundImage(imageUrl,imageAngle);
|
|
|
|
|
// }
|
|
|
|
|
/** |
|
|
|
|
* 创建楼层图形 |
|
|
|
|
*/ |
|
|
|
@ -605,6 +601,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.backgroundImage.sortableChildren = true; |
|
|
|
|
this.backgroundImage |
|
|
|
|
.on('pointerdown', event => { |
|
|
|
|
if (event.data.button !== 0) return; |
|
|
|
|
if (!event.currentTarget.dragging && this.selection.isMultiselection === false) { |
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
event.currentTarget.data = event.data; |
|
|
|
@ -662,6 +659,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (this.paintPoints.length >= 2) { |
|
|
|
|
this.enterPaintEndButton.position = this.circleShadow.position; |
|
|
|
|
this.enterPaintEndButton.visible = true; |
|
|
|
|
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.paintingIcon !== null) { |
|
|
|
@ -719,6 +717,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.enterPaintEndButton.position = this.circleShadow.position; |
|
|
|
|
} else if (this.paintPoints.length >= 3) { |
|
|
|
|
this.enterPaintEndButton.visible = true; |
|
|
|
|
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; |
|
|
|
|
} |
|
|
|
|
this.paintPoints.forEach((value, index, array) => { |
|
|
|
|
if (index === 0) { |
|
|
|
@ -747,6 +746,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.previewLineSegment.visible = true; |
|
|
|
|
this.enterPaintEndButton.position = this.circleShadow.position; |
|
|
|
|
this.enterPaintEndButton.visible = true; |
|
|
|
|
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; |
|
|
|
|
this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y); |
|
|
|
|
this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y)); |
|
|
|
|
if (this.paintPoints.length < 2) { |
|
|
|
@ -887,7 +887,7 @@ 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> { |
|
|
|
|
if (!imageUrl) { |
|
|
|
|
if (imageUrl === undefined || imageUrl === null || imageUrl === "") { |
|
|
|
|
this.backgroundImage.visible = false; |
|
|
|
|
} else { |
|
|
|
|
this.backgroundImage.visible = false; |
|
|
|
@ -907,6 +907,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
let scale = wScale < hScale ? wScale : hScale; |
|
|
|
|
// 设置图片缩放
|
|
|
|
|
this.backgroundImage.scale.set(scale); |
|
|
|
|
this.backgroundImage.visible = true; |
|
|
|
|
this.backgroundImage.children.forEach((item) => { |
|
|
|
|
if (item instanceof AxShape) { |
|
|
|
|
item.refresh(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -915,23 +921,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* @param imageAngle
|
|
|
|
|
*/ |
|
|
|
|
public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise<void> { |
|
|
|
|
this.backgroundImage.visible = false; |
|
|
|
|
this.backgroundImage.scale.set(1); |
|
|
|
|
this.backgroundImage.pivot.set(0); |
|
|
|
|
this.backgroundImage.x = this.app.view.width / 2; |
|
|
|
|
this.backgroundImage.y = this.app.view.height / 2; |
|
|
|
|
this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); |
|
|
|
|
this.backgroundImage.angle = imageAngle; |
|
|
|
|
// 等待图片加载完成
|
|
|
|
|
let imageWidth = this.backgroundImage.texture.width; |
|
|
|
|
let imageHeight = this.backgroundImage.texture.height; |
|
|
|
|
let appWidth = this.app.view.width - 470; |
|
|
|
|
let appHeight = this.app.view.height; |
|
|
|
|
let wScale = appWidth / imageWidth; |
|
|
|
|
let hScale = appHeight / imageHeight; |
|
|
|
|
let scale = wScale < hScale ? wScale : hScale; |
|
|
|
|
// 设置图片缩放
|
|
|
|
|
this.backgroundImage.scale.set(scale); |
|
|
|
|
await this.refreshBackgroundImage(); |
|
|
|
|
|
|
|
|
|
// 清空所有图形
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
let itemList = []; |
|
|
|
@ -951,7 +942,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
// 创建处置预案图形
|
|
|
|
|
this.createNodeShape(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
this.createAxLegend(); |
|
|
|
|
this.backgroundImage.visible = true; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 创建安信图例 |
|
|
|
@ -960,7 +950,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
const tempAssetData = { |
|
|
|
|
Id: "图例",//ObjectID.default.generate()
|
|
|
|
|
Color: "#066EED80", |
|
|
|
|
PropertyInfos:[] |
|
|
|
|
PropertyInfos: [ |
|
|
|
|
{ |
|
|
|
|
Tag : '', |
|
|
|
|
Order : 0, |
|
|
|
|
Enabled : true, |
|
|
|
|
Visible : true, |
|
|
|
|
Required : false, |
|
|
|
|
RuleName : "", |
|
|
|
|
RuleValue : "", |
|
|
|
|
PhysicalUnit : "", |
|
|
|
|
PropertyName : "列", |
|
|
|
|
PropertyType : 2, |
|
|
|
|
PropertyValue : 2, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
let shapeMap: Map<string,Legend> = new Map<string,Legend>(); |
|
|
|
|
|
|
|
|
|