Browse Source

1.0.10.20210118_beta

develop
徐振升 4 years ago
parent
commit
b4113df149
  1. 13
      src/app/canvas-share-data.service.ts
  2. 4
      src/app/working-area/model/axArrowConnector.ts
  3. 240
      src/app/working-area/working-area.component.ts

13
src/app/canvas-share-data.service.ts

@ -8,7 +8,9 @@ import { GameMode } from './working-area/model/gameMode';
export class CanvasShareDataService {
constructor() { }
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
GameMode: any;
examDisposalNodesData; // 考生进入时获取当前试卷的处置节点
examFacilityAssetsData; // 考生进入时获取当前试卷要考察的消防设施
isChange = false; // 数据 是否改动
@ -16,14 +18,23 @@ export class CanvasShareDataService {
// 总平面图/建筑 楼层
selectStorey: any = {area: '', details: ''}; // 选择当前 楼层 数据
originalcompanyBuildingData: any; // 单位/建筑 数据
originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据
examOriginaleveryStoreyData: any; // 考生答卷 总平面图/楼层/区域 楼层数据
hiddenBasicInfoFacilities: any = []; // 考生答卷 当前楼层需要隐藏的基本信息素材
// 总平面图/建筑 楼层
// 处置 节点
allDisposalNode: any = []; // 所有 处置节点
allNodeMarkers: any; // 灾情 标签信息
selectPanelPoint: DisposalNodeData = new DisposalNodeData();
selectPanelPointBaseData: any = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}; // 当前 数据节点 所对应的 天气,详情 数据节点
// 处置 节点
/**

4
src/app/working-area/model/axArrowConnector.ts

@ -36,7 +36,7 @@ export class AxArrowConnector extends AxShape {
this.markerStart = markerStart;
this.markerEnd = markerEnd;
this.position = this.assetData.Point;
this.name = assetData.Id;
this.text = new PIXI.Text(this.assetData.Name
+ '\r\n'
@ -154,7 +154,7 @@ export class AxArrowConnector extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
const strokeWidth = 1;
const edgeWidth = this.assetData.Thickness === 0 ? 1 : this.assetData.Thickness; // 宽度
const edgeWidth = this.assetData.Thickness === 0 ? 5 : this.assetData.Thickness; // 宽度
const startWidth = edgeWidth * 2 + strokeWidth;
const endWidth = edgeWidth * 2 + strokeWidth;

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

@ -148,7 +148,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* RC版: 该版本已经相当成熟了BUG
* Release版: 该版本意味使Release不会以单词形式出现在软件封面上®
*/
public VERSION = '1.0.8.20210118_beta';
public VERSION = '1.0.10.20210118_beta';
/**
*
*/
@ -394,18 +394,17 @@ 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;
// }
// }
const temp = this.backgroundImage.getChildByName('图例') as AxLegend;
if ( temp !== undefined
&& temp !== null
@ -439,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;
@ -975,28 +973,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
// 创建处置预案图形
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);
}
/**
*
@ -1098,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;
}
@ -1137,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);
}
@ -1152,15 +1116,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
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);
// }
// }
// });
// }
/**
*
*/
@ -1213,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;
}
@ -1229,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;
@ -1315,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;
}
this.paintPoints.splice(0, this.paintPoints.length);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*
@ -1392,88 +1334,78 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
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);
}
/**
* -
*/
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.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.originaleveryStoreyData.data);
// 创建处置预案图形
this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏图标
this.setNameVisible(false, 0);
}
}

Loading…
Cancel
Save