Просмотр исходного кода

Merge branch 'feature/Selector.item_add_disable' into 'develop'

Merge of feature/[人员选择].人员选择增加disable方法 to develop

See merge request o2oa/o2oa!1405
蔡祥熠 5 лет назад
Родитель
Сommit
9dd55bea2f

+ 9 - 1
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]);

+ 2 - 2
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]);