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) }) + } + }) + } } }