Browse Source

修改建筑数据逻辑

develop
徐振升 4 years ago
parent
commit
c25a9a4a99
  1. 1
      debug.log
  2. 30
      src/app/canvas-share-data.service.ts
  3. 2
      src/app/ui/collection-tools/collection-tools.component.ts
  4. 57
      src/app/working-area/working-area.component.ts

1
debug.log

@ -1,3 +1,4 @@
[1214/094922.722:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1215/082617.914:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1215/093432.367:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1217/083219.853:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

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

@ -81,14 +81,20 @@ export class CanvasShareDataService {
const returnData = this.allDisposalNode.find(item => item.id === parentId);
return returnData;
}
}
/**
*
*/
public updateBuildingData() {
}
/**
*
*/
public getCompanyAdjoinInfo(): CompanyAdjoinInfo[] {
const list: CompanyAdjoinInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (item.Name === '毗邻') {
const adjoin = new CompanyAdjoinInfo();
adjoin.AssetId = item.Id;
@ -114,8 +120,8 @@ export class CanvasShareDataService {
*/
public getBuildingAdjoinInfo(): BuildingAdjoinInfo[] {
const list: BuildingAdjoinInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (item.Name === '毗邻') {
const adjoin = new BuildingAdjoinInfo();
adjoin.AssetId = item.Id;
@ -141,8 +147,8 @@ export class CanvasShareDataService {
*/
public getCompanyImportantLocations(): CompanyImportantLocationInfo[] {
const list: CompanyImportantLocationInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (item.Name === '重点部位') {
const important = new CompanyImportantLocationInfo();
important.AssetId = item.Id;
@ -174,8 +180,8 @@ export class CanvasShareDataService {
*/
public getBuildingImportantLocations(): BuildingImportantLocationInfo[] {
const list: BuildingImportantLocationInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (item.Name === '重点部位') {
const important = new BuildingImportantLocationInfo();
important.AssetId = item.Id;
@ -207,8 +213,8 @@ export class CanvasShareDataService {
*/
public getAllCompanyFacilityAssetInfo(): CompanyFacilityAssetInfo[] {
const list: CompanyFacilityAssetInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (this.facilityAssetsName.has(item.Name)) {
const facility = new CompanyFacilityAssetInfo();
facility.CompanyId = sessionStorage.getItem('companyId');
@ -228,8 +234,8 @@ export class CanvasShareDataService {
*/
public getAllBuildingFacilityAssetInfo(): BuildingFacilityAssetInfo[] {
const list: BuildingFacilityAssetInfo[] = [];
Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
const item = this.originaleveryStoreyData.data[key];
Object.keys(this.originalcompanyBuildingData.data).forEach((key) => {
const item = this.originalcompanyBuildingData.data[key];
if (this.facilityAssetsName.has(item.Name)) {
const facility = new BuildingFacilityAssetInfo();
facility.BuildingId = this.selectStorey.buildingId;

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

@ -712,7 +712,7 @@ export class CollectionToolsComponent implements OnInit {
//批量保存建筑消防设施素材
let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo()
this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?buildingId=${this.canvasData.selectStorey.buildingId}&buildingAreaId=${this.canvasData.selectStorey.id}`,buildingFacilityAssets).subscribe(data => {
this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.canvasData.isChange = false

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

@ -179,45 +179,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.emit('deleteIcon');
}
});
// 打印当前工作区信息
this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => {
// console.log(event.keyCode);
if (event.keyCode === 32) {
switch (this.paintMode) {
case 0:
console.log(`当前的绘制模式是:单点图标`);
break;
case 1:
console.log(`当前的绘制模式是:线段图标`);
break;
case 2:
console.log(`当前的绘制模式是:自定义多边形`);
break;
case 3:
console.log(`当前的绘制模式是:水带多边形`);
break;
case 4:
console.log(`当前的绘制模式是:暂无`);
break;
case 5:
console.log(`当前的绘制模式是:暂无`);
break;
case 6:
console.log(`当前的绘制模式是:结束绘制`);
break;
default:
break;
}
console.log('当前楼层的数据:');
console.log(this.canvasData.originaleveryStoreyData.data);
console.log('绘制中的管线:');
console.log(this.paintingPipeline);
console.log('处置预案数据:');
console.log(this.canvasData.selectPanelPoint.Data);
}
});
}
/**
*
@ -320,6 +281,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.circleShadow.position = this.backgroundImage.toLocal(this.mousePosition);
this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position);
}
/**
*
*/
if (this.rectToolGraphics.visible === true) {
const init = this.initialScreenMousePos;
@ -338,18 +302,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.rectToolGraphics.drawRect(final.x, final.y, init.x - final.x, init.y - final.y);
}
this.rectToolGraphics.endFill();
// this.rectToolGraphics.closePath();
}
// if (this.paintingArrows !== null) {
// this.paintingArrows.assetData.pointB = new PIXI.Point(this.circleShadow.position.x, this.circleShadow.position.y);
// this.paintingArrows.refresh();
// }
});
/**
*
*/
this.on('select', obj => {
// this.moveIconToScreenCenter(obj);
if (this.allowEdit) {
if (obj instanceof MultipointIcon) {
if (obj.assetData.GameMode === this.canvasData.gameMode) {
@ -387,6 +345,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
obj.filters = [];
}
});
/**
*
*/
this.on('backgroundScale', scale => {
this.backgroundImage?.children.forEach(item => {
if (item instanceof AxImageShape) {
@ -413,9 +374,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
});
});
/**
*
*/
this.on('createIcon', obj => {
if (obj.assetData.GameMode === GameMode.BasicInformation) {
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
// 添加楼层数据
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
} else {
if (this.canvasData.selectPanelPoint.Data === undefined
|| this.canvasData.selectPanelPoint.Data === null) {

Loading…
Cancel
Save