提交 b5139ca6 编写于 作者: U unknown

选择身份可能重复加载的问题

上级 0844c47b
......@@ -968,16 +968,8 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
// }
// }else{
this.selector.orgAction.listIdentityWithUnit(function(idJson){
idJson.data.each(function(idSubData){
if( !this.selector.isExcluded( idSubData ) ) {
var item = this.selector._newItem(idSubData, this.selector, this.children, this.level + 1, this);
this.selector.items.push(item);
if(this.subItems)this.subItems.push( item );
}
}.bind(this));
if( this.selector.options.expandSubEnable ){
var loadSubUnit = function () {
if( this.selector.options.expandSubEnable && !this.categoryLoaded ){
this.selector.orgAction.listSubUnitDirect(function(json){
json.data.each(function(subData){
if( !this.selector.isExcluded( subData ) ) {
......@@ -992,7 +984,23 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
this.loaded = true;
if (callback) callback( true );
}
}.bind(this), null, this.data.distinguishedName);
}.bind(this);
if( !this.itemLoaded ){
this.selector.orgAction.listIdentityWithUnit(function(idJson){
idJson.data.each(function(idSubData){
if( !this.selector.isExcluded( idSubData ) ) {
var item = this.selector._newItem(idSubData, this.selector, this.children, this.level + 1, this);
this.selector.items.push(item);
if(this.subItems)this.subItems.push( item );
}
}.bind(this));
loadSubUnit();
}.bind(this), null, this.data.distinguishedName);
}else{
loadSubUnit();
}
// }
}else{
if (callback) callback( );
......
......@@ -568,19 +568,22 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
this.itemLoaded = true;
}
if (this.data.unitList && this.data.unitList.length) {
this.data.unitList.sort(function (a, b) {
if( a.orderNumber === 0 )a.orderNumber = -1;
if( b.orderNumber === 0 )b.orderNumber = -1;
return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
});
this.data.unitList.each(function (subData) {
// if( !this.selector.isExcluded( subData ) ) {
var category = this.selector._newItemCategory("ItemCategory", subData, this.selector, this.children, this.level + 1, this);
this.subCategorys.push(category);
category.loadSub()
// }
}.bind(this));
if( !this.categoryLoaded ){
if (this.data.unitList && this.data.unitList.length) {
this.data.unitList.sort(function (a, b) {
if( a.orderNumber === 0 )a.orderNumber = -1;
if( b.orderNumber === 0 )b.orderNumber = -1;
return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
});
this.data.unitList.each(function (subData) {
// if( !this.selector.isExcluded( subData ) ) {
var category = this.selector._newItemCategory("ItemCategory", subData, this.selector, this.children, this.level + 1, this);
this.subCategorys.push(category);
category.loadSub()
// }
}.bind(this));
}
this.categoryLoaded = true;
}
this.loaded = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册