From b6755c26b082a6a9cb9ede09c496b7ffac828717 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 11 Mar 2021 10:03:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B6=88=E9=98=B2=E8=AE=BE=E6=96=BD=E4=B8=80=E9=94=AE=E6=98=BE?= =?UTF-8?q?=E9=9A=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 1 + .../collection-tools.component.scss | 10 +++++++++ .../collection-tools.component.ts | 22 ++++++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index be35891..e3a4d9d 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -425,6 +425,7 @@
+
visibility
diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 7abcdc5..43c045a 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -286,6 +286,16 @@ } } +.hideAllTreeNode { + box-sizing: border-box; + margin: 3px 0; + padding: 0 6px 0 10px; + font-size: 14px; + height: 24px; + line-height: 24px; + display: flex; + label { display: inline-block; flex: 1; cursor: pointer; } +} //右侧消防要素 .firecategories{ position: relative; diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index d7bf63b..3731ed7 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1023,6 +1023,7 @@ export class CollectionToolsComponent implements OnInit { //处理 tree 数据结构 handleTreeData (storeyData) { + this.hideAllTreenode = true this.storeyData = storeyData let data = this.allFireElements //所有消防要素模板 let treeData = [] //tree型 处理完成后的数据 @@ -1090,6 +1091,22 @@ export class CollectionToolsComponent implements OnInit { this.canvas.setHighlight(iconHighLightArr) } + hideAllTreenode:boolean = true; //全部显示/隐藏tree节点 + toggoleAllTreenode () { + this.hideAllTreenode = !this.hideAllTreenode + let list = [] + this.allFireElements.forEach(element=>{ + if (element.isTemplate) { this.hideAllTreenode? element.isLook = false : element.isLook = true } + }) + this.treeControl.dataNodes.forEach(item=>{ + this.hideAllTreenode? item.isLook = false : item.isLook = true + item.level === 0 ? list.push(item) : null + }) + list.forEach(item=>{ + this.clickLookItem(item) + }) + } + //点击数节点的显示隐藏icon clickLookItem(node){ @@ -1103,9 +1120,8 @@ export class CollectionToolsComponent implements OnInit { //所有消防要素模板变化islook值 if(node.isTemplate){ this.allFireElements.forEach(item=>{ - if(item.id == node.id || item.name == "其他"){ - item.isLook = !item.isLook - } + if(item.id == node.id){ item.isLook = !item.isLook } + if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook } }) }