From 2d7b9c020ee1eb20be770cd462e658de1df2ebc7 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Tue, 23 May 2023 18:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20treeTable=20=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E5=85=A8=E9=83=A8=E8=8A=82=E7=82=B9=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=97=B6=E6=95=88=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, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/treeTable.js b/src/modules/treeTable.js index c821b7ce..f0b21c79 100644 --- a/src/modules/treeTable.js +++ b/src/modules/treeTable.js @@ -474,9 +474,15 @@ layui.define(['table'], function (exports) { flexIconElem.html(trExpand ? treeOptions.view.flexIconOpen : treeOptions.view.flexIconClose) trData[isParentKey] && flexIconElem.css('visibility', 'visible'); // 处理节点图标 - treeOptions.view.showIcon && trsElem.find('.layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)') + treeOptions.view.showIcon && trsElem + .find('.layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)') .html(trExpand ? treeOptions.view.iconOpen : treeOptions.view.iconClose); + treeTableThat.status.expand[trData[customName.id]] = trData[LAY_EXPAND] = trExpand; + if (retValue === null) { + return retValue; + } + var childNodes = trData[customName.children] || []; // 处理子节点展示与否 if (trExpand) { @@ -485,7 +491,6 @@ layui.define(['table'], function (exports) { trsElem.nextAll(childNodes.map(function (value, index, array) { return 'tr[lay-data-index="' + value[LAY_DATA_INDEX] + '"]' }).join(',')).removeClass(HIDE); - trData[LAY_EXPAND] = trExpand; layui.each(childNodes, function (i1, item1) { if (!item1[isParentKey]) { return;