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