提交 7211510d 编写于 作者: U unknown

人员选择分类

上级 1eba06ec
......@@ -648,7 +648,7 @@ MWF.xApplication.Selector.Identity.Item = new Class({
if (callback) callback();
}
}else{
if (!this.data.woPerson){
if (!this.data.woPerson && (!this.data.personDn || !this.data.personEmployee || !this.data.personUnique)){
this.selector.orgAction.getPerson(function(json){
this.data.woPerson = json.data;
if (callback) callback();
......@@ -724,7 +724,7 @@ MWF.xApplication.Selector.Identity.ItemSelected = new Class({
}else{
if (callback) callback();
}
}else if (!this.data.woPerson){
}else if (!this.data.woPerson && (!this.data.personDn || !this.data.personEmployee || !this.data.personUnique) ){
if (this.data.person){
this.selector.orgAction.getPerson(function(json){
this.data.woPerson = json.data;
......
......@@ -252,7 +252,8 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/"+style+"/icon/companyicon.png)");
},
_addSelectedCount : function(){
this.selectedCountNode.set("text", this._getSelectedCount() || "");
var count = this._getSelectedCount();
this.selectedCountNode.set("text", count ? "(" + count + ")" : "");
},
_getSelectedCount : function(){
var list = this.subItems.filter( function (item) { return item.isSelected; });
......@@ -267,7 +268,8 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
loadSub : function(callback){
this._loadSub( function() {
if( this.selector.options.showSelectedCount ){
this.selectedCountNode.set("text", this._getSelectedCount() || "" )
var count = this._getSelectedCount();
this.selectedCountNode.set("text", count ? "(" + count + ")" : "" )
}
if( this.selector.options.isCheckStatus ){
......
......@@ -424,14 +424,9 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
},
_addSelectedCount : function( count, nested ){
debugger;
var c;
if( typeOf( this.selectedCount ) === "number" ){
c = this.selectedCount + count;
}else{
c = this._getSelectedCount(nested, true);
}
var c = (this._getSelectedCount() || 0) + count;
this.selectedCount = c;
this.selectedCountNode.set("text", c || "");
this.selectedCountNode.set("text", c ? "(" + c + ")" : "");
if( nested && this.category && this.category._addSelectedCount ){
this.category._addSelectedCount(count, nested);
}
......@@ -440,20 +435,12 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
// var list = this.subItems.filter( function (item) { return item.isSelected; });
// return list.length;
// },
_getSelectedCount : function(nested, cache){
_getSelectedCount : function(){
debugger;
if( typeOf( this.selectedCount ) === "number" ){
return this.selectedCount;
}else{
var count = 0;
if( nested ){
this.subCategorys.each( function (category) {
count = count + category._getSelectedCount( nested, cache );
});
}
var list = this.subItems.filter( function (item) { return item.isSelected; });
if( cache ) this.selectedCount = count+list.length;
return count+list.length;
return 0;
}
},
_getNestItemCount : function(){
......@@ -519,7 +506,17 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
this.loaded = true;
if( this.selector.options.showSelectedCount ){
this.selectedCountNode.set("text", this._getSelectedCount( true, true ) || "" )
var count = 0;
this.subCategorys.each( function (category) {
var l = category.subItems.filter( function (item) { return item.isSelected; });
count = count + l.length;
});
var list = this.subItems.filter( function (item) { return item.isSelected; });
this.selectedCount = count+list.length;
this.selectedCountNode.set("text", this.selectedCount ? "(" + this.selectedCount + ")" : "" );
}
if (callback) callback( );
......
......@@ -2448,8 +2448,9 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this.textNode.setStyle("margin-left", ""+m+"px");
if( this.selector.options.showSelectedCount && this.selector.selectType == "identity" && this._getSelectedCount ){
var c = this._getSelectedCount();
this.selectedCountNode = new Element("span", {
"text": this._getSelectedCount() || ""
"text": c ? "(" + c + ")" : ""
}).inject(this.textNode);
}
......@@ -2507,7 +2508,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
debugger;
var c = ( this._getSelectedCount() || 0 ) + count;
this.selectedCount = c;
this.selectedCountNode.set("text", c || "");
this.selectedCountNode.set("text", c ? "(" + c + ")" : "" );
if( nested && this.category && this.category._addSelectedCount ){
this.category._addSelectedCount(count, nested);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册