Răsfoiți Sursa

选择人员的数据

unknown 5 ani în urmă
părinte
comite
fec23b9665

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

@@ -23,7 +23,7 @@ MWF.xApplication.Selector.Identity = new Class({
         this.className = "Identity";
     },
     loadSelectItems : function(){
-        if( this.options.isCheckStatus || this.options.showSelectedCount ) {
+        if( this.className === "Identity" && (this.options.isCheckStatus || this.options.showSelectedCount )) {
 
             var unitList = [];
             var groupList = [];
@@ -778,7 +778,7 @@ MWF.xApplication.Selector.Identity.ItemSelected = new Class({
                 items.each(function(item){
                     item.selectedItem = this;
                     item.setSelected();
-                    if( this.selector.options.showSelectedCount ){
+                    if( this.selector.options.showSelectedCount && this.selector.selectType == "identity" ){
                         if(item.category && item.category._addSelectedCount )item.category._addSelectedCount( 1, true );
                     }
                 }.bind(this));

+ 8 - 2
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

@@ -419,9 +419,15 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemSelected = new Cla
 
 MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Class({
     Extends: MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory,
+    _getShowName: function(){
+        return this.data.name;
+    },
     _getSelectedCount : function(){
-        if( typeOf( this.selectedCount ) === "number" )return this.selectedCount;
-
+        if( typeOf( this.selectedCount ) === "number" ){
+            return this.selectedCount;
+        }else{
+            return 0
+        }
     },
     _getNestItemCount : function(){
         return this.data.subNestedIdentityCount;

+ 8 - 5
o2web/source/x_component_Selector/Person.js

@@ -2111,7 +2111,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
                         item.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
                     }
                 }
-                if( this.selector.options.showSelectedCount ){
+                if( this.selector.options.showSelectedCount && this.selector.selectType == "identity" ){
                     if(item.category && item.category._addSelectedCount )item.category._addSelectedCount( -1, true );
                 }
             }.bind(this));
@@ -2447,10 +2447,13 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
         var m = this.textNode.getStyle("margin-left").toFloat()+indent;
         this.textNode.setStyle("margin-left", ""+m+"px");
 
-        if( this.selector.options.showSelectedCount && this._getSelectedCount ){
-            this.selectedCountNode = new Element("span", {
-                "text": this._getSelectedCount()
-            }).inject(this.textNode);
+        if( this.selector.options.showSelectedCount && this.selector.selectType == "identity" && this._getSelectedCount ){
+            var selectedCount = this._getSelectedCount();
+            if( selectedCount > 0 ){
+                this.selectedCountNode = new Element("span", {
+                    "text": this._getSelectedCount()
+                }).inject(this.textNode);
+            }
         }
 
         this.children = new Element("div.children", {