提交 11e4474c 编写于 作者: 蔡祥熠

Merge branch 'fix/Selector.search_with_identitityDuty' into 'wrdp'

Merge of fix/Selector.search_with_identitityDuty 修复组织职务按组织分类时搜索的问题 to wrdp

See merge request o2oa/o2oa!3737
......@@ -154,6 +154,7 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
_loadSelectItems: function (identityList) {
//this.listAllIdentityInUnitObject( identityList );
var unitTree = this.listNestedUnitByIdentity(identityList);
this.dataTree = unitTree;
this.uniqueIdentity(unitTree);
if (this.options.dutyUnitLevelBy === "duty") {
this.level1Container = [];
......@@ -442,6 +443,56 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
}
}
},
createItemsSearchData: function(callback){
if (!this.itemsSearchData){
this.itemsSearchData = [];
MWF.require("MWF.widget.PinYin", function(){
var initIds = [];
var _self = this;
function checkIdentity(data) {
var id = data.distinguishedName || data.id || data.name || data.text;
if (initIds.indexOf( id )==-1){
var text = data.name || "";
if( !text && data.distinguishedName ){
var dn = data.distinguishedName.split("@");
text = dn[0];
}
var pinyin = text.toPY().toLowerCase();
var firstPY = text.toPYFirst().toLowerCase();
_self.itemsSearchData.push({
"text": text,
"pinyin": pinyin,
"firstPY": firstPY,
"data": data
});
initIds.push( id );
}
}
function checkUnit(unit) {
if(unit.identityList && unit.identityList.length){
unit.identityList.each( function (identity) {
checkIdentity(identity);
})
}
if(unit.unitList && unit.unitList.length){
unit.unitList.each( function (unit) {
checkUnit(unit);
})
}
}
this.dataTree.unitList.each(function(unit){
checkUnit(unit);
}.bind(this));
delete initIds;
if (callback) callback();
}.bind(this));
}else{
if (callback) callback();
}
},
//listNestedUnitByIdentity : function( identityList ){
// debugger;
// this.unitArray = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册