Tree: fix setCheckedKeys

This commit is contained in:
Dreamacro 2017-07-20 10:19:35 +08:00 committed by 杨奕
parent 476f76875c
commit 02459f1833
2 changed files with 2 additions and 4 deletions

View File

@ -301,7 +301,6 @@ export default class Node {
child.setChecked(isCheck, deep, true, passValue);
}
const { half, all } = getChildState(childNodes);
console.log(this.data.label, all);
if (!all) {
this.checked = all;
this.indeterminate = half;

View File

@ -188,11 +188,10 @@ export default class TreeStore {
}
_setCheckedKeys(key, leafOnly = false, checkedKeys) {
let allNodes = this._getAllNodes().sort((a, b) => a.level - b.level);
const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level);
const keys = Object.keys(checkedKeys);
for (let node of allNodes) {
let checked = keys.indexOf(node.data[key].toString()) > -1;
let checked = keys.indexOf(node.data[key] + '') > -1;
if (!checked) {
node.setChecked(false, false);
continue;