|
|
|
@ -24,6 +24,7 @@ import { Viewport } from 'pixi-viewport';
|
|
|
|
|
import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events'; |
|
|
|
|
import { Dimensioning } from './model/dimensioning'; |
|
|
|
|
import { Configuration, viewBounds } from './model/configuration'; |
|
|
|
|
import { id } from 'date-fns/locale'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@ -144,6 +145,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 允许编辑 |
|
|
|
|
*/ |
|
|
|
|
public allowEdit = true; |
|
|
|
|
/** |
|
|
|
|
* 图形索引 |
|
|
|
|
*/ |
|
|
|
|
public shapesIndex: Map<string, number> = new Map<string, number>(); |
|
|
|
|
/** |
|
|
|
|
* 动画控制器 |
|
|
|
|
*/ |
|
|
|
@ -166,7 +171,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 重大调整-主版本号增加 |
|
|
|
|
* 日期变更-日期版本号增加 |
|
|
|
|
*/ |
|
|
|
|
public VERSION = '1.4.2.20210325_rc'; |
|
|
|
|
public VERSION = '1.4.3.20210415_rc'; |
|
|
|
|
/** |
|
|
|
|
* 数据初始化 |
|
|
|
|
*/ |
|
|
|
@ -524,7 +529,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
*/ |
|
|
|
|
private createGrid2D(): void { |
|
|
|
|
this.grid2D = new Grid2D(this.camera2D, null); |
|
|
|
|
|
|
|
|
|
this.camera2D.addChild(this.grid2D); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -593,6 +597,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
&& axShape.assetData.Name !== '图例') { |
|
|
|
|
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
temp.addItem(itemLegend); |
|
|
|
|
// 设置新增图形的名称/编号
|
|
|
|
|
let Id = temp.shapeMap.get(axShape.assetData.Name).Index; |
|
|
|
|
let index = "000"; |
|
|
|
|
// 检查Id的长度
|
|
|
|
|
if (Id < 10) { |
|
|
|
|
index = axShape.assetData.Name + "00" + Id; |
|
|
|
|
} else if (Id < 100) { |
|
|
|
|
index = axShape.assetData.Name + "0" + Id; |
|
|
|
|
} else { |
|
|
|
|
index = axShape.assetData.Name + Id; |
|
|
|
|
} |
|
|
|
|
(axShape.assetData.PropertyInfos.find(i => i.PropertyName == "名称/编号")).PropertyValue = index; |
|
|
|
|
} |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
@ -721,6 +737,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建确认绘制结束按钮 |
|
|
|
|
*/ |
|
|
|
@ -757,13 +774,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
case PaintMode.endPaint: |
|
|
|
|
break; |
|
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
|
// 整理数据
|
|
|
|
|
const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); |
|
|
|
|
const list = []; |
|
|
|
|
json.forEach(element => { |
|
|
|
|
const property = new PropertyInfo(element); |
|
|
|
|
list.push(property); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const assetData = { |
|
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
|
CanConnect: this.canvasData.selectTemplateData.canConnect, |
|
|
|
@ -793,7 +810,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
}; |
|
|
|
|
const singleIcon = new AxImageShape(assetData, this); |
|
|
|
|
this.emit('createIcon', singleIcon); |
|
|
|
|
// this.emit('backgroundScale', this.backgroundImage.scale.x);
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.lineIcon: |
|
|
|
|
this.previewLineSegment.visible = true; |
|
|
|
@ -859,18 +875,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
GameMode: this.canvasData.gameMode, |
|
|
|
|
Tag: this.canvasData.selectTemplateData.tag |
|
|
|
|
}; |
|
|
|
|
// const assetData1 = {
|
|
|
|
|
// ImageUrl: this.canvasData.selectTemplateData.imageUrl,
|
|
|
|
|
// Point: new PIXI.Point(0, 0),
|
|
|
|
|
// Width: 32,
|
|
|
|
|
// Height: 32,
|
|
|
|
|
// MultiPoint: this.paintPoints,
|
|
|
|
|
// Name: this.canvasData.selectTemplateData.name
|
|
|
|
|
// };
|
|
|
|
|
this.paintingIcon = new MultipointIcon(assetData1, this); |
|
|
|
|
// this.paintingIcon = new MultipointIcon(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this,
|
|
|
|
|
// this.canvasData.selectTemplateData.name);
|
|
|
|
|
// this.emit('backgroundScale', this.backgroundImage.scale.x);
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.polygonIcon: |
|
|
|
|
this.previewLineSegment.visible = true; |
|
|
|
@ -1427,6 +1432,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.enterPaintEndButton.visible = false; |
|
|
|
|
switch (this.paintMode) { |
|
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.lineIcon: |
|
|
|
|
if (this.paintPoints.length >= 2) { |
|
|
|
|