chenjingyu 4 years ago
parent
commit
99f15a9008
  1. 19
      src/app/ui/collection-tools-examinee/collection-tools.component.ts
  2. 19
      src/app/ui/collection-tools-read/collection-tools.component.ts
  3. 3
      src/app/ui/collection-tools/collection-tools.component.ts
  4. 41
      src/app/working-area/model/arrows.ts
  5. 294
      src/app/working-area/model/axImageShape.ts
  6. 9
      src/app/working-area/model/axShape.ts
  7. 1
      src/app/working-area/model/multipointIcon.ts
  8. 203
      src/app/working-area/working-area.component.ts

19
src/app/ui/collection-tools-examinee/collection-tools.component.ts

@ -525,7 +525,7 @@ export class CollectionToolsExamineeComponent implements OnInit {
this.canvas.on("select",obj=>{
//选中素材属性注入函数
this.setAssetsProperty(obj.assetData)
console.log(obj.assetData)
})
// 监听canvas组件取消选中素材事件
this.canvas.on("deselect",obj=>{
@ -872,9 +872,6 @@ export class CollectionToolsExamineeComponent implements OnInit {
async renovateTreeData (isRefresh:boolean = true) {
this.allFireElements[this.allFireElements.length-1].children = []
this.beforeOneCheckedBuildingIsShow = false
isRefresh? await this.canvas.refresh() : null
this.canvas.setNameVisible(this.basicInfo,0)
this.canvas.setNameVisible(this.wantToWork,1)
isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false
isRefresh? this.isShowProperty = true : null
isRefresh? this.isShowAttribute = true : null
@ -1045,17 +1042,23 @@ export class CollectionToolsExamineeComponent implements OnInit {
this.renovateTreeData()
if(this.Facilities){
console.log(1111)
this.Facilities.forEach(item => {
console.log('走这里了')
this.Facilities.forEach((item,key) => {
if(item.key == this.selectingSitePlan.id){
console.log(333)
//如果当层有需要标记的基本信息素材
this.getAllAssetLibraries(item)
}else{
console.log(444)
this.canvas.onExamineeClickFloor()
if(key == this.Facilities.length - 1 ){
console.log(444)
this.canvas.onExamineeClickFloor()
}
}
})
}else{
console.log('走这里了')
console.log(2222)
this.canvas.onExamineeClickFloor();
this.allLibrary = this.originalallLibrary
@ -1084,6 +1087,7 @@ export class CollectionToolsExamineeComponent implements OnInit {
this.canvasData.examOriginaleveryStoreyData.buildingAreaId? null : this.canvasData.examOriginaleveryStoreyData.buildingAreaId = e.id || null
this.renovateTreeData()
if(this.Facilities){
console.log('走这里了')
this.Facilities.forEach(item => {
if(item.key == this.selectingSitePlan.id){
this.getAllAssetLibraries(item)
@ -1092,6 +1096,7 @@ export class CollectionToolsExamineeComponent implements OnInit {
}
})
}else{
console.log('走这里了')
this.canvas.onExamineeClickFloor();this.allLibrary = this.originalallLibrary
}
})

19
src/app/ui/collection-tools-read/collection-tools.component.ts

@ -416,17 +416,17 @@ export class CollectionToolsReadComponent implements OnInit {
let iconVisibleArr:any = []
console.log(this.renderData)
this.renderData.forEach(item =>{
if(item.Id && item.isLook == false){
if(item.Id && item.isLook == true){
iconVisibleArr.push(item.Id)
}else{
if(item.children && item.children.length != 0){
item.children.forEach(i => {
if(i.Id && i.isLook == false){
if(i.Id && i.isLook == true){
iconVisibleArr.push(i.Id)
}else{
if(i.children && i.children.length != 0){
i.children.forEach(element => {
if(element.Id && element.isLook == false){
if(element.Id && element.isLook == true){
iconVisibleArr.push(element.Id)
}
})
@ -438,12 +438,12 @@ export class CollectionToolsReadComponent implements OnInit {
})
console.log(iconVisibleArr)
this.canvasData.originaleveryStoreyData = JSON.parse(JSON.stringify(this.originaleveryStoreyData))
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.hiddenBasicInfoFacilities = iconVisibleArr
this.canvas.onExamineeClickFloor()
// this.canvasData.originaleveryStoreyData = JSON.parse(JSON.stringify(this.originaleveryStoreyData))
// this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
// this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
// this.canvasData.hiddenBasicInfoFacilities = iconVisibleArr
// this.canvas.onExamineeClickFloor()
this.canvas.setIconVisible(iconVisibleArr,true)
}
//打开消防设施考题设定
@ -554,7 +554,6 @@ export class CollectionToolsReadComponent implements OnInit {
async renovateTreeData (isRefresh:boolean = true) {
this.allFireElements[this.allFireElements.length-1].children = []
this.beforeOneCheckedBuildingIsShow = false
isRefresh? await this.canvas.refresh() : null
isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false
isRefresh? this.isShowProperty = true : null
isRefresh? this.isShowAttribute = true : null

3
src/app/ui/collection-tools/collection-tools.component.ts

@ -1109,9 +1109,6 @@ export class CollectionToolsComponent implements OnInit {
this.allFireElements[this.allFireElements.length-1].children = []
this.beforeOneCheckedBuildingIsShow = false
// isRefresh? await this.canvas.refresh() : null
this.canvas.setNameVisible(this.basicInfo,0)
this.canvas.setNameVisible(this.wantToWork,1)
isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false
isRefresh? this.isShowProperty = true : null
isRefresh? this.isShowAttribute = true : null

41
src/app/working-area/model/arrows.ts

@ -1,41 +0,0 @@
import { WorkingAreaComponent } from '../working-area.component';
import * as PIXI from 'pixi.js';
/**
*
* 2
*/
export class Arrows extends PIXI.Container {
public line: PIXI.Graphics = new PIXI.Graphics();
public ready = false;
constructor(public assetData: any, private workingArea: WorkingAreaComponent) {
super();
this.workingArea.backgroundImage.addChild(this);
this.name = this.assetData.Id;
this.addChild(this.line);
this.refresh();
this.interactive = true;
this.on('mousedown', event => {
if (!this.ready) { return; }
event.stopPropagation();
this.workingArea.selection.selectOne(this);
});
}
/**
*
*/
public refresh() {
this.line.clear();
this.line.lineStyle(5, 0xff0000, 1);
this.line.moveTo(this.assetData.pointA.x, this.assetData.pointA.y);
this.line.lineTo(this.assetData.pointB.x, this.assetData.pointB.y);
const angle = Math.atan2((this.assetData.pointB.y - this.assetData.pointA.y), (this.assetData.pointB.x - this.assetData.pointA.x))
* (180 / Math.PI) + 90;
this.line.beginFill(0xff0000);
console.log(Math.PI / 180 / 1.6);
this.line.drawStar(this.assetData.pointB.x, this.assetData.pointB.y, 3, 10, 0, (Math.PI / 180 * angle));
this.line.endFill();
}
}

294
src/app/working-area/model/axImageShape.ts

@ -13,6 +13,8 @@ import { AxArrowConnector } from './axArrowConnector';
* AxImageShape
*/
export class AxImageShape extends AxShape {
pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png')
connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png');
style = new PIXI.TextStyle({
fontFamily: 'Arial',
fontSize: 18,
@ -34,26 +36,19 @@ export class AxImageShape extends AxShape {
+ '\r\n'
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style);
/**
*
*/
image: PIXI.Sprite;
selectionBox = new PIXI.Graphics();
connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png');
connectPoint: Sprite;
// 可移动的
// 可选中的
connectPoint: Sprite;
// up: PIXI.Sprite;
// down: PIXI.Sprite;
// left: PIXI.Sprite;
// right: PIXI.Sprite;
// upLeft: PIXI.Sprite;
// upRight: PIXI.Sprite;
// downLeft: PIXI.Sprite;
// downRight: PIXI.Sprite;
up: PIXI.Sprite;
down: PIXI.Sprite;
left: PIXI.Sprite;
right: PIXI.Sprite;
upLeft: PIXI.Sprite;
upRight: PIXI.Sprite;
downLeft: PIXI.Sprite;
downRight: PIXI.Sprite;
constructor(assetData: any, workingArea: WorkingAreaComponent) {
super(assetData, workingArea);
this.x = this.assetData.Point.x;
@ -68,74 +63,6 @@ export class AxImageShape extends AxShape {
this.image.height = this.assetData.Height;
this.image.alpha = 1;
this.image.anchor.set(0.5);
// this.image.interactive = true;
// this.image.buttonMode = true;
// this.image
// .on('mousedown', event => {
// event.stopPropagation();
// this.workingArea.selection.selectOne(this);
// // this.paintingPipeline(this.x, this.y);
// // 如果链接对象不为空,禁止移动
// if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
// event.currentTarget.parent.data = event.data;
// event.currentTarget.parent.alpha = 0.5;
// event.currentTarget.parent.dragging = true;
// }
// })
// .on('mouseup', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mouseupoutside', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mousemove', event => {
// if (event.currentTarget.parent.dragging) {
// // // 如果拖动过程中发现父对象不是背景图
// // if (this.parent !== this.workingArea.backgroundImage) {
// // this.setParent(this.workingArea.backgroundImage);
// // if (this.assetData.FixedSize) {
// // const scale = 1 / this.workingArea.backgroundImage.scale.x;
// // this.scale.set(scale);
// // }
// // }
// const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.x = newPosition.x;
// event.currentTarget.parent.y = newPosition.y;
// this.assetData.Point = new PIXI.Point(this.x, this.y);
// this.workingArea.canvasData.isChange = true;
// }
// })
// .on('rightclick', event => {
// })
// .on('mouseover', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = false;
// }
// // if (this.assetData.CanConnect) {
// // this.setSelectionBox(true, this.image);
// // }
// })
// .on('mouseout', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = true;
// }
// // if (this.assetData.CanConnect) {
// // this.setSelectionBox(false);
// // }
// });
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height / 2;
this.text.anchor.set(0.5, 1);
@ -144,6 +71,32 @@ export class AxImageShape extends AxShape {
this.addChild(this.image);
this.addChild(this.selectionBox);
////
let rect = this.getLocalBounds();
// up-left
this.upLeft = new PIXI.Sprite(this.pointTexture);
this.upLeft.anchor.set(0.5);
this.addChild(this.upLeft);
this.upLeft.interactive = true;
// up-right
this.upRight = new PIXI.Sprite(this.pointTexture);
this.upRight.anchor.set(0.5);
this.addChild(this.upRight);
this.upRight.interactive = true;
// down-left
this.downLeft = new PIXI.Sprite(this.pointTexture);
this.downLeft.anchor.set(0.5);
this.addChild(this.downLeft);
this.downLeft.interactive = true;
// down-right
this.downRight = new PIXI.Sprite(this.pointTexture);
this.downRight.anchor.set(0.5);
this.addChild(this.downRight);
this.downRight.interactive = true;
////
if (this.assetData.CanConnect) {
// connectPoint
this.connectPoint = new PIXI.Sprite(this.connectPointTexture);
@ -162,170 +115,7 @@ export class AxImageShape extends AxShape {
})
.on('mouseout', event => {
this.setSelectionBox(false);
});
// // up
// this.up = new PIXI.Sprite(this.selectedPointTexture);
// this.up.anchor.set(0.5);
// this.up.x = this.image.x;
// this.up.y = this.image.y - (this.image.height / 2);
// this.addChild(this.up);
// this.up.interactive = true;
// this.up
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.up.x, this.up.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.up);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down
// this.down = new PIXI.Sprite(this.selectedPointTexture);
// this.down.anchor.set(0.5);
// this.down.x = this.image.x;
// this.down.y = this.image.y + (this.image.height / 2);
// this.addChild(this.down);
// this.down.interactive = true;
// this.down
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.down.x, this.down.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.down);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // left
// this.left = new PIXI.Sprite(this.selectedPointTexture);
// this.left.anchor.set(0.5);
// this.left.x = this.image.x - (this.image.width / 2);
// this.left.y = this.image.y;
// this.addChild(this.left);
// this.left.interactive = true;
// this.left
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.left.x, this.left.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.left);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // right
// this.right = new PIXI.Sprite(this.selectedPointTexture);
// this.right.anchor.set(0.5);
// this.right.x = this.image.x + (this.image.width / 2);
// this.right.y = this.image.y;
// this.addChild(this.right);
// this.right.interactive = true;
// this.right
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.right.x, this.right.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.right);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // up-left
// this.upLeft = new PIXI.Sprite(this.selectedPointTexture);
// this.upLeft.anchor.set(0.5);
// this.upLeft.x = this.image.x - (this.image.width / 2);
// this.upLeft.y = this.image.y - (this.image.height / 2);
// this.addChild(this.upLeft);
// this.upLeft.interactive = true;
// this.upLeft
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.upLeft.x, this.upLeft.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.upLeft);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // up-right
// this.upRight = new PIXI.Sprite(this.selectedPointTexture);
// this.upRight.anchor.set(0.5);
// this.upRight.x = this.image.x + (this.image.width / 2);
// this.upRight.y = this.image.y - (this.image.height / 2);
// this.addChild(this.upRight);
// this.upRight.interactive = true;
// this.upRight
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.upRight.x, this.upRight.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.upRight);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down-left
// this.downLeft = new PIXI.Sprite(this.selectedPointTexture);
// this.downLeft.anchor.set(0.5);
// this.downLeft.x = this.image.x - (this.image.width / 2);
// this.downLeft.y = this.image.y + (this.image.height / 2);
// this.addChild(this.downLeft);
// this.downLeft.interactive = true;
// this.downLeft
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.downLeft.x, this.downLeft.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.downLeft);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down-right
// this.downRight = new PIXI.Sprite(this.selectedPointTexture);
// this.downRight.anchor.set(0.5);
// this.downRight.x = this.image.x + (this.image.width / 2);
// this.downRight.y = this.image.y + (this.image.height / 2);
// this.addChild(this.downRight);
// this.downRight.interactive = true;
// this.downRight
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.downRight.x, this.downRight.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.downRight);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
this.showConnectionPoint(false);
});
}
}
// 设置选择框
@ -334,14 +124,6 @@ export class AxImageShape extends AxShape {
this.selectionBox.lineStyle(2, 0x00EB00, 1);
this.selectionBox.position = sprite.position;
this.selectionBox.drawRect(- sprite.width / 2, - sprite.height / 2, sprite.width, sprite.height);
// const p0 = new PIXI.Point(- sprite.width / 2, - sprite.height / 2);
// const pe = new PIXI.Point(sprite.width / 2, sprite.height / 2);
// const pw = new PIXI.Point(p0.x + sprite.width, p0.y);
// const ph = new PIXI.Point(p0.x, p0.y + sprite.height);
// this.drawDashedLine(this.selectionBox, p0, pw, 0x1234ff);
// this.drawDashedLine(this.selectionBox, p0, ph, 0x1234ff);
// this.drawDashedLine(this.selectionBox, pe, pw, 0x1234ff);
// this.drawDashedLine(this.selectionBox, pe, ph, 0x1234ff);
} else {
this.selectionBox.clear();
}

9
src/app/working-area/model/axShape.ts

@ -19,6 +19,7 @@ export class AxShape extends Container {
showName = true;
// 边框
border: PIXI.Graphics = new PIXI.Graphics();
constructor(assetData: any, workingArea: WorkingAreaComponent) {
super();
this.border.visible = false;
@ -118,12 +119,12 @@ export class AxShape extends Container {
this.border.clear();
this.border.visible = false;
}
/**
/**
*
* @param b true/false
* @param value
*/
public setPointsVisible(b:boolean) {
public setPointVisiable(value: boolean) {
}
/**
*

1
src/app/working-area/model/multipointIcon.ts

@ -164,6 +164,7 @@ export class MultipointIcon extends AxShape {
this.iconsTilingSprite[index - 1].angle = angleC;
this.iconsTilingSprite[index - 1].width = distanceC;
}
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
}
})
.on('rightclick', event => {

203
src/app/working-area/working-area.component.ts

@ -154,25 +154,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.selection.objects.forEach(item => {
if (this.allowEdit
&& this.canvasData.gameMode === item.assetData.GameMode) {
switch (this.canvasData.gameMode) {
case 0:
// 删除楼层数据
delete this.canvasData.originaleveryStoreyData.data[item.assetData.Id];
// 删除建筑数据
delete this.canvasData.originalcompanyBuildingData.data[item.assetData.Id];
// 取消渲染
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
// 数据更改
this.canvasData.isChange = true;
break;
case 1:
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[item.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Increment[item.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Stock[item.assetData.Id];
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
this.canvasData.isChange = true;
break;
}
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
}
});
this.selection.deselectAll();
@ -310,11 +292,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.on('select', shape => {
if (shape instanceof AxShape) {
shape.showBorder();
if (this.allowEdit) {
} else {
}
shape.setPointVisiable(this.allowEdit);
}
});
/**
@ -323,27 +301,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.on('deselect', shape => {
if (shape instanceof AxShape) {
shape.hideBorder();
if (this.allowEdit) {
} else {
}
shape.setPointVisiable(this.allowEdit);
}
// if (this.allowEdit) {
// if (obj instanceof AxArrowConnector) {
// obj.setPointsVisible(false);
// }
// else if (obj instanceof MultipointIcon) {
// obj.setPointVisiable(false);
// } else if (obj instanceof PolygonIcon) {
// obj.filters = [];
// obj.setPointVisiable(false);
// } else {
// obj.filters = [];
// }
// } else {
// obj.filters = [];
// }
});
/**
*
@ -370,7 +329,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} else if (item instanceof AxPreviewImageShape) {
const data = 1 / scale;
item.scale.set(data);
}else if (item instanceof AxArrowConnector) {
} else if (item instanceof AxArrowConnector) {
const data = 1 / scale;
item.text.scale.set(data);
item.pointSprites.forEach(point => {
@ -381,7 +340,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
});
/**
*
*
*/
this.on('createIcon', obj => {
if (obj.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
@ -389,26 +348,50 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
// 添加建筑数据
this.canvasData.originalcompanyBuildingData.data[obj.assetData.Id] = obj.assetData;
} else if(obj.assetData.GameMode === GameMode.Assignment){ // 处置预案
} else if (obj.assetData.GameMode === GameMode.Assignment) { // 处置预案
if (this.canvasData.selectPanelPoint.Data === undefined
|| this.canvasData.selectPanelPoint.Data === null) {
|| this.canvasData.selectPanelPoint.Data === null) {
this.canvasData.selectPanelPoint.Data = new FloorNodeData();
}
this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData;
} else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试
console.log(obj.assetData.Tag)
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 === null) {
this.canvasData.selectPanelPoint.Data = new FloorNodeData();
}
this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData;
}
}
this.canvasData.isChange = true;
});
/**
* ()
*/
this.on('deleteIcon', obj => {
if (obj.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
// 删除楼层数据
delete this.canvasData.originaleveryStoreyData.data[obj.assetData.Id];
// 删除建筑数据
delete this.canvasData.originalcompanyBuildingData.data[obj.assetData.Id];
} else if (obj.assetData.GameMode === GameMode.Assignment) { // 处置预案
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[obj.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Increment[obj.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id];
} else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试
if (obj.assetData.Tag === 1) {
// 删除楼层数据
delete this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id];
} else {
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[obj.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Increment[obj.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id];
}
this.canvasData.isChange = true;
}
});
}
/**
*
@ -478,25 +461,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.selection.select(obj);
});
}
// /**
// * 刷新工作区
// */
public async refresh() {
//this.loadExamineeData();
// this.setPaintMode(PaintMode.endPaint);
// this.resetCanvas();
// this.destroyBackgroundImage();
// if (!this.canvasData.selectStorey.imageUrl) {
// return;
// }
// await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl);
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// if (this.canvasData.gameMode === GameMode.Assignment) {
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// }
}
/**
*
*/
@ -565,55 +529,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}
this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*
* @param id ID
* @param b /
*/
public setIconVisible(ids: string[], b: boolean) {
ids.forEach(item => {
this.backgroundImage.getChildByName(item).visible = b;
});
}
// /**
// * 版本检查
// */
// public versionChecking(): void {
// const floorData = this.canvasData.originaleveryStoreyData;
// const buildingData = this.canvasData.originalcompanyBuildingData;
// const nodeData = this.canvasData.selectPanelPoint;
// if (floorData.version && floorData.version === '1.0') {
// floorData.version = '2.0';
// Object.keys(floorData.data).forEach(item => {
// floorData.data[item].Point.y *= -1;
// floorData.data[item].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// }
// if (buildingData.version && buildingData.version === '1.0') {
// buildingData.version = '2.0';
// Object.keys(buildingData.data).forEach(item => {
// buildingData.data[item].Point.y *= -1;
// buildingData.data[item].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// }
// if (nodeData.Version && nodeData.Version === '1.0') {
// nodeData.Version = '2.0';
// console.log(this.canvasData.selectPanelPoint.Version);
// Object.keys(nodeData.Data).forEach((key) => {
// Object.keys(nodeData.Data[key]).forEach((tempKey) => {
// nodeData.Data[key][tempKey].Point.y *= -1;
// nodeData.Data[key][tempKey].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// });
// }
// }
/**
*
*/
@ -1252,9 +1167,26 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
});
this.emit('backgroundScale', this.backgroundImage.scale.x);
}
////////////////////////////////////////////////////////////////////////通过/////////////////////////////////////////////////////////////////////////////
/**
*
* @param id ID
* @param b /
*/
public setIconVisible(ids: string[], b: boolean) {
ids.forEach(item => {
this.backgroundImage.getChildByName(item).visible = b;
});
}
////////////////////////////////////////////////////////////////////////采集平台加载逻辑///////////////////////////////////////////////////////////////////////
public onBasicInformationClickFloor() {
}
////////////////////////////////////////////////////////////////////////编制平台加载逻辑///////////////////////////////////////////////////////////////////////
public onClickAssignmentFloor() {
}
////////////////////////////////////////////////////////////////////////考试系统加载逻辑///////////////////////////////////////////////////////////////////////
/**
@ -1272,20 +1204,31 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
public onExamineeClickFloor() {
// // 创建背景图
// this.createBackground(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
// // 创建楼层图形
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// // 处理共享数据中考官隐藏的数据
// this.processinghiddenData();
// // 建楼层图形
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// // 创建处置预案图形
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// // 隐藏基本信息图形
// this.setNameVisible(false, 0);
// // 隐藏想定作业图形
// this.setNameVisible(false, 1);
// console.log("考生加载................................")
// 创建背景图
this.createBackground(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
// 创建楼层图形
this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// 处理共享数据中考官隐藏的数据
this.processinghiddenData();
// 建楼层图形
// 创建楼层图形
this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// 创建处置预案图形
this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏基本信息图形
this.setNameVisible(false, 0);
// 隐藏想定作业图形
this.setNameVisible(false, 1);
// 隐藏图标
this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
}
/**
@ -1295,9 +1238,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
// 创建背景图
this.createBackground(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
// 创建楼层图形
this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// 创建楼层图形
this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// 创建处置预案图形
this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏图标
this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
}
}

Loading…
Cancel
Save