|
|
|
@ -18,6 +18,7 @@ import { AxArrowConnector } from './model/axArrowConnector';
|
|
|
|
|
import { AxLegend, Legend } from './model/axLegend'; |
|
|
|
|
import { NullTemplateVisitor } from '@angular/compiler'; |
|
|
|
|
import { AxRectangleShape } from './model/axRectangleShape'; |
|
|
|
|
import { AxGrid } from './model/axGrid'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@ -112,7 +113,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
/** |
|
|
|
|
* 编辑点图片 |
|
|
|
|
*/ |
|
|
|
|
editorPointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png') |
|
|
|
|
editorPointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png'); |
|
|
|
|
/** |
|
|
|
|
* 框选工具图形 |
|
|
|
|
*/ |
|
|
|
@ -136,23 +137,23 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
public animation; |
|
|
|
|
public animationIcon; |
|
|
|
|
public animationTime; |
|
|
|
|
// 车辆作业面
|
|
|
|
|
public carAreas: PolygonIcon[]; |
|
|
|
|
// 车辆数据
|
|
|
|
|
public carData: Map<string, any> = new Map<string, any>(); |
|
|
|
|
// 当前选择的车辆id
|
|
|
|
|
public selectCar: any = null; |
|
|
|
|
// 本软件版本号由四部分组成:<主版本号><次版本号><修订版本号><日期加希腊字母版本号> 例如:1.0.0.20210105_beta
|
|
|
|
|
// Alpha版: 此版本表示该软件在此阶段主要是以实现软件功能为主,通常只在软件开发者内部交流,一般而言,该版本软件的Bug较多,需要继续修改。
|
|
|
|
|
// Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。
|
|
|
|
|
// RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。
|
|
|
|
|
// Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。
|
|
|
|
|
public VERSION = '1.0.6.20210112_beta'; |
|
|
|
|
/** |
|
|
|
|
* 网格 |
|
|
|
|
*/ |
|
|
|
|
public grid: AxGrid = null; |
|
|
|
|
/** |
|
|
|
|
* 本软件版本号由四部分组成:<主版本号><次版本号><修订版本号><日期加希腊字母版本号> 例如:1.0.0.20210105_beta |
|
|
|
|
* Alpha版: 此版本表示该软件在此阶段主要是以实现软件功能为主,通常只在软件开发者内部交流,一般而言,该版本软件的Bug较多,需要继续修改。 |
|
|
|
|
* Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。 |
|
|
|
|
* RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 |
|
|
|
|
* Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 |
|
|
|
|
*/ |
|
|
|
|
public VERSION = '1.0.10.20210118_beta'; |
|
|
|
|
/** |
|
|
|
|
* 数据初始化 |
|
|
|
|
*/ |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
PIXI.utils.skipHello() |
|
|
|
|
PIXI.utils.skipHello(); |
|
|
|
|
this.sayHello(); |
|
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
|
if (event.keyCode === 17) { |
|
|
|
@ -181,28 +182,27 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @param obj 删除一个形状 |
|
|
|
|
*/ |
|
|
|
|
public deleteShape(shape) { |
|
|
|
|
if (this.allowEdit && this.canvasData.gameMode === shape.assetData.GameMode) { |
|
|
|
|
this.emit('deleteIcon',shape); |
|
|
|
|
this.emit('deleteIcon', shape); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 打招呼 |
|
|
|
|
*/ |
|
|
|
|
sayHello() { |
|
|
|
|
var _a; |
|
|
|
|
let _a; |
|
|
|
|
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { |
|
|
|
|
var args = [ |
|
|
|
|
"\n %c 版本号 - " + this.VERSION + "\n", |
|
|
|
|
const args = [ |
|
|
|
|
'\n %c 版本号 - ' + this.VERSION + '\n', |
|
|
|
|
'color: #ff66a5; background: #000000; padding:5px 0;', |
|
|
|
|
]; |
|
|
|
|
(_a = window.console).log.apply(_a, args); |
|
|
|
|
} |
|
|
|
|
else if (window.console) { |
|
|
|
|
window.console.log("\n %c 版本号 - " + this.VERSION + "\n"); |
|
|
|
|
} else if (window.console) { |
|
|
|
|
window.console.log('\n %c 版本号 - ' + this.VERSION + '\n'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -229,7 +229,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (this.backgroundImage.scale.x >= 32) { |
|
|
|
|
this.backgroundImage.scale.x = 32; |
|
|
|
|
this.backgroundImage.scale.y = 32; |
|
|
|
|
this.resizeItem(1/this.backgroundImage.scale.x) |
|
|
|
|
this.resizeItem(1 / this.backgroundImage.scale.x); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.backgroundImage.pivot.set(pivot.x, pivot.y); |
|
|
|
@ -243,7 +243,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (this.backgroundImage.scale.x <= 0.1) { |
|
|
|
|
this.backgroundImage.scale.x = 0.1; |
|
|
|
|
this.backgroundImage.scale.y = 0.1; |
|
|
|
|
this.resizeItem(1/this.backgroundImage.scale.x) |
|
|
|
|
this.resizeItem(1 / this.backgroundImage.scale.x); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.backgroundImage.pivot.set(pivot.x, pivot.y); |
|
|
|
@ -254,10 +254,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.backgroundImage.position.x += delX; |
|
|
|
|
this.backgroundImage.position.y += delY; |
|
|
|
|
} |
|
|
|
|
this.resizeItem(1/this.backgroundImage.scale.x) |
|
|
|
|
this.resizeItem(1 / this.backgroundImage.scale.x); |
|
|
|
|
} |
|
|
|
|
// 重置图形缩放
|
|
|
|
|
public resizeItem(size:number) { |
|
|
|
|
public resizeItem(size: number) { |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if (item instanceof AxShape) { |
|
|
|
|
item.setItemScale(size); |
|
|
|
@ -300,11 +300,24 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
antialias: true, |
|
|
|
|
transparent: false, |
|
|
|
|
resolution: 1, |
|
|
|
|
backgroundColor: 0xE9FAFF |
|
|
|
|
backgroundColor: 0xE9EAEA |
|
|
|
|
}); |
|
|
|
|
this.content.nativeElement.appendChild(this.app.view); |
|
|
|
|
this.app.view.style.border = '1px dashed blue'; |
|
|
|
|
this.animator = new Charm(PIXI); |
|
|
|
|
// 创建网格
|
|
|
|
|
this.grid = new AxGrid(this.app.view.width, null, { color: 0xffffff }, true, true); |
|
|
|
|
// this.grid.x = (this.app.view.width / 2) - (this.grid.gridWidth / 2);
|
|
|
|
|
// this.grid.y = (this.app.view.height / 2) - (this.grid.gridWidth / 2);
|
|
|
|
|
// this.grid.pivot.set(0.5);
|
|
|
|
|
this.grid.x = this.app.stage.x; |
|
|
|
|
this.grid.y = this.app.stage.y; |
|
|
|
|
this.app.stage.addChild(this.grid); |
|
|
|
|
this.grid.drawGrid(); |
|
|
|
|
this.grid.onMousemove = (evt, gridCoord) => { |
|
|
|
|
console.log(gridCoord); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
this.createBackgroundImage(); |
|
|
|
|
this.app.ticker.add((delta) => { |
|
|
|
|
this.animator.update(); |
|
|
|
@ -350,17 +363,17 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
// let upLeft: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture);
|
|
|
|
|
// let upRight: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture);
|
|
|
|
|
// let downLeft: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture);
|
|
|
|
|
// let downRight: PIXI.Sprite = new PIXI.Sprite(this.editorPointTexture);
|
|
|
|
|
// let downRight: PIXI.Sprite = new PIXI.Sprite(this.editorPointTexture);
|
|
|
|
|
// } else {
|
|
|
|
|
axShape.showBorder(); |
|
|
|
|
axShape.drawBorder(1/this.backgroundImage.scale.x); |
|
|
|
|
axShape.setPointVisiable(this.allowEdit);
|
|
|
|
|
axShape.drawBorder(1 / this.backgroundImage.scale.x); |
|
|
|
|
axShape.setPointVisiable(this.allowEdit); |
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 取消选中事件 |
|
|
|
|
*/ |
|
|
|
|
this.on('deselect', (axShape:AxShape)=> { |
|
|
|
|
this.on('deselect', (axShape: AxShape) => { |
|
|
|
|
axShape.hideBorder(); |
|
|
|
|
axShape.setPointVisiable(false); |
|
|
|
|
}); |
|
|
|
@ -368,7 +381,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 创建图标事件(数据处理) |
|
|
|
|
*/ |
|
|
|
|
this.on('createIcon', (axShape: AxShape) => { |
|
|
|
|
console.log("新增图标:"+axShape.assetData.Name); |
|
|
|
|
console.log('新增图标:' + axShape.assetData.Name); |
|
|
|
|
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
|
|
|
|
|
// 添加楼层数据
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
@ -381,23 +394,22 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.canvasData.selectPanelPoint.Data = new FloorNodeData(); |
|
|
|
|
} |
|
|
|
|
this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id] = axShape.assetData; |
|
|
|
|
} else if (axShape.assetData.GameMode === GameMode.Examinee) { // 考生考试
|
|
|
|
|
if (axShape.assetData.Tag === 1) { |
|
|
|
|
this.canvasData.examOriginaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
|
} else { |
|
|
|
|
if (this.canvasData.selectPanelPoint.Data === undefined |
|
|
|
|
|| this.canvasData.selectPanelPoint.Data === null) { |
|
|
|
|
this.canvasData.selectPanelPoint.Data = new FloorNodeData(); |
|
|
|
|
} |
|
|
|
|
this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id] = axShape.assetData; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试
|
|
|
|
|
// if (obj.assetData.Tag === 1) {
|
|
|
|
|
// this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
|
|
|
|
|
// } else {
|
|
|
|
|
// if (this.canvasData.selectPanelPoint.Data === undefined
|
|
|
|
|
// || this.canvasData.selectPanelPoint.Data === null) {
|
|
|
|
|
// this.canvasData.selectPanelPoint.Data = new FloorNodeData();
|
|
|
|
|
// }
|
|
|
|
|
// this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
var temp = this.backgroundImage.getChildByName("图例") as AxLegend; |
|
|
|
|
const temp = this.backgroundImage.getChildByName('图例') as AxLegend; |
|
|
|
|
if ( temp !== undefined |
|
|
|
|
&& temp !== null |
|
|
|
|
&& axShape.assetData.Name !== "图例") { |
|
|
|
|
var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
&& axShape.assetData.Name !== '图例') { |
|
|
|
|
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
temp.addItem(itemLegend); |
|
|
|
|
} |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
@ -406,13 +418,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
/** |
|
|
|
|
* 删除图标事件(数据处理) |
|
|
|
|
*/ |
|
|
|
|
this.on('deleteIcon', (axShape:AxShape)=>{ |
|
|
|
|
this.on('deleteIcon', (axShape: AxShape) => { |
|
|
|
|
// 删除图例对象
|
|
|
|
|
var temp = this.backgroundImage.getChildByName("图例") as AxLegend; |
|
|
|
|
const temp = this.backgroundImage.getChildByName('图例') as AxLegend; |
|
|
|
|
if ( temp !== undefined |
|
|
|
|
&& temp !== null |
|
|
|
|
&& axShape.assetData.Name !== "图例") { |
|
|
|
|
var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
&& axShape.assetData.Name !== '图例') { |
|
|
|
|
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); |
|
|
|
|
temp.deleteItem(itemLegend); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -426,18 +438,17 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; |
|
|
|
|
} |
|
|
|
|
// else if (assetData.GameMode === GameMode.Examinee) { // 考生考试
|
|
|
|
|
// if (assetData.Tag === 1) {
|
|
|
|
|
// // 删除楼层数据
|
|
|
|
|
// delete this.canvasData.examOriginaleveryStoreyData.data[assetData.Id];
|
|
|
|
|
// } else {
|
|
|
|
|
// delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[assetData.Id];
|
|
|
|
|
// delete this.canvasData.selectPanelPoint.Data.Increment[assetData.Id];
|
|
|
|
|
// delete this.canvasData.selectPanelPoint.Data.Stock[assetData.Id];
|
|
|
|
|
// }
|
|
|
|
|
} else if (axShape.assetData.GameMode === GameMode.Examinee) { // 考生考试
|
|
|
|
|
if (axShape.assetData.Tag === 1) { |
|
|
|
|
// 删除楼层数据
|
|
|
|
|
delete this.canvasData.examOriginaleveryStoreyData.data[axShape.assetData.Id]; |
|
|
|
|
} else { |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; |
|
|
|
|
delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
this.backgroundImage.removeChild(axShape); |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
@ -519,7 +530,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 创建楼层图形 |
|
|
|
|
*/ |
|
|
|
|
public createFloorShape(floorData: any) { |
|
|
|
|
if (floorData === undefined || floorData === null) return; |
|
|
|
|
if (floorData === undefined || floorData === null) { return; } |
|
|
|
|
Object.keys(floorData).forEach((key) => { |
|
|
|
|
switch (floorData[key].InteractiveMode) { |
|
|
|
|
case 0: |
|
|
|
@ -535,9 +546,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
case 3: |
|
|
|
|
if (floorData[key].Name === '水带') { |
|
|
|
|
const distance = new AxArrowConnector(floorData[key], this, false, true); |
|
|
|
|
} else if(floorData[key].Name === '距离'){ |
|
|
|
|
} else if (floorData[key].Name === '距离') { |
|
|
|
|
const distance = new AxArrowConnector(floorData[key], this, true, true); |
|
|
|
|
}else if(floorData[key].Name === '普通墙' || floorData[key].Name === '承重墙'){ |
|
|
|
|
} else if (floorData[key].Name === '普通墙' || floorData[key].Name === '承重墙') { |
|
|
|
|
const wall = new AxArrowConnector(floorData[key], this, false, false); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
@ -551,7 +562,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
public createNodeShape(nodeData: any) { |
|
|
|
|
if (nodeData !== undefined && nodeData !== null) { |
|
|
|
|
Object.keys(nodeData).forEach((key) => { |
|
|
|
|
if (nodeData[key] === undefined || nodeData[key] === null) { return;} |
|
|
|
|
if (nodeData[key] === undefined || nodeData[key] === null) { return; } |
|
|
|
|
Object.keys(nodeData[key]).forEach((tempKey) => { |
|
|
|
|
switch (nodeData[key][tempKey].InteractiveMode) { |
|
|
|
|
case 0: |
|
|
|
@ -565,7 +576,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
const polygonIcon = new PolygonIcon(nodeData[key][tempKey], this); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
const pipeline = new AxArrowConnector(nodeData[key][tempKey], this,false,true); |
|
|
|
|
const pipeline = new AxArrowConnector(nodeData[key][tempKey], this, false, true); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -595,8 +606,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
/** |
|
|
|
|
* 创建背景图 |
|
|
|
|
*/ |
|
|
|
|
public createBackgroundImage(){ |
|
|
|
|
this.backgroundImage = PIXI.Sprite.from('assets/images/noImg.png') |
|
|
|
|
public createBackgroundImage() { |
|
|
|
|
this.backgroundImage = PIXI.Sprite.from('assets/images/noImg.png'); |
|
|
|
|
this.backgroundImage.anchor.set(0.5); |
|
|
|
|
// this.backgroundImage.x = this.app.view.width / 2;
|
|
|
|
|
// this.backgroundImage.y = this.app.view.height / 2;
|
|
|
|
@ -618,7 +629,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.data.button !== 0) { return; } |
|
|
|
|
console.log(this.backgroundImage.toLocal(this.mousePosition)); |
|
|
|
|
if (!event.currentTarget.dragging && this.selection.isMultiselection === false) { |
|
|
|
|
this.selection.deselectAll(); |
|
|
|
@ -753,14 +764,14 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
// this.paintingIcon = new PolygonIcon(this.paintPoints, this);
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.Pipeline: |
|
|
|
|
if (this.canvasData.selectTemplateData.name === '水带') { |
|
|
|
|
if (this.paintingShape !== null) { |
|
|
|
|
this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y); |
|
|
|
|
this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y)); |
|
|
|
|
this.paintingShape.assetData.MultiPoint = JSON.parse(JSON.stringify(this.paintPoints)); |
|
|
|
|
this.paintingShape.refresh(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// if (this.canvasData.selectTemplateData.name === '水带-------') {
|
|
|
|
|
// if (this.paintingShape !== null) {
|
|
|
|
|
// this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);
|
|
|
|
|
// this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y));
|
|
|
|
|
// this.paintingShape.assetData.MultiPoint = JSON.parse(JSON.stringify(this.paintPoints));
|
|
|
|
|
// this.paintingShape.refresh();
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
this.previewLineSegment.visible = true; |
|
|
|
|
this.enterPaintEndButton.position = this.circleShadow.position; |
|
|
|
|
this.enterPaintEndButton.visible = true; |
|
|
|
@ -803,17 +814,19 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
Tag: this.canvasData.selectTemplateData.tag |
|
|
|
|
}; |
|
|
|
|
if (this.canvasData.selectTemplateData.name === '距离') { |
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this,true,true);
|
|
|
|
|
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);
|
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this, false, false); |
|
|
|
|
} else if (this.canvasData.selectTemplateData.name === '水带' ) { |
|
|
|
|
this.paintingShape = new AxArrowConnector(assetData2, this, false, true); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.paintingShape.assetData.MultiPoint = JSON.parse(JSON.stringify(this.paintPoints)); |
|
|
|
|
this.paintingShape.redraw(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// }
|
|
|
|
|
// this.emit('backgroundScale', this.backgroundImage.scale.x);
|
|
|
|
|
break; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} else if (!event.currentTarget.dragging && this.selection.isMultiselection === true) { |
|
|
|
|
this.rectToolGraphics.visible = true; |
|
|
|
@ -837,7 +850,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
const rect1 = this.rectToolGraphics.getBounds(); |
|
|
|
|
const rect2 = item.getBounds(); |
|
|
|
|
if (this.isOverlap(rect1, rect2)) { |
|
|
|
|
this.selection.select(item);
|
|
|
|
|
this.selection.select(item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -887,25 +900,25 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.backgroundImage.addChild(this.paintingLine); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
public isOverlap(rect1, rect2):boolean { |
|
|
|
|
const l1 = { x: rect1.x, y: rect1.y } |
|
|
|
|
const r1 = { x: rect1.x + rect1.width, y: rect1.y + rect1.height } |
|
|
|
|
const l2 = { x: rect2.x, y: rect2.y } |
|
|
|
|
const r2 = { x: rect2.x + rect2.width, y: rect2.y + rect2.height } |
|
|
|
|
public isOverlap(rect1, rect2): boolean { |
|
|
|
|
const l1 = { x: rect1.x, y: rect1.y }; |
|
|
|
|
const r1 = { x: rect1.x + rect1.width, y: rect1.y + rect1.height }; |
|
|
|
|
const l2 = { x: rect2.x, y: rect2.y }; |
|
|
|
|
const r2 = { x: rect2.x + rect2.width, y: rect2.y + rect2.height }; |
|
|
|
|
if ( |
|
|
|
|
l1.x > r2.x || |
|
|
|
|
l2.x > r1.x || |
|
|
|
|
l1.y > r2.y || |
|
|
|
|
l2.y > r1.y |
|
|
|
|
) return false |
|
|
|
|
return true |
|
|
|
|
) { return false; } |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新背景图 |
|
|
|
|
*/ |
|
|
|
|
public async refreshBackgroundImage(imageUrl:string = this.canvasData.selectStorey.imageUrl,imageAngle:number = this.canvasData.selectStorey.imageAngle): Promise<void> { |
|
|
|
|
if (imageUrl === undefined || imageUrl === null || imageUrl === "") { |
|
|
|
|
public async refreshBackgroundImage(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise<void> { |
|
|
|
|
if (imageUrl === undefined || imageUrl === null || imageUrl === '') { |
|
|
|
|
this.backgroundImage.visible = false; |
|
|
|
|
} else { |
|
|
|
|
this.backgroundImage.visible = false; |
|
|
|
@ -916,13 +929,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
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; |
|
|
|
|
const imageWidth = this.backgroundImage.texture.width; |
|
|
|
|
const imageHeight = this.backgroundImage.texture.height; |
|
|
|
|
const appWidth = this.app.view.width - 470; |
|
|
|
|
const appHeight = this.app.view.height; |
|
|
|
|
const wScale = appWidth / imageWidth; |
|
|
|
|
const hScale = appHeight / imageHeight; |
|
|
|
|
const scale = wScale < hScale ? wScale : hScale; |
|
|
|
|
// 设置图片缩放
|
|
|
|
|
this.backgroundImage.scale.set(scale); |
|
|
|
|
this.backgroundImage.visible = true; |
|
|
|
@ -930,67 +943,45 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (item instanceof AxShape) { |
|
|
|
|
item.refresh(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 刷新 |
|
|
|
|
* @param imageUrl
|
|
|
|
|
* @param imageAngle
|
|
|
|
|
* @param imageUrl |
|
|
|
|
* @param imageAngle |
|
|
|
|
*/ |
|
|
|
|
public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise<void> { |
|
|
|
|
await this.refreshBackgroundImage(); |
|
|
|
|
|
|
|
|
|
// 清空所有图形
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
let itemList = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => {
|
|
|
|
|
if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) { |
|
|
|
|
itemList.push(item.name);
|
|
|
|
|
const itemList = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { |
|
|
|
|
itemList.push(item.name); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
itemList.forEach(item => {
|
|
|
|
|
itemList.forEach(item => { |
|
|
|
|
this.backgroundImage.getChildByName(item).destroy(); |
|
|
|
|
// let child = this.backgroundImage.getChildByName(item);
|
|
|
|
|
// this.backgroundImage.removeChild(child);
|
|
|
|
|
}) |
|
|
|
|
//加载当前数据
|
|
|
|
|
}); |
|
|
|
|
// 加载当前数据
|
|
|
|
|
this.createFloorShape(this.canvasData.originaleveryStoreyData.data); |
|
|
|
|
// 创建处置预案图形
|
|
|
|
|
this.createNodeShape(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
this.createAxLegend(); |
|
|
|
|
|
|
|
|
|
// // 测试代码
|
|
|
|
|
// const tempAssetData = {
|
|
|
|
|
// Id: "图例",//ObjectID.default.generate()
|
|
|
|
|
// Color: "#066EED80",
|
|
|
|
|
// PropertyInfos: [
|
|
|
|
|
// {
|
|
|
|
|
// Tag : '',
|
|
|
|
|
// Order : 0,
|
|
|
|
|
// Enabled : true,
|
|
|
|
|
// Visible : true,
|
|
|
|
|
// Required : false,
|
|
|
|
|
// RuleName : "",
|
|
|
|
|
// RuleValue : "",
|
|
|
|
|
// PhysicalUnit : "",
|
|
|
|
|
// PropertyName : "列",
|
|
|
|
|
// PropertyType : 2,
|
|
|
|
|
// PropertyValue : 2,
|
|
|
|
|
// },
|
|
|
|
|
// ]
|
|
|
|
|
// };
|
|
|
|
|
// var rectShape = new AxRectangleShape(0, 0, 100, 100,tempAssetData,this);
|
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 创建安信图例 |
|
|
|
|
*/ |
|
|
|
|
public createAxLegend() { |
|
|
|
|
const tempAssetData = { |
|
|
|
|
Id: "图例", |
|
|
|
|
Name:"图例", |
|
|
|
|
Color: "#066EED80", |
|
|
|
|
Id: '图例', |
|
|
|
|
Name: '图例', |
|
|
|
|
Color: '#066EED80', |
|
|
|
|
TemplateId: null, |
|
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
|
Angle: 0, |
|
|
|
@ -1016,10 +1007,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
Enabled : true, |
|
|
|
|
Visible : true, |
|
|
|
|
Required : false, |
|
|
|
|
RuleName : "", |
|
|
|
|
RuleValue : "", |
|
|
|
|
PhysicalUnit : "", |
|
|
|
|
PropertyName : "列", |
|
|
|
|
RuleName : '', |
|
|
|
|
RuleValue : '', |
|
|
|
|
PhysicalUnit : '', |
|
|
|
|
PropertyName : '列', |
|
|
|
|
PropertyType : 2, |
|
|
|
|
PropertyValue : 2, |
|
|
|
|
}, |
|
|
|
@ -1028,13 +1019,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
PivotX: 0, |
|
|
|
|
PivotY: 0, |
|
|
|
|
}; |
|
|
|
|
let shapeMap: Map<string,Legend> = new Map<string,Legend>(); |
|
|
|
|
const shapeMap: Map<string, Legend> = new Map<string, Legend>(); |
|
|
|
|
let data = null; |
|
|
|
|
for (let item in this.canvasData.originaleveryStoreyData.data) { |
|
|
|
|
for (const item in this.canvasData.originaleveryStoreyData.data) { |
|
|
|
|
if (shapeMap.has(this.canvasData.originaleveryStoreyData.data[item].Name)) { |
|
|
|
|
shapeMap.get(this.canvasData.originaleveryStoreyData.data[item].Name).Count++; |
|
|
|
|
} else { |
|
|
|
|
if (item !== "图例") { |
|
|
|
|
if (item !== '图例') { |
|
|
|
|
shapeMap.set(this.canvasData.originaleveryStoreyData.data[item].Name, new Legend( |
|
|
|
|
this.canvasData.originaleveryStoreyData.data[item].Name, |
|
|
|
|
this.canvasData.originaleveryStoreyData.data[item].ImageUrl, |
|
|
|
@ -1046,15 +1037,15 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (data === null) { |
|
|
|
|
var axLegend = new AxLegend(tempAssetData, this, shapeMap); |
|
|
|
|
var rect = this.backgroundImage.getLocalBounds(); |
|
|
|
|
var itemRect = axLegend.getLocalBounds(); |
|
|
|
|
const axLegend = new AxLegend(tempAssetData, this, shapeMap); |
|
|
|
|
const rect = this.backgroundImage.getLocalBounds(); |
|
|
|
|
const itemRect = axLegend.getLocalBounds(); |
|
|
|
|
axLegend.x = rect.right - itemRect.right; |
|
|
|
|
axLegend.y = rect.bottom - itemRect.bottom; |
|
|
|
|
axLegend.assetData.Point = new PIXI.Point(axLegend.x, axLegend.y); |
|
|
|
|
this.emit('createIcon', axLegend); |
|
|
|
|
} else { |
|
|
|
|
var axLegend = new AxLegend(data, this, shapeMap); |
|
|
|
|
const axLegend = new AxLegend(data, this, shapeMap); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// /**
|
|
|
|
@ -1083,15 +1074,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* 创建预览单点图标 |
|
|
|
|
*/ |
|
|
|
|
private createPreviewImage(): void { |
|
|
|
|
// if (this.previewSinglePointIcon === null) {
|
|
|
|
|
// this.previewSinglePointIcon = PIXI.Sprite.from(this.canvasData.selectTemplateData.imageUrl);
|
|
|
|
|
// this.previewSinglePointIcon.width = this.canvasData.selectTemplateData.width;
|
|
|
|
|
// this.previewSinglePointIcon.height = this.canvasData.selectTemplateData.height;
|
|
|
|
|
// this.previewSinglePointIcon.anchor.set(0.5);
|
|
|
|
|
// this.previewSinglePointIcon.interactive = false;
|
|
|
|
|
// this.backgroundImage.addChild(this.previewSinglePointIcon);
|
|
|
|
|
// this.previewSinglePointIcon.scale.set(1 / this.backgroundImage.scale.x);
|
|
|
|
|
// }
|
|
|
|
|
this.previewImage = new AxPreviewImageShape(this); |
|
|
|
|
this.previewImage.visible = false; |
|
|
|
|
} |
|
|
|
@ -1113,7 +1095,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
*/ |
|
|
|
|
private refreshPreviewLineSegment(pointA: PIXI.Point, pointB: PIXI.Point) { |
|
|
|
|
this.previewLineSegment.clear(); |
|
|
|
|
this.previewLineSegment.lineStyle(1/this.backgroundImage.scale.x, 0x00ff00, 1); |
|
|
|
|
this.previewLineSegment.lineStyle(1 / this.backgroundImage.scale.x, 0x00ff00, 1); |
|
|
|
|
this.previewLineSegment.moveTo(pointA.x, pointA.y); |
|
|
|
|
this.previewLineSegment.lineTo(pointB.x, pointB.y ); |
|
|
|
|
} |
|
|
|
@ -1122,9 +1104,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* @param x 半径 |
|
|
|
|
*/ |
|
|
|
|
private createCircleShadow(): void { |
|
|
|
|
// this.circleShadow.beginFill(0xFFCC5A);
|
|
|
|
|
// this.circleShadow.drawCircle(0, 0, 10);
|
|
|
|
|
// this.circleShadow.endFill();
|
|
|
|
|
this.circleShadow.visible = false; |
|
|
|
|
this.backgroundImage.addChild(this.circleShadow); |
|
|
|
|
} |
|
|
|
@ -1134,18 +1113,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
private refreshPreviewPoint() { |
|
|
|
|
this.circleShadow.clear(); |
|
|
|
|
this.circleShadow.beginFill(0x00ff00); |
|
|
|
|
this.circleShadow.drawCircle(0, 0, 5/this.backgroundImage.scale.x); |
|
|
|
|
this.circleShadow.drawCircle(0, 0, 5 / this.backgroundImage.scale.x); |
|
|
|
|
this.circleShadow.endFill(); |
|
|
|
|
} |
|
|
|
|
showConnectionPoint(b: boolean) { |
|
|
|
|
this.backgroundImage?.children.forEach(item => { |
|
|
|
|
if (item instanceof AxImageShape) { |
|
|
|
|
if (item.assetData.CanConnect) { |
|
|
|
|
item.showConnectionPoint(b); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 开始绘制 |
|
|
|
|
*/ |
|
|
|
@ -1198,14 +1168,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.circleShadow.visible = true; |
|
|
|
|
break; |
|
|
|
|
case PaintMode.Pipeline: |
|
|
|
|
if (this.canvasData.selectTemplateData.name==='水带') { |
|
|
|
|
this.showConnectionPoint(true); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.endPaint: |
|
|
|
|
this.showConnectionPoint(false); |
|
|
|
|
if (this.previewImage !== null) { |
|
|
|
|
this.previewImage.visible = false; |
|
|
|
|
} |
|
|
|
@ -1214,11 +1179,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
&& this.paintingIcon !== null) { |
|
|
|
|
this.backgroundImage.removeChild(this.paintingIcon); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (this.paintingShape !== undefined
|
|
|
|
|
// && this.paintingShape !== null) {
|
|
|
|
|
// this.backgroundImage.removeChild(this.paintingShape);
|
|
|
|
|
// }
|
|
|
|
|
if (this.paintingShape !== null) { |
|
|
|
|
this.backgroundImage.removeChild(this.paintingShape); |
|
|
|
|
this.paintingShape = null; |
|
|
|
@ -1300,14 +1260,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case PaintMode.Pipeline: |
|
|
|
|
if (this.canvasData.selectTemplateData.name !== '水带') { |
|
|
|
|
this.emit('createIcon', this.paintingShape); |
|
|
|
|
this.paintingShape = null; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
this.paintPoints.splice(0, this.paintPoints.length); |
|
|
|
|
// this.emit('backgroundScale', this.backgroundImage.scale.x);
|
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 复制 |
|
|
|
@ -1331,34 +1288,33 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
newData.BuildingId = buildingId; |
|
|
|
|
newData.FloorId = floorId; |
|
|
|
|
newData.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); |
|
|
|
|
// if (newData.IsFromBuilding) {
|
|
|
|
|
// this.canvasData.originalcompanyBuildingData.data[newData.Id] = newData;
|
|
|
|
|
// } else {
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data[newData.Id] = newData; |
|
|
|
|
// }
|
|
|
|
|
switch (item.InteractiveMode) { |
|
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
|
const singleIcon = new AxImageShape(newData, this); |
|
|
|
|
this.emit('createIcon', singleIcon); |
|
|
|
|
break; |
|
|
|
|
case PaintMode.lineIcon: |
|
|
|
|
const lineIcon = new MultipointIcon(newData, this); |
|
|
|
|
this.emit('createIcon', lineIcon); |
|
|
|
|
break; |
|
|
|
|
case PaintMode.polygonIcon: |
|
|
|
|
const polygonIcon = new PolygonIcon(newData, this); |
|
|
|
|
this.emit('createIcon', polygonIcon); |
|
|
|
|
break; |
|
|
|
|
case PaintMode.Pipeline: |
|
|
|
|
if (item.Name === '距离') { |
|
|
|
|
const wall = new AxArrowConnector(newData, this,true,true); |
|
|
|
|
const wall = new AxArrowConnector(newData, this, true, true); |
|
|
|
|
this.emit('createIcon', wall); |
|
|
|
|
} else if (item.Name === '普通墙' || item.Name === '承重墙') { |
|
|
|
|
const wall = new AxArrowConnector(newData, this,false,false); |
|
|
|
|
const wall = new AxArrowConnector(newData, this, false, false); |
|
|
|
|
this.emit('createIcon', wall); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
this.selection.select(this.backgroundImage.getChildByName(newData.Id)); |
|
|
|
|
}); |
|
|
|
|
// this.emit('backgroundScale', this.backgroundImage.scale.x);
|
|
|
|
|
} |
|
|
|
|
////////////////////////////////////////////////////////////////////////通用/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//////////////////////////////////////////////////////////////////////// 通用/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @param id 图标ID |
|
|
|
@ -1369,97 +1325,87 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.backgroundImage.getChildByName(item).visible = b; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
////////////////////////////////////////////////////////////////////////采集平台加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//////////////////////////////////////////////////////////////////////// 采集平台加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////编制平台加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//////////////////////////////////////////////////////////////////////// 编制平台加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////考试系统加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//////////////////////////////////////////////////////////////////////// 考试系统加载逻辑///////////////////////////////////////////////////////////////////////
|
|
|
|
|
/** |
|
|
|
|
* 考生点击楼层 |
|
|
|
|
*/ |
|
|
|
|
public async onExamineeClickFloor() { |
|
|
|
|
// 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);
|
|
|
|
|
// // 清空所有图形
|
|
|
|
|
// this.selection.deselectAll();
|
|
|
|
|
// let itemList = [];
|
|
|
|
|
// this.backgroundImage.children.forEach(item => {
|
|
|
|
|
// if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) {
|
|
|
|
|
// itemList.push(item.name);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
await this.refreshBackgroundImage(); |
|
|
|
|
// 清空所有图形
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
const itemList = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { |
|
|
|
|
itemList.push(item.name); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// itemList.forEach(item => {
|
|
|
|
|
// this.backgroundImage.getChildByName(item).destroy();
|
|
|
|
|
// })
|
|
|
|
|
// // 创建楼层图形
|
|
|
|
|
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
|
|
|
|
|
// // 创建楼层图形
|
|
|
|
|
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
|
|
|
|
|
// // 创建处置预案图形
|
|
|
|
|
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
|
|
|
|
|
// // 隐藏图标
|
|
|
|
|
// this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
|
|
|
|
|
// this.backgroundImage.visible = true;
|
|
|
|
|
itemList.forEach(item => { |
|
|
|
|
this.backgroundImage.getChildByName(item).destroy(); |
|
|
|
|
}); |
|
|
|
|
// 创建楼层图形
|
|
|
|
|
this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); |
|
|
|
|
// 创建楼层图形
|
|
|
|
|
this.createFloorShape(this.canvasData.originaleveryStoreyData.data); |
|
|
|
|
// 创建处置预案图形
|
|
|
|
|
this.createNodeShape(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
// 隐藏图标
|
|
|
|
|
this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 考官点击楼层 |
|
|
|
|
* 考官点击楼层-阅卷 |
|
|
|
|
*/ |
|
|
|
|
public async onExaminerClickFloor() { |
|
|
|
|
// 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);
|
|
|
|
|
// // 清空所有图形
|
|
|
|
|
// this.selection.deselectAll();
|
|
|
|
|
// let itemList = [];
|
|
|
|
|
// this.backgroundImage.children.forEach(item => {
|
|
|
|
|
// if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) {
|
|
|
|
|
// itemList.push(item.name);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
await this.refreshBackgroundImage(); |
|
|
|
|
// 清空所有图形
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
const itemList = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { |
|
|
|
|
itemList.push(item.name); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// itemList.forEach(item => {
|
|
|
|
|
// this.backgroundImage.getChildByName(item).destroy();
|
|
|
|
|
// })
|
|
|
|
|
// // 创建楼层图形
|
|
|
|
|
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
|
|
|
|
|
// // 创建楼层图形
|
|
|
|
|
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
|
|
|
|
|
// // 创建处置预案图形
|
|
|
|
|
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
|
|
|
|
|
// // 隐藏图标
|
|
|
|
|
// this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
|
|
|
|
|
// this.backgroundImage.visible = true;
|
|
|
|
|
itemList.forEach(item => { |
|
|
|
|
this.backgroundImage.getChildByName(item).destroy(); |
|
|
|
|
}); |
|
|
|
|
// 创建楼层图形
|
|
|
|
|
this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); |
|
|
|
|
// 创建楼层图形
|
|
|
|
|
this.createFloorShape(this.canvasData.originaleveryStoreyData.data); |
|
|
|
|
// 创建处置预案图形
|
|
|
|
|
this.createNodeShape(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
// 隐藏图标
|
|
|
|
|
this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 考官点击楼层-创建试卷 |
|
|
|
|
*/ |
|
|
|
|
public async onExaminerClickFloor_CreateTestpaper() { |
|
|
|
|
await this.refreshBackgroundImage(); |
|
|
|
|
// 清空所有图形
|
|
|
|
|
this.selection.deselectAll(); |
|
|
|
|
const itemList = []; |
|
|
|
|
this.backgroundImage.children.forEach(item => { |
|
|
|
|
if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { |
|
|
|
|
itemList.push(item.name); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
itemList.forEach(item => { |
|
|
|
|
this.backgroundImage.getChildByName(item).destroy(); |
|
|
|
|
}); |
|
|
|
|
// 创建楼层图形
|
|
|
|
|
this.createFloorShape(this.canvasData.originaleveryStoreyData.data); |
|
|
|
|
// 创建处置预案图形
|
|
|
|
|
this.createNodeShape(this.canvasData.selectPanelPoint.Data); |
|
|
|
|
// 隐藏图标
|
|
|
|
|
this.setNameVisible(false, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|