1
zrg
2024-08-30 755697d7d8051497f08a963b7a4df7f29c293c0f
WebTM/views/PublicPage/PowerInformation.html
@@ -346,20 +346,9 @@
                } else {
                    treeData.push(it)
                }
            })
            // 递归过滤掉没有子节点的项
            function filterTree(node) {
                if (!node.children || node.children.length === 0) {
                    return null; // 过滤掉没有子节点的项
                }
                node.children = node.children.map(filterTree).filter(n => n !== null);
                return node;
            }
            // 对每个根节点应用过滤
            treeData = treeData.map(filterTree).filter(n => n !== null);
            })
            return treeData;
        }
        }
    </script>
</body>