From a04dfe0a884e6192cf2e61fc398bd59c5aca0a55 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2020 15:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=80=89=E6=8B=A9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0disable=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2web/source/x_component_Selector/Person.js | 10 +++++++++- o2web/source/x_component_Selector/Unit.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/o2web/source/x_component_Selector/Person.js b/o2web/source/x_component_Selector/Person.js index ad34ef50f6..6e6afaa575 100644 --- a/o2web/source/x_component_Selector/Person.js +++ b/o2web/source/x_component_Selector/Person.js @@ -1703,6 +1703,14 @@ MWF.xApplication.Selector.Person.Item = new Class({ } }, loadSubItem: function(){}, + disable : function(){ + this.node.hide(); + this.disabled = true; + }, + enable : function(){ + this.node.show(); + this.disabled = false; + }, check: function(){ //if (this.selector.options.count.toInt()===1){ // this.checkSelectedSingle(); @@ -2365,7 +2373,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({ if ((count.toInt()===0) || (this.selector.selectedItems.length+(this.subItems.length-selectedSubItemCount))<=count){ var checkedCount = 0; this.subItems.each( function(item){ - if(!item.isSelected)item.selected( false, function () { + if(!item.isSelected && !item.disabled )item.selected( false, function () { checkedCount++; if( this.subItems.length === checkedCount ){ if( checkValid )this.selector.fireEvent("valid", [this.selector, this]); diff --git a/o2web/source/x_component_Selector/Unit.js b/o2web/source/x_component_Selector/Unit.js index d3bf01bda7..38e112d478 100644 --- a/o2web/source/x_component_Selector/Unit.js +++ b/o2web/source/x_component_Selector/Unit.js @@ -396,7 +396,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({ this.selectAll(ev, checkValid); if( this.subCategorys && this.subCategorys.length ){ this.subCategorys.each( function( category ){ - if(category.selectAllNested)category.selectAllNestedev, checkValid() + if(category.selectAllNested)category.selectAllNested, checkValid() }) } if( this.subItems && this.subItems.length ){ @@ -427,7 +427,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({ if ((count.toInt()===0) || (this.selector.selectedItems.length+(this.subItems.length-selectedSubItemCount))<=count){ var checkedCount = 0; this.subItems.each( function(item){ - if(!item.isSelected)item.selected(false, function () { + if(!item.isSelected && !item.disabled )item.selected(false, function () { checkedCount++; if( this.subItems.length === checkedCount ){ if( checkValid )this.selector.fireEvent("valid", [this.selector, this]); -- GitLab