gis-common 5.1.30 → 5.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2879,6 +2879,20 @@ const TreeUtil = {
2879
2879
  }
2880
2880
  });
2881
2881
  return result;
2882
+ },
2883
+ /**
2884
+ * 遍历树形结构的节点,执行指定的回调函数
2885
+ *
2886
+ * @param data 树形结构的节点数组
2887
+ * @param callback 回调函数,参数为当前遍历到的节点
2888
+ */
2889
+ forEachTree(data, callback) {
2890
+ data.forEach((node) => {
2891
+ callback(node);
2892
+ if (node.children && node.children.length > 0) {
2893
+ this.forEachTree(node.children, callback);
2894
+ }
2895
+ });
2882
2896
  }
2883
2897
  };
2884
2898
  const UrlUtil = {