|
|
@ -379,13 +379,7 @@ export class AbstractTreeValueChooser extends Widget { |
|
|
|
result.push([k]); |
|
|
|
result.push([k]); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
dealWithSelectedValues(selectedValues, []); |
|
|
|
const isAllSelected = (selected, parents) => isEmpty(selected) || this._getChildCount(parents) === size(selected); |
|
|
|
|
|
|
|
|
|
|
|
const jo = {}; |
|
|
|
|
|
|
|
each(result, (i, strs) => { |
|
|
|
|
|
|
|
this._buildTree(jo, strs); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
callback(jo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function dealWithSelectedValues(selected, parents) { |
|
|
|
function dealWithSelectedValues(selected, parents) { |
|
|
|
if (selected == null || isEmpty(selected)) { |
|
|
|
if (selected == null || isEmpty(selected)) { |
|
|
@ -408,7 +402,15 @@ export class AbstractTreeValueChooser extends Widget { |
|
|
|
return can && isAllSelected(selected, parents); |
|
|
|
return can && isAllSelected(selected, parents); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isAllSelected = (selected, parents) => isEmpty(selected) || this._getChildCount(parents) === size(selected); |
|
|
|
dealWithSelectedValues(selectedValues, []); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const jo = {}; |
|
|
|
|
|
|
|
each(result, (i, strs) => { |
|
|
|
|
|
|
|
this._buildTree(jo, strs); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
callback(jo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_reqInitTreeNode(op, callback) { |
|
|
|
_reqInitTreeNode(op, callback) { |
|
|
@ -469,7 +471,7 @@ export class AbstractTreeValueChooser extends Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return output; |
|
|
|
return output; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function nodeSearch(deep, parentValues, current, isAllSelect, result) { |
|
|
|
function nodeSearch(deep, parentValues, current, isAllSelect, result) { |
|
|
|
if (self._isMatch(parentValues, current, keyword)) { |
|
|
|
if (self._isMatch(parentValues, current, keyword)) { |
|
|
@ -512,7 +514,7 @@ export class AbstractTreeValueChooser extends Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return [can, checked]; |
|
|
|
return [can, checked]; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) { |
|
|
|
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) { |
|
|
|
const node = self._getTreeNode(parentValues, value); |
|
|
|
const node = self._getTreeNode(parentValues, value); |
|
|
@ -529,7 +531,7 @@ export class AbstractTreeValueChooser extends Widget { |
|
|
|
flag, |
|
|
|
flag, |
|
|
|
disabled: node.disabled, |
|
|
|
disabled: node.disabled, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isHalf(parentValues, value) { |
|
|
|
function isHalf(parentValues, value) { |
|
|
|
const find = findSelectedObj(parentValues); |
|
|
|
const find = findSelectedObj(parentValues); |
|
|
|