unknown 5 лет назад
Родитель
Сommit
7211510daf

+ 2 - 2
o2web/source/x_component_Selector/Identity.js

@@ -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;

+ 4 - 2
o2web/source/x_component_Selector/IdentityWidthDuty.js

@@ -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 ){
 

+ 15 - 18
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

@@ -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( );

+ 3 - 2
o2web/source/x_component_Selector/Person.js

@@ -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);
         }