|
|
@ -81476,7 +81476,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
call(); |
|
|
|
call(); |
|
|
|
} |
|
|
|
} |
|
|
|
function call () { |
|
|
|
|
|
|
|
|
|
|
|
function call() { |
|
|
|
switch (options.type) { |
|
|
|
switch (options.type) { |
|
|
|
case BI.TreeView.REQ_TYPE_INIT_DATA: |
|
|
|
case BI.TreeView.REQ_TYPE_INIT_DATA: |
|
|
|
self._reqInitTreeNode(options, callback); |
|
|
|
self._reqInitTreeNode(options, callback); |
|
|
@ -81513,7 +81514,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
items: result |
|
|
|
items: result |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function doCheck (parentValues, node, selected) { |
|
|
|
function doCheck(parentValues, node, selected) { |
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
BI.each(node.getChildren(), function (i, child) { |
|
|
|
BI.each(node.getChildren(), function (i, child) { |
|
|
|
var newParents = BI.clone(parentValues); |
|
|
|
var newParents = BI.clone(parentValues); |
|
|
@ -81533,7 +81534,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getCount (jo, parentValues) { |
|
|
|
function getCount(jo, parentValues) { |
|
|
|
if (jo == null) { |
|
|
|
if (jo == null) { |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -81544,7 +81545,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return BI.size(jo); |
|
|
|
return BI.size(jo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createOneJson (node, pId, llen) { |
|
|
|
function createOneJson(node, pId, llen) { |
|
|
|
result.push({ |
|
|
|
result.push({ |
|
|
|
id: node.id, |
|
|
|
id: node.id, |
|
|
|
pId: pId, |
|
|
|
pId: pId, |
|
|
@ -81571,7 +81572,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
callback(selectedValues); |
|
|
|
callback(selectedValues); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function dealWithSelectedValues (selectedValues) { |
|
|
|
function dealWithSelectedValues(selectedValues) { |
|
|
|
var p = parentValues.concat(notSelectedValue); |
|
|
|
var p = parentValues.concat(notSelectedValue); |
|
|
|
// 存储的值中存在这个值就把它删掉
|
|
|
|
// 存储的值中存在这个值就把它删掉
|
|
|
|
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京
|
|
|
|
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京
|
|
|
@ -81627,7 +81628,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function expandSelectedValue (selectedValues, parents, notSelectedValue) { |
|
|
|
function expandSelectedValue(selectedValues, parents, notSelectedValue) { |
|
|
|
var next = selectedValues; |
|
|
|
var next = selectedValues; |
|
|
|
var childrenCount = []; |
|
|
|
var childrenCount = []; |
|
|
|
var path = []; |
|
|
|
var path = []; |
|
|
@ -81672,7 +81673,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function search (parents, current, result, searched) { |
|
|
|
function search(parents, current, result, searched) { |
|
|
|
var newParents = BI.clone(parents); |
|
|
|
var newParents = BI.clone(parents); |
|
|
|
newParents.push(current); |
|
|
|
newParents.push(current); |
|
|
|
if (self._isMatch(parents, current, keyword)) { |
|
|
|
if (self._isMatch(parents, current, keyword)) { |
|
|
@ -81702,16 +81703,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return can; |
|
|
|
return can; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isSearchValueInParent (parentValues) { |
|
|
|
function isSearchValueInParent(parentValues) { |
|
|
|
for (var i = 0, len = parentValues.length; i < len; i++) { |
|
|
|
for (var i = 0, len = parentValues.length; i < len; i++) { |
|
|
|
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { |
|
|
|
if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function canFindKey (selectedValues, parents) { |
|
|
|
function canFindKey(selectedValues, parents) { |
|
|
|
var t = selectedValues; |
|
|
|
var t = selectedValues; |
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
var v = parents[i]; |
|
|
|
var v = parents[i]; |
|
|
@ -81723,7 +81724,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isChild (selectedValues, parents) { |
|
|
|
function isChild(selectedValues, parents) { |
|
|
|
var t = selectedValues; |
|
|
|
var t = selectedValues; |
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
var v = parents[i]; |
|
|
|
var v = parents[i]; |
|
|
@ -81759,7 +81760,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
callback(jo); |
|
|
|
callback(jo); |
|
|
|
|
|
|
|
|
|
|
|
function dealWithSelectedValues (selected, parents) { |
|
|
|
function dealWithSelectedValues(selected, parents) { |
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -81779,7 +81780,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return can && isAllSelected(selected, parents); |
|
|
|
return can && isAllSelected(selected, parents); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isAllSelected (selected, parents) { |
|
|
|
function isAllSelected(selected, parents) { |
|
|
|
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); |
|
|
|
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -81799,7 +81800,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function search () { |
|
|
|
function search() { |
|
|
|
var children = self._getChildren([]); |
|
|
|
var children = self._getChildren([]); |
|
|
|
var start = children.length; |
|
|
|
var start = children.length; |
|
|
|
if (lastSearchValue !== "") { |
|
|
|
if (lastSearchValue !== "") { |
|
|
@ -81829,7 +81830,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.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)) { |
|
|
|
var checked = isAllSelect || isSelected(parentValues, current); |
|
|
|
var checked = isAllSelect || isSelected(parentValues, current); |
|
|
|
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); |
|
|
|
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); |
|
|
@ -81858,7 +81859,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.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) { |
|
|
|
var node = self._getTreeNode(parentValues, value); |
|
|
|
var node = self._getTreeNode(parentValues, value); |
|
|
|
result.push({ |
|
|
|
result.push({ |
|
|
|
id: node.id, |
|
|
|
id: node.id, |
|
|
@ -81874,7 +81875,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isHalf (parentValues, value) { |
|
|
|
function isHalf(parentValues, value) { |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
if (find == null) { |
|
|
|
if (find == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -81888,7 +81889,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isAllSelected (parentValues, value) { |
|
|
|
function isAllSelected(parentValues, value) { |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
if (find == null) { |
|
|
|
if (find == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -81902,7 +81903,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isSelected (parentValues, value) { |
|
|
|
function isSelected(parentValues, value) { |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
var find = findSelectedObj(parentValues); |
|
|
|
if (find == null) { |
|
|
|
if (find == null) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -81914,7 +81915,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function findSelectedObj (parentValues) { |
|
|
|
function findSelectedObj(parentValues) { |
|
|
|
var find = selectedValues; |
|
|
|
var find = selectedValues; |
|
|
|
if (find == null) { |
|
|
|
if (find == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -81962,7 +81963,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function judgeState (parentValues, selected_value, checkState) { |
|
|
|
function judgeState(parentValues, selected_value, checkState) { |
|
|
|
var checked = checkState.checked, half = checkState.half; |
|
|
|
var checked = checkState.checked, half = checkState.half; |
|
|
|
if (parentValues.length > 0 && !checked) { |
|
|
|
if (parentValues.length > 0 && !checked) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -81970,7 +81971,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); |
|
|
|
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function dealWidthSelectedValue (parentValues, selectedValues) { |
|
|
|
function dealWidthSelectedValue(parentValues, selectedValues) { |
|
|
|
var valueMap = {}; |
|
|
|
var valueMap = {}; |
|
|
|
BI.each(parentValues, function (i, v) { |
|
|
|
BI.each(parentValues, function (i, v) { |
|
|
|
selectedValues = selectedValues[v] || {}; |
|
|
|
selectedValues = selectedValues[v] || {}; |
|
|
@ -81995,7 +81996,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
return valueMap; |
|
|
|
return valueMap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getCheckState (current, parentValues, valueMap, checkState) { |
|
|
|
function getCheckState(current, parentValues, valueMap, checkState) { |
|
|
|
var checked = checkState.checked, half = checkState.half; |
|
|
|
var checked = checkState.checked, half = checkState.half; |
|
|
|
var tempCheck = false, halfCheck = false; |
|
|
|
var tempCheck = false, halfCheck = false; |
|
|
|
if (BI.has(valueMap, current)) { |
|
|
|
if (BI.has(valueMap, current)) { |
|
|
|