From a57ff7369cc2fefecc2f8ff85f5adc21f35e7e46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Dec 2020 20:08:20 +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=A0afterSelectSingleItem=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2web/source/x_component_Selector/Identity.js | 4 ++++ o2web/source/x_component_Selector/Person.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/o2web/source/x_component_Selector/Identity.js b/o2web/source/x_component_Selector/Identity.js index 61cb654f8f..de07fdb9ad 100644 --- a/o2web/source/x_component_Selector/Identity.js +++ b/o2web/source/x_component_Selector/Identity.js @@ -1637,6 +1637,8 @@ MWF.xApplication.Selector.Identity.Include = new Class({ this.selector.items.push(item); if( category && category.subItems ){ category.subItems.push( item ); + }else if(this.selector.subItems){ + this.selector.subItems.push( item ) } } }.bind(this)); @@ -1657,6 +1659,8 @@ MWF.xApplication.Selector.Identity.Include = new Class({ this.selector.items.push(item); if( category && category.subItems ){ category.subItems.push( item ); + }else if(this.selector.subItems){ + this.selector.subItems.push( item ) } } }.bind(this)); diff --git a/o2web/source/x_component_Selector/Person.js b/o2web/source/x_component_Selector/Person.js index 897dc40a69..3da269774e 100644 --- a/o2web/source/x_component_Selector/Person.js +++ b/o2web/source/x_component_Selector/Person.js @@ -1457,15 +1457,19 @@ MWF.xApplication.Selector.Person = new Class({ } }, _selectSingleItem : function(){ + var _self = this; var checkItem = function () { if(this.items.length === 1 || this.subItems.length === 1 ){ if( this.items.length === 1 && this.subItems.length === 0 ){ if( !this.items[0].isSelected )this.items[0].clickItem(); + this.fireEvent("afterSelectSingleItem",[this, this.items[0]]) }else if( this.items.length === 0 && this.subItems.length === 1 ){ if( !this.items[0].isSelected )this.subItems[0].clickItem(); + this.fireEvent("afterSelectSingleItem",[this, this.items[0]]) }else if( this.items.length === 1 && this.subItems.length === 1 ){ if( this.items[0] === this.subItems[0] ){ if( !this.items[0].isSelected )this.items[0].clickItem(); + this.fireEvent("afterSelectSingleItem",[this, this.items[0]]) } } } @@ -1475,11 +1479,13 @@ MWF.xApplication.Selector.Person = new Class({ if( !category.subCategorys || category.subCategorys.length === 0 ){ if( category.subItems && category.subItems.length === 1 ){ if( !category.subItems[0].isSelected )category.subItems[0].clickItem(); + _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]]) } }else if(category.subCategorys.length === 1){ if( category.subItems && category.subItems.length > 0 ){ }else if( !category.subCategorys[0]._hasChild || !category.subCategorys[0]._hasChild() ){ //category.subCategorys[0].isItem && if( !category.subItems[0].isSelected )category.subItems[0].clickItem(); + _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]]) }else{ checkCategory( category.subCategorys[0] ) } @@ -1498,6 +1504,7 @@ MWF.xApplication.Selector.Person = new Class({ if( list.length === 0 ){ if( category.subItems && category.subItems.length === 1 ){ if( !category.subItems[0].isSelected )category.subItems[0].clickItem(); + _self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]]) } } } -- GitLab