From 394f34efce5bf8fca1de3eafb986ac985b094024 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Wed, 24 May 2023 15:02:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20treeTable=20=E6=8A=98?= =?UTF-8?q?=E5=8F=A0=E5=8F=B6=E5=AD=90=E8=8A=82=E7=82=B9=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E5=9B=BE=E6=A0=87=E6=B2=A1=E6=9C=89=E5=8F=98?= =?UTF-8?q?=E5=8C=96=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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/treeTable.js b/src/modules/treeTable.js index 0484b448..636eab6a 100644 --- a/src/modules/treeTable.js +++ b/src/modules/treeTable.js @@ -453,9 +453,6 @@ layui.define(['table'], function (exports) { var isToggle = layui.type(expandFlag) !== 'boolean'; var trExpand = isToggle ? !trData[LAY_EXPAND] : expandFlag; var retValue = trData[isParentKey] ? trExpand : null; - if (retValue === null) { - return retValue; - } if (callbackFlag && trExpand != trData[LAY_EXPAND] && (!trData[LAY_ASYNC_STATUS] || trData[LAY_ASYNC_STATUS] === 'local')) { var beforeExpand = treeOptions.callback.beforeExpand; @@ -580,7 +577,6 @@ layui.define(['table'], function (exports) { }); return retValue; } - trData[LAY_EXPAND] = trExpand; trExpanded = trData[LAY_HAS_EXPANDED] = true; if (childNodes.length) { // 判断是否需要排序 @@ -646,7 +642,6 @@ layui.define(['table'], function (exports) { } } } else { - trData[LAY_EXPAND] = trExpand; // 关闭 if (sonSign && !isToggle) { // 非状态切换的情况下 layui.each(childNodes, function (i1, item1) { @@ -740,7 +735,9 @@ layui.define(['table'], function (exports) { tableView.find('.layui-table-box tbody tr[data-level!="0"]').addClass(HIDE); tableView.find('.layui-table-tree-flexIcon').html(treeOptions.view.flexIconClose); - treeOptions.view.showIcon && tableView.find('.layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)').html(treeOptions.view.iconClose); + treeOptions.view.showIcon && tableView + .find('.layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)') + .html(treeOptions.view.iconClose); } else { var tableDataFlat = treeTable.getData(id, true); // 展开所有