From ad2184c220a9b8e88baee72d7ecc159549b0abc8 Mon Sep 17 00:00:00 2001 From: iapyang Date: Sat, 10 Oct 2020 15:27:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-40996=20fix:=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=A0=91=E8=8A=82=E7=82=B9=E4=B8=8D=E9=9C=80=E8=A6=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEcheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../treevaluechooser/abstract.treevaluechooser.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index fb5ec8306..15bbd07f9 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -565,15 +565,19 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { parentCheckState.half = find.halfCheck; } var state = getCheckState(node.value, node.parentValues, valueMap, parentCheckState); + + var isParent = node.getChildrenLength() > 0; result.push({ id: node.id, pId: node.pId, value: node.value, text: node.text, times: 1, - isParent: node.getChildrenLength() > 0, - checked: state[0], - halfCheck: state[1], + isParent: isParent, + // 同步树的情况下,父亲节点的状态由子控制,不再设置checked和halfCheck属性 + // 叶子节点本身不存在halfCheck属性且checked属性由计算得到 + checked: isParent ? undefined : state[0], + // halfCheck: state[1], open: self.options.open }); });