|
|
|
@ -81476,7 +81476,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
} else { |
|
|
|
|
call(); |
|
|
|
|
} |
|
|
|
|
function call () { |
|
|
|
|
|
|
|
|
|
function call() { |
|
|
|
|
switch (options.type) { |
|
|
|
|
case BI.TreeView.REQ_TYPE_INIT_DATA: |
|
|
|
|
self._reqInitTreeNode(options, callback); |
|
|
|
@ -81513,7 +81514,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
items: result |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function doCheck (parentValues, node, selected) { |
|
|
|
|
function doCheck(parentValues, node, selected) { |
|
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
|
BI.each(node.getChildren(), function (i, child) { |
|
|
|
|
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) { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -81544,7 +81545,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return BI.size(jo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function createOneJson (node, pId, llen) { |
|
|
|
|
function createOneJson(node, pId, llen) { |
|
|
|
|
result.push({ |
|
|
|
|
id: node.id, |
|
|
|
|
pId: pId, |
|
|
|
@ -81571,7 +81572,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
callback(selectedValues); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function dealWithSelectedValues (selectedValues) { |
|
|
|
|
function dealWithSelectedValues(selectedValues) { |
|
|
|
|
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 childrenCount = []; |
|
|
|
|
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); |
|
|
|
|
newParents.push(current); |
|
|
|
|
if (self._isMatch(parents, current, keyword)) { |
|
|
|
@ -81702,16 +81703,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return can; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function isSearchValueInParent (parentValues) { |
|
|
|
|
function isSearchValueInParent(parentValues) { |
|
|
|
|
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 false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function canFindKey (selectedValues, parents) { |
|
|
|
|
function canFindKey(selectedValues, parents) { |
|
|
|
|
var t = selectedValues; |
|
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
|
var v = parents[i]; |
|
|
|
@ -81723,7 +81724,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function isChild (selectedValues, parents) { |
|
|
|
|
function isChild(selectedValues, parents) { |
|
|
|
|
var t = selectedValues; |
|
|
|
|
for (var i = 0; i < parents.length; i++) { |
|
|
|
|
var v = parents[i]; |
|
|
|
@ -81759,7 +81760,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
}); |
|
|
|
|
callback(jo); |
|
|
|
|
|
|
|
|
|
function dealWithSelectedValues (selected, parents) { |
|
|
|
|
function dealWithSelectedValues(selected, parents) { |
|
|
|
|
if (selected == null || BI.isEmpty(selected)) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -81779,7 +81780,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return can && isAllSelected(selected, parents); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function isAllSelected (selected, parents) { |
|
|
|
|
function isAllSelected(selected, parents) { |
|
|
|
|
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 start = children.length; |
|
|
|
|
if (lastSearchValue !== "") { |
|
|
|
@ -81829,7 +81830,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function nodeSearch (deep, parentValues, current, isAllSelect, result) { |
|
|
|
|
function nodeSearch(deep, parentValues, current, isAllSelect, result) { |
|
|
|
|
if (self._isMatch(parentValues, current, keyword)) { |
|
|
|
|
var checked = isAllSelect || isSelected(parentValues, current); |
|
|
|
|
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); |
|
|
|
@ -81858,7 +81859,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
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); |
|
|
|
|
result.push({ |
|
|
|
|
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); |
|
|
|
|
if (find == 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); |
|
|
|
|
if (find == 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); |
|
|
|
|
if (find == null) { |
|
|
|
|
return false; |
|
|
|
@ -81914,7 +81915,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function findSelectedObj (parentValues) { |
|
|
|
|
function findSelectedObj(parentValues) { |
|
|
|
|
var find = selectedValues; |
|
|
|
|
if (find == 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; |
|
|
|
|
if (parentValues.length > 0 && !checked) { |
|
|
|
|
return false; |
|
|
|
@ -81970,7 +81971,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function dealWidthSelectedValue (parentValues, selectedValues) { |
|
|
|
|
function dealWidthSelectedValue(parentValues, selectedValues) { |
|
|
|
|
var valueMap = {}; |
|
|
|
|
BI.each(parentValues, function (i, v) { |
|
|
|
|
selectedValues = selectedValues[v] || {}; |
|
|
|
@ -81995,7 +81996,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
|
|
|
|
|
return valueMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getCheckState (current, parentValues, valueMap, checkState) { |
|
|
|
|
function getCheckState(current, parentValues, valueMap, checkState) { |
|
|
|
|
var checked = checkState.checked, half = checkState.half; |
|
|
|
|
var tempCheck = false, halfCheck = false; |
|
|
|
|
if (BI.has(valueMap, current)) { |
|
|
|
|