From 7a5809f303bfb49a0c25be6e56ff809e4dac7e7c Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Fri, 11 Sep 2020 17:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20feat:=20BI.Tr?= =?UTF-8?q?ee.traversal=E6=96=B9=E6=B3=95=E8=BF=AD=E4=BB=A3=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=A2=9E=E5=8A=A0=E7=88=B6=E8=8A=82=E7=82=B9=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 3 +++ src/core/utils/tree.js | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 4865f27b5c..f1f0889752 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # 更新日志 +2.0(2020-09) +- BI.Tree.traversal方法迭代函数增加父节点参数 + 2.0(2020-08) - bi.sign_editor支持显示值居左/居中/居右显示 - bi.iframe新增EVENT_LOADED事件 diff --git a/src/core/utils/tree.js b/src/core/utils/tree.js index 43448967d6..44c2584614 100644 --- a/src/core/utils/tree.js +++ b/src/core/utils/tree.js @@ -500,17 +500,17 @@ }, - traversal: function (array, callback) { + traversal: function (array, callback, pNode) { if (BI.isNull(array)) { return; } var self = this; BI.some(array, function (i, item) { - if (callback(i, item) === false) { + if (callback(i, item, pNode) === false) { return true; } - self.traversal(item.children, callback); + self.traversal(item.children, callback, item); }); } }); -})(); \ No newline at end of file +})();