From 2581d90f4906b8772220904027091fd67cb5035e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 9 Feb 2022 13:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20treevaluechoo?= =?UTF-8?q?er=E8=AE=BE=E7=BD=AEvalue=E5=92=8Copen=E5=90=8E=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=AD=90=E8=8A=82=E7=82=B9=E7=88=B6=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../treevaluechooser/abstract.treevaluechooser.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index 6288cc4dc..90c63c25e 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -556,6 +556,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { BI.each(nodes, function (idx, node) { allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value]))); }); + var lastFind; BI.each(allNodes, function (idx, node) { var valueMap = dealWithSelectedValue(node.parentValues, selectedValues); // REPORT-24409 fix: 设置节点全部展开,添加的节点没有给状态 @@ -566,7 +567,13 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { if (find) { parentCheckState.checked = find.halfCheck ? false : find.checked; parentCheckState.half = find.halfCheck; + // 默认展开也需要重置父节点的halfCheck + if (BI.isNotNull(lastFind) && (lastFind !== find || allNodes.length - 1 === idx)) { + lastFind.half = lastFind.halfCheck; + lastFind.halfCheck = false; + } } + lastFind = find; var state = getCheckState(node.value, node.parentValues, valueMap, parentCheckState); result.push({ id: node.id,