From b0e7c560b9048e9549b046070dd1b15b336c8cfa Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 26 Aug 2020 09:18:12 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9A=90=E8=97=8F=E6=B6=88=E9=98=B2=E8=A6=81=E7=B4=A0?= =?UTF-8?q?tree=E4=BC=A0=E5=85=A5=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index acaba99..86caad7 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -673,6 +673,22 @@ export class CollectionToolsComponent implements OnInit { this.dataSource.data = [...this.dataSource.data] this.treeControl.expandAll() + let iconVisibleArr:any = [] + + if(node.isTemplate){//如果是模板,则开始向下找 + node.children.forEach(item => { + if(item.isTemplate){//如果子节点依旧是模板,则继续开始向下找 + item.children.forEach(i => { + iconVisibleArr.push(i.id) + }) + }else{ + iconVisibleArr.push(item.id) + } + }) + }else{ + iconVisibleArr.push(node.id) + } + this.canvas.setIconVisible(iconVisibleArr,!node.isLook) } //封装 刷新 tree 数据