Browse Source

REPORT-94787 fix:纠正 this

es6
Treecat 2 years ago
parent
commit
c5d87751ff
  1. 14
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js

14
packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js

@ -963,13 +963,7 @@ export class AbstractTreeValueChooser extends Widget {
buildCompleteTree(selectedValues) { buildCompleteTree(selectedValues) {
const result = {}; const result = {};
if (selectedValues !== null && !isEmpty(selectedValues)) { const fill = (parentValues, node, selected, r) => {
fill([], this.tree.getRoot(), selectedValues, result);
}
return result;
function fill(parentValues, node, selected, r) {
if (selected === null || isEmpty(selected)) { if (selected === null || isEmpty(selected)) {
each(node.getChildren(), (i, child) => { each(node.getChildren(), (i, child) => {
const newParents = clone(parentValues); const newParents = clone(parentValues);
@ -988,5 +982,11 @@ export class AbstractTreeValueChooser extends Widget {
fill(newParents, node, selected[k], r[k]); fill(newParents, node, selected[k], r[k]);
}); });
} }
if (selectedValues !== null && !isEmpty(selectedValues)) {
fill([], this.tree.getRoot(), selectedValues, result);
}
return result;
} }
} }

Loading…
Cancel
Save