提交 eac23eac 编写于 作者: 蔡祥熠

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
......@@ -15,7 +15,7 @@ MWF.xApplication.Selector.Application = new Class({
this.className = "Application"
},
loadSelectItems: function(addToNext){
this.processAction.listApplications(function(json){
o2.Actions.load("x_processplatform_assemble_designer").ApplicationAction.list(function(json){
json.data.each(function(data){
var category = this._newItem(data, this, this.itemAreaNode);
this.items.push( category );
......
......@@ -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 === 0 ){
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 ){
if( !this.items[0].isSelected )this.subItems[0].clickItem();
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].isSelected )this.items[0].clickItem();
this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
}else{
_self.fireEvent("afterCheckSelectSingleItem",[_self])
}
}else{
_self.fireEvent("afterCheckSelectSingleItem",[_self])
}
}else{
_self.fireEvent("afterCheckSelectSingleItem",[_self])
}
}.bind(this);
var checkCategoryItem = function (category) {
if( !category.subCategorys || category.subCategorys.length === 0 ){
if( category.subItems && category.subItems.length === 1 ){
isSingleItem = true;
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
}else{
_self.fireEvent("afterCheckSelectSingleItem",[_self])
}
}else if(category.subCategorys.length === 1){
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 &&
isSingleItem = true;
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
}else{
......@@ -1503,9 +1514,14 @@ MWF.xApplication.Selector.Person = new Class({
}
if( list.length === 0 ){
if( category.subItems && category.subItems.length === 1 ){
isSingleItem = true;
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
_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] );
}else if( this.subCategorys.length === 0 ){
checkItem();
}else{
_self.fireEvent("afterCheckSelectSingleItem",[_self])
}
},
setSize : function(){
......@@ -2034,7 +2052,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
this.selector.fireEvent("unselectItem",[this]);
if( checkValid )this.selector.fireEvent("valid", [this.selector, this]);
},
selected: function( checkValid, callback, selectedNode, byelectAll ){
selected: function( checkValid, callback, selectedNode, bySelectAll ){
debugger;
var count = this.selector.options.maxCount || this.selector.options.count;
count = count.toInt();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册