调整 treeTable 树形转平铺的方法保留节点的 `children` 信息

pull/1309/head
sunxiaobin89 2023-07-06 00:19:33 +08:00
parent 50a0c0e4f7
commit d49ad48c2b
1 changed files with 0 additions and 1 deletions

View File

@ -321,7 +321,6 @@ layui.define(['table'], function (exports) {
layui.each(tableData, function (i1, item1) { layui.each(tableData, function (i1, item1) {
var dataIndex = (parentIndex ? parentIndex + '-' : '') + i1; var dataIndex = (parentIndex ? parentIndex + '-' : '') + i1;
var dataNew = $.extend({}, item1); var dataNew = $.extend({}, item1);
dataNew[childrenKey] = null;
dataNew[pIdKey] = item1[pIdKey] || parentId; dataNew[pIdKey] = item1[pIdKey] || parentId;
flat.push(dataNew); flat.push(dataNew);
flat = flat.concat(that.treeToFlat(item1[childrenKey], item1[customName.id], dataIndex)); flat = flat.concat(that.treeToFlat(item1[childrenKey], item1[customName.id], dataIndex));