提交 2d36a19f 编写于 作者: 蔡祥熠

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

Merge of fix/Selector.search_unit  修复selector搜索无下级分类组织时的问题 to wrdp

See merge request o2oa/o2oa!2662
...@@ -161,21 +161,30 @@ MWF.xApplication.Selector.Unit = new Class({ ...@@ -161,21 +161,30 @@ MWF.xApplication.Selector.Unit = new Class({
}, },
_listItemByKey: function(callback, failure, key){ _listItemByKey: function(callback, failure, key){
if (this.options.units.length){ if( this.options.expandSubEnable ){
var units = []; if (this.options.units.length){
this.options.units.each(function(u){ var units = [];
if (typeOf(u)==="string"){ this.options.units.each(function(u){
units.push(u); if (typeOf(u)==="string"){
} units.push(u);
if (typeOf(u)==="object"){ }
units.push(u.distinguishedName); if (typeOf(u)==="object"){
} units.push(u.distinguishedName);
}); }
key = {"key": key, "unitList": units}; });
key = {"key": key, "unitList": units};
}
this.orgAction.listUnitByKey(function(json){
if (callback) callback.apply(this, [json]);
}.bind(this), failure, key);
}else{
if (key){
this.initSearchArea(true);
this.searchInItems(key);
}else{
this.initSearchArea(false);
}
} }
this.orgAction.listUnitByKey(function(json){
if (callback) callback.apply(this, [json]);
}.bind(this), failure, key);
}, },
_getItem: function(callback, failure, id, async){ _getItem: function(callback, failure, id, async){
this.orgAction.getUnit(function(json){ this.orgAction.getUnit(function(json){
......
...@@ -73,23 +73,32 @@ MWF.xApplication.Selector.UnitWithType = new Class({ ...@@ -73,23 +73,32 @@ MWF.xApplication.Selector.UnitWithType = new Class({
}, },
_listItemByKey: function(callback, failure, key){ _listItemByKey: function(callback, failure, key){
key = {"key": key}; if( this.options.expandSubEnable ){
if (this.options.units.length){ key = {"key": key};
var units = []; if (this.options.units.length){
this.options.units.each(function(u){ var units = [];
if (typeOf(u)==="string"){ this.options.units.each(function(u){
units.push(u); if (typeOf(u)==="string"){
} units.push(u);
if (typeOf(u)==="object"){ }
units.push(u.distinguishedName); if (typeOf(u)==="object"){
} units.push(u.distinguishedName);
}); }
key.unitList = units; });
key.unitList = units;
}
if (this.options.unitType) key.type = this.options.unitType;
this.orgAction.listUnitByKey(function(json){
if (callback) callback.apply(this, [json]);
}.bind(this), failure, key);
}else{
if (key){
this.initSearchArea(true);
this.searchInItems(key);
}else{
this.initSearchArea(false);
}
} }
if (this.options.unitType) key.type = this.options.unitType;
this.orgAction.listUnitByKey(function(json){
if (callback) callback.apply(this, [json]);
}.bind(this), failure, key);
}, },
_getItem: function(callback, failure, id, async){ _getItem: function(callback, failure, id, async){
this.orgAction.getUnit(function(json){ this.orgAction.getUnit(function(json){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册