From 71e33f581c4f43cf17ff311a47be6dee1ad2587c Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 11 Nov 2021 15:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E8=AE=BE=E6=96=BD=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/left-domain/left-domain.component.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index dca4e69..0265ae2 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -102,8 +102,18 @@ export class LeftDomainComponent implements OnInit { nzClick(event: NzFormatEmitEvent) { if (event.node.key != 'XF_MHQ') { event.node.isSelected = !event.node.isSelected - FacilityInfoInSceneWindow.instance.showFacilityByType(null, !event.node.isSelected) - FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected) + if (event.node.isSelected) { //显示当前, 隐藏所有 + FacilityInfoInSceneWindow.instance.showFacilityByType(null, false) + FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected) + } else { //显示所有 + this.treeData.forEach(item=>{ + if (item.key != 'XF_MHQ') { + FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[item.key], true) + } else { + item.children.forEach(element=>{ FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[element.key], true) }) + } + }) + } } }