Browse Source

分类展示各个模块内容

dev
刘向辉 3 years ago
parent
commit
ea50fa9068
  1. 7
      src/app/babylon/model/data/model-data/model-data-facility.ts
  2. 33
      src/app/babylon/view/building-window/building-window.ts
  3. 48
      src/app/babylon/view/facility-window/facility-window.ts
  4. 8
      src/app/babylon/view/toolbar-window/toobar-window.ts

7
src/app/babylon/model/data/model-data/model-data-facility.ts

@ -250,7 +250,12 @@ export enum FacilityType {
/**
*
*/
XF_SSD = "XF_SSD"
XF_SSD = "XF_SSD",
/**
*
*/
ZD_ZP = "ZD_ZP",
}

33
src/app/babylon/view/building-window/building-window.ts

@ -221,6 +221,8 @@ export class BuildingWindow extends UIBase {
this.showJYZModules(type, show);//展示本次要展示的内容
}
}
@ -566,7 +568,7 @@ export class BuildingWindow extends UIBase {
*/
public getModelAndCreateFacilityData() {
this.clearHomeLessFacilityData();
//this.clearHomeLessFacilityData();
if (this.currentBuidngItem != null) {
//获取所有transformNodes
@ -593,6 +595,8 @@ export class BuildingWindow extends UIBase {
}
//#endregion
@ -619,7 +623,7 @@ export class BuildingWindow extends UIBase {
* @param show
*/
showJYZModules(type: JYZInfoMoudleType, show: boolean) {
console.log("切换页签", type, show);
if (this.currentBuidngItem == null) {
return;
}
@ -652,6 +656,9 @@ export class BuildingWindow extends UIBase {
}
}
}
if (!show) {
this.currentJYZInfoMoudleType = null;
}
}
@ -697,6 +704,23 @@ export class BuildingWindow extends UIBase {
// }
}
/**
*
* @param show false
*/
showZP(show: boolean) {
this.initFacilityTypeByMoudleType(JYZInfoMoudleType.ZP, this.currentBuidngItem.buildingInfo);
let zpInfoByTypes = this.facilitysByMoudle.get(JYZInfoMoudleType.ZP);
if (zpInfoByTypes != null) {
for (let i = 0; i < zpInfoByTypes.length; i++) {
let infos = zpInfoByTypes[i].facilityInfo;
for (let j = 0; j < infos.length; j++) {
infos[j].setEnable(show);
}
}
}
}
//#endregion
@ -732,4 +756,9 @@ export enum JYZInfoMoudleType {
* 线
*/
TSLX = "TSLX",
/**
*
*/
ZP = "ZP",
}

48
src/app/babylon/view/facility-window/facility-window.ts

@ -316,8 +316,14 @@ export class FacilityWindow extends UIBase {
createNewFacilityByMesh(mesh: AbstractMesh, type: FacilityType) {
let facilityData = this.createFacilityDataFromMesh(mesh, type);
//let facilityInfo = this.createFacilityInfoFromMesh(facilityData, mesh, buildingInfo);
console.log("获取到干粉灭火器", mesh);
this.createNewFacility(facilityData, mesh);
console.log("获取到设备" + type, mesh);
if (!this.isRepeatFacilityFromMesh(type, mesh.id)) //不重复
{
this.createNewFacility(facilityData, mesh);
}
}
@ -637,6 +643,9 @@ export class FacilityWindow extends UIBase {
else if (TsTool.stringContain(mesh.name, FacilityType.ZD_XF)) {
this.createNewFacilityByMesh(mesh, FacilityType.ZD_XF);
}
else if (TsTool.stringContain(mesh.name, FacilityType.ZD_ZP)) {
this.createNewFacilityByMesh(mesh, FacilityType.ZD_ZP);
}
}
@ -664,6 +673,41 @@ export class FacilityWindow extends UIBase {
return facilityInfo;
}
/**
*
*/
isRepeatFacilityFromMesh(type: FacilityType, id: string) {
let currentBuidngItem = StatusManager.getStatus<BuildingStatus>(BuildingStatus)
.buildingWindow.currentBuidngItem;
if (currentBuidngItem == null) {
alert("请先选中目标建筑");
// ThreeDimensionalHomeComponent.instance.openSnackBar("请先选中目标建筑");
return true;
}
let result = false;
let facilityInfoByTypes = currentBuidngItem.buildingInfo.ModelInfo.facilityInfos;
if (facilityInfoByTypes != null) {
for (let i = 0; i < facilityInfoByTypes.length; i++) {
if (facilityInfoByTypes[i].type == type) {
let infos = facilityInfoByTypes[i].facilityInfo;
for (let j = 0; j < infos.length; j++) {
if (infos[j].modelData.resName == id) {
result = true;
console.log("重复的设备,不添加");
break;
}
}
}
}
}
return result;
}
//#endregion
}

8
src/app/babylon/view/toolbar-window/toobar-window.ts

@ -110,6 +110,14 @@ export class ToolbarWindow extends UIBase {
BuildingWindow.instance.getModelAndCreateFacilityData();
}
/**
*
* @param show false表示隐藏罩棚
*/
showZP(show: boolean) {
BuildingWindow.instance.showZP(show);
}
onInit() {
super.onInit();

Loading…
Cancel
Save