From 519433cf26ea480d7d404093f3b0293cb5220f94 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Fri, 28 Apr 2023 18:21:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20treeTable=20=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E9=9A=90=E8=97=8F=E6=89=80=E6=9C=89=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E6=97=B6=E5=80=99=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=A0=8F=E6=B6=88=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/treeTable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/treeTable.js b/src/modules/treeTable.js index c22bfbf7..56ea0a5a 100644 --- a/src/modules/treeTable.js +++ b/src/modules/treeTable.js @@ -654,16 +654,16 @@ layui.define(['table'], function (exports) { // 将所有已经打开的节点的状态设置为关闭, that.updateStatus(null, {LAY_EXPAND: false}); // 只处理当前页,如果需要处理全部表格,需要用treeTable.updateStatus // 隐藏所有非顶层的节点 - tableView.find('tbody tr[data-level!="0"]').addClass('layui-hide'); + tableView.find('.layui-table-box tbody tr[data-level!="0"]').addClass('layui-hide'); // 处理顶层节点的图标 var trLevel0 = tableView.find('tbody tr[data-level="0"]'); trLevel0.find('.layui-table-tree-flexIcon').html(treeOptions.view.flexIconClose); - trLevel0.find('.layui-table-tree-nodeIcon').html(treeOptions.view.iconClose); + treeOptions.view.showIcon && trLevel0.find('.layui-table-tree-nodeIcon').html(treeOptions.view.iconClose); - treeTable.resize(); + treeTable.resize(id); } else { return hint.error('暂不支持展开全部'); - + // 展开所有 if (treeOptions.async.enable) { // 存在异步加载