From 7ae1fc34dc5efc3066ccb30429e92f3705c74aaa Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Thu, 11 Nov 2021 15:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B6=88=E9=98=B2=E8=AE=BE?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/building-window/building-window.ts | 4 ++- .../facilityinfo-ui-item.ts | 4 +-- .../facilityinfoinscene-window.ts | 31 ++++++++++++++----- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index a2abb06..ea2e0b7 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -20,6 +20,7 @@ import { ModelInfo_building } from "../../model/info/model/model-info-building"; import { FacilityInfoByType } from "../../model/info/model/model-info-facility"; import { BabylonTool } from "../../tool/babylon-tool"; import { TsTool } from "../../tool/ts-tool"; +import { FacilityInfoInSceneWindow } from "../facilityinfoinscene-window/facilityinfoinscene-window"; import { UIBase } from "../window-base/ui-base"; import { BuildingUIItem } from "./building-ui-item"; @@ -257,7 +258,6 @@ export class BuildingWindow extends UIBase { */ recoverMoudleShow(type: JYZInfoMoudleType) { let showData = DataManager.institutionData.getMoudleShowData(type); - console.log("恢复模块状态", showData); if (showData != null) { let camera = SceneManager.Instance.defaultCamera; //showData.cameraData.setDataToCamera(camera); @@ -719,6 +719,8 @@ export class BuildingWindow extends UIBase { } this.initFacilityTypeByMoudleType(type, this.currentBuidngItem.buildingInfo); + FacilityInfoInSceneWindow.instance.selectJYJFrom3D(null); + //设备: 显示UI let facilityByType: FacilityInfoByType[] = []; if (this.facilitysByMoudle.has(type)) { diff --git a/src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts b/src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts index f9126ba..5df9528 100644 --- a/src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts +++ b/src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts @@ -100,9 +100,9 @@ export class FacilityInfoUIItem { this.facilityInfoInSceneWindow.selectFacilityItemToThree([this], false); if (!this.facilityInfoInSceneWindow.getFacilityUIShowType(this.getType())) { this.modelInfo.setIconEnable(select); - + this.facilityInfoInSceneWindow.playJYJSelectEffect(select, this.modelInfo) } - this.facilityInfoInSceneWindow.playJYJSelectEffect(select, this.modelInfo) + } } diff --git a/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts b/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts index 72975ef..ec58012 100644 --- a/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts +++ b/src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts @@ -211,13 +211,27 @@ export class FacilityInfoInSceneWindow extends UIBase { * @param facilityType */ getFacilityUIShowType(facilityType: FacilityType): boolean { - // for (let i = 0; i < this.three.allFacilityInfoUIItemes.length; i++) { - // let item = this.three.allFacilityInfoUIItemes[i]; - // if (item.type == facilityType) { - // return item.isShow; - // } - // } - return true; + + //没开弹框 + if (!this.three.isShowChildComponent || this.three.leftDomain == null) { + + return false; + } + + //没有要显示的设备 + if (this.three.leftDomain.FacilityList == null) { + return false; + } + + for (let i = 0; i < this.three.leftDomain.FacilityList.length; i++) { + let item: FacilityInfoUIItem = this.three.leftDomain.FacilityList[i]; + if (item.getType() == facilityType) { + console.log("显示", facilityType); + return true; + } + } + console.log("不显示", facilityType); + return false; } @@ -246,7 +260,8 @@ export class FacilityInfoInSceneWindow extends UIBase { super.onInit(); FacilityInfoInSceneWindow.instance = this; - // this.three = ThreeDimensionalHomeComponent.instance; + this.three = PlanComponent.instance; + // EventManager.addListener(Event_ModelInfoChange, this.onModelInfoChange); GizmoTool.onPickMeshInfoObservable.add(this.onClickModel);