wtt
2024-12-09 b90cb13966920822b664e331742d9fcf2923d9d9
WebTM/views/PublicPage/PowerInformation.html
@@ -75,6 +75,8 @@
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
            //将url参数中的中文乱码重新转换成中文。 注:linterid 是参数命名,不是值
            linterid = getParams("linterid");
        }
        var treeCkData = { id: 0 };
@@ -346,20 +348,21 @@
                } 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;
        }
        //将url参数中的中文乱码重新转换成中文
        function getParams(key) {
            var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
            //如果地址栏中出现中文则进行编码
            var r = encodeURI(window.location.search).substr(1).match(reg);
            if (r != null) {
                //将中文编码的字符重新变成中文
                return decodeURI(unescape(r[2]));
            }
            return null;
        };
    </script>
</body>