|
|
@ -58,29 +58,34 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
function call (items) { |
|
|
|
function call (items) { |
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
var resultItems = items; |
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
if(BI.isNotEmptyArray(keywords)) { |
|
|
|
items = search.match.concat(search.find); |
|
|
|
resultItems = []; |
|
|
|
}); |
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
|
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
|
|
|
|
resultItems = resultItems.concat(search.match).concat(search.find); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
resultItems = BI.uniq(resultItems); |
|
|
|
|
|
|
|
} |
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
items = BI.filter(items, function (i, ob) { |
|
|
|
resultItems = BI.filter(resultItems, function (i, ob) { |
|
|
|
return !filter[ob.value]; |
|
|
|
return !filter[ob.value]; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
callback({ |
|
|
|
callback({ |
|
|
|
items: items |
|
|
|
items: resultItems |
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
callback({count: items.length}); |
|
|
|
callback({count: resultItems.length}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
callback({ |
|
|
|
callback({ |
|
|
|
items: self._getItemsByTimes(items, options.times), |
|
|
|
items: self._getItemsByTimes(resultItems, options.times), |
|
|
|
hasNext: self._hasNextByTimes(items, options.times) |
|
|
|
hasNext: self._hasNextByTimes(resultItems, options.times) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|