修复 treeTable 展开全部节点排序时效的问题

pull/1260/head
sunxiaobin89 2023-05-23 18:08:35 +08:00
parent 504b6c78fe
commit 2d7b9c020e
1 changed files with 7 additions and 2 deletions

View File

@ -474,9 +474,15 @@ layui.define(['table'], function (exports) {
flexIconElem.html(trExpand ? treeOptions.view.flexIconOpen : treeOptions.view.flexIconClose) flexIconElem.html(trExpand ? treeOptions.view.flexIconOpen : treeOptions.view.flexIconClose)
trData[isParentKey] && flexIconElem.css('visibility', 'visible'); 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); .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] || []; var childNodes = trData[customName.children] || [];
// 处理子节点展示与否 // 处理子节点展示与否
if (trExpand) { if (trExpand) {
@ -485,7 +491,6 @@ layui.define(['table'], function (exports) {
trsElem.nextAll(childNodes.map(function (value, index, array) { trsElem.nextAll(childNodes.map(function (value, index, array) {
return 'tr[lay-data-index="' + value[LAY_DATA_INDEX] + '"]' return 'tr[lay-data-index="' + value[LAY_DATA_INDEX] + '"]'
}).join(',')).removeClass(HIDE); }).join(',')).removeClass(HIDE);
trData[LAY_EXPAND] = trExpand;
layui.each(childNodes, function (i1, item1) { layui.each(childNodes, function (i1, item1) {
if (!item1[isParentKey]) { if (!item1[isParentKey]) {
return; return;