From f19b3c164c0339172f365715b3cfb1962932801a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Sun, 28 Jun 2020 09:25:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-67348=20=E3=80=90=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E3=80=91=E7=82=B9=E5=87=BB=E6=96=87=E6=9C=AC=E5=92=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=A4=8D=E9=80=89=E6=A1=86=E8=A1=A8=E7=8E=B0=E4=B8=8D?= =?UTF-8?q?=E6=80=BB=E6=98=AF=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/tree/ztree/asynctree.js | 2 +- src/base/tree/ztree/treeview.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index aeab84ac2..df0987cc0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-06) +- 修复了复选下拉树半选节点的子节点未加载的时候,点选该半选节点是取消选中的问题 - 下拉树系列支持isNeedAdjustWidth以动态变化宽度 - 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增 - 修复了选色控件历史记录没有选中的问题的问题 diff --git a/src/base/tree/ztree/asynctree.js b/src/base/tree/ztree/asynctree.js index 08dc695c7..2ae126ca7 100644 --- a/src/base/tree/ztree/asynctree.js +++ b/src/base/tree/ztree/asynctree.js @@ -68,6 +68,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { } function beforeCheck (treeId, treeNode) { + var status = treeNode.getCheckStatus(); treeNode.halfCheck = false; if (treeNode.checked === true) { // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy @@ -87,7 +88,6 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { node.halfCheck = false; }); } - var status = treeNode.getCheckStatus(); // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 if (status.half === true && status.checked === true) { treeNode.checked = false; diff --git a/src/base/tree/ztree/treeview.js b/src/base/tree/ztree/treeview.js index 7e25b3625..71efa9074 100644 --- a/src/base/tree/ztree/treeview.js +++ b/src/base/tree/ztree/treeview.js @@ -181,6 +181,8 @@ BI.TreeView = BI.inherit(BI.Pane, { } function beforeCheck (treeId, treeNode) { + // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 + var status = treeNode.getCheckStatus(); treeNode.halfCheck = false; if (treeNode.checked === true) { // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy @@ -201,7 +203,6 @@ BI.TreeView = BI.inherit(BI.Pane, { node.halfCheck = false; }); } - var status = treeNode.getCheckStatus(); // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 if(status.half === true && status.checked === true) { treeNode.checked = false; From dcff7c6aa82e7416acaa0f0c0cd561d6eb1b062f Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Sun, 28 Jun 2020 09:26:18 +0800 Subject: [PATCH 2/2] update --- src/base/tree/ztree/asynctree.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/tree/ztree/asynctree.js b/src/base/tree/ztree/asynctree.js index 2ae126ca7..89f02680a 100644 --- a/src/base/tree/ztree/asynctree.js +++ b/src/base/tree/ztree/asynctree.js @@ -68,6 +68,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { } function beforeCheck (treeId, treeNode) { + // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 var status = treeNode.getCheckStatus(); treeNode.halfCheck = false; if (treeNode.checked === true) {