Эх сурвалжийг харах

Merge branch 'feature/Selector.add_after_selectItem' into 'wrdp'

Merge of feature/Selector.add_after_selectItem 人员选择组件增加afterCheckSelectSingleItem事件 to wrdp

See merge request o2oa/o2oa!2541
蔡祥熠 5 жил өмнө
parent
commit
10039e3428

+ 1 - 1
o2web/source/x_component_Selector/Application.js

@@ -15,7 +15,7 @@ MWF.xApplication.Selector.Application = new Class({
         this.className = "Application"
         this.className = "Application"
     },
     },
     loadSelectItems: function(addToNext){
     loadSelectItems: function(addToNext){
-        this.processAction.listApplications(function(json){
+        o2.Actions.load("x_processplatform_assemble_designer").ApplicationAction.list(function(json){
             json.data.each(function(data){
             json.data.each(function(data){
                 var category = this._newItem(data, this, this.itemAreaNode);
                 var category = this._newItem(data, this, this.itemAreaNode);
                 this.items.push( category );
                 this.items.push( category );

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

@@ -1462,7 +1462,7 @@ MWF.xApplication.Selector.Person = new Class({
             if(this.items.length === 1 || this.subItems.length === 1 ){
             if(this.items.length === 1 || this.subItems.length === 1 ){
                 if( this.items.length === 1 && this.subItems.length === 0 ){
                 if( this.items.length === 1 && this.subItems.length === 0 ){
                     if( !this.items[0].isSelected )this.items[0].clickItem();
                     if( !this.items[0].isSelected )this.items[0].clickItem();
-                    this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
+                    this.fireEvent("afterSelectSingleItem",[this, this.items[0]]);
                 }else if( this.items.length === 0 && this.subItems.length === 1 ){
                 }else if( this.items.length === 0 && this.subItems.length === 1 ){
                     if( !this.items[0].isSelected )this.subItems[0].clickItem();
                     if( !this.items[0].isSelected )this.subItems[0].clickItem();
                     this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
                     this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
@@ -1470,20 +1470,31 @@ MWF.xApplication.Selector.Person = new Class({
                     if( this.items[0] === this.subItems[0] ){
                     if( this.items[0] === this.subItems[0] ){
                         if( !this.items[0].isSelected )this.items[0].clickItem();
                         if( !this.items[0].isSelected )this.items[0].clickItem();
                         this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
                         this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
+                    }else{
+                        _self.fireEvent("afterCheckSelectSingleItem",[_self])
                     }
                     }
+                }else{
+                    _self.fireEvent("afterCheckSelectSingleItem",[_self])
                 }
                 }
+            }else{
+                _self.fireEvent("afterCheckSelectSingleItem",[_self])
             }
             }
         }.bind(this);
         }.bind(this);
 
 
         var checkCategoryItem = function (category) {
         var checkCategoryItem = function (category) {
             if( !category.subCategorys || category.subCategorys.length === 0 ){
             if( !category.subCategorys || category.subCategorys.length === 0 ){
                 if( category.subItems && category.subItems.length === 1 ){
                 if( category.subItems && category.subItems.length === 1 ){
+                    isSingleItem = true;
                     if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                     if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                     _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
                     _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
+                }else{
+                    _self.fireEvent("afterCheckSelectSingleItem",[_self])
                 }
                 }
             }else if(category.subCategorys.length === 1){
             }else if(category.subCategorys.length === 1){
                 if( category.subItems && category.subItems.length > 0 ){
                 if( category.subItems && category.subItems.length > 0 ){
+                    _self.fireEvent("afterCheckSelectSingleItem",[_self])
                 }else if( !category.subCategorys[0]._hasChild || !category.subCategorys[0]._hasChild() ){ //category.subCategorys[0].isItem &&
                 }else if( !category.subCategorys[0]._hasChild || !category.subCategorys[0]._hasChild() ){ //category.subCategorys[0].isItem &&
+                    isSingleItem = true;
                     if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                     if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                     _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
                     _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
                 }else{
                 }else{
@@ -1503,9 +1514,14 @@ MWF.xApplication.Selector.Person = new Class({
                 }
                 }
                 if( list.length === 0 ){
                 if( list.length === 0 ){
                     if( category.subItems && category.subItems.length === 1 ){
                     if( category.subItems && category.subItems.length === 1 ){
+                        isSingleItem = true;
                         if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                         if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
                         _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
                         _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
+                    }else{
+                        _self.fireEvent("afterCheckSelectSingleItem",[_self])
                     }
                     }
+                }else{
+                    _self.fireEvent("afterCheckSelectSingleItem",[_self])
                 }
                 }
             }
             }
         };
         };
@@ -1521,10 +1537,12 @@ MWF.xApplication.Selector.Person = new Class({
             }
             }
         };
         };
 
 
-        if( this.subCategorys.length === 1 ) {
+        if( this.subCategorys.length === 1 && this.subItems.length === 0) {
             checkCategory( this.subCategorys[0] );
             checkCategory( this.subCategorys[0] );
         }else if( this.subCategorys.length === 0 ){
         }else if( this.subCategorys.length === 0 ){
             checkItem();
             checkItem();
+        }else{
+            _self.fireEvent("afterCheckSelectSingleItem",[_self])
         }
         }
     },
     },
     setSize : function(){
     setSize : function(){
@@ -2034,7 +2052,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         this.selector.fireEvent("unselectItem",[this]);
         this.selector.fireEvent("unselectItem",[this]);
         if( checkValid )this.selector.fireEvent("valid", [this.selector, this]);
         if( checkValid )this.selector.fireEvent("valid", [this.selector, this]);
     },
     },
-    selected: function( checkValid, callback, selectedNode, byelectAll ){
+    selected: function( checkValid, callback, selectedNode, bySelectAll ){
         debugger;
         debugger;
         var count = this.selector.options.maxCount || this.selector.options.count;
         var count = this.selector.options.maxCount || this.selector.options.count;
         count = count.toInt();
         count = count.toInt();