Duty.min.js 2.2 KB

1
  1. MWF.xApplication.Selector=MWF.xApplication.Selector||{};MWF.xDesktop.requireApp("Selector","Person",null,false);MWF.xApplication.Selector.Duty=new Class({Extends:MWF.xApplication.Selector.Person,options:{style:"default",count:0,title:MWF.xApplication.Selector.LP.selectDuty,values:[],expand:false},loadSelectItems:function(t){this.orgAction.listUnitdutyName(function(t){t.data.nameList.each(function(t){var e=this._newItem(t,this,this.itemAreaNode)}.bind(this))}.bind(this))},_scrollEvent:function(t){return true},_getChildrenItemIds:function(){return null},_newItemCategory:function(t,e,n,i,o){return new MWF.xApplication.Selector.Duty[t](e,n,i,o)},_listItemByKey:function(t,e,n){this.orgAction.listUnitdutyNameByKey(function(e){if(t)t.apply(this,[{data:e.data.nameList}])}.bind(this),e,n)},_getItem:function(t,e,n,i){if(t)t.apply(this,[{data:{name:n,id:n}}])},_newItemSelected:function(t,e,n){return new MWF.xApplication.Selector.Duty.ItemSelected(t,e,n)},_listItemByPinyin:function(t,e,n){this.orgAction.listUnitdutyNameByKey(function(e){if(t)t.apply(this,[{data:e.data.nameList}])}.bind(this),e,n)},_newItem:function(t,e,n,i){return new MWF.xApplication.Selector.Duty.Item({name:t,id:t},e,n,i)}});MWF.xApplication.Selector.Duty.Item=new Class({Extends:MWF.xApplication.Selector.Person.Item,_getShowName:function(){return this.data.name},_setIcon:function(){this.iconNode.setStyle("background-image","url("+"/x_component_Selector/$Selector/default/icon/duty.png)")},checkSelectedSingle:function(){var t=this.selector.options.values.filter(function(t,e){if(typeOf(t)==="object")return this.data.id===t.id||this.data.name===t.name;if(typeOf(t)==="string")return this.data.id===t||this.data.name===t;return false}.bind(this));if(t.length){this.selectedSingle()}},checkSelected:function(){var t=this.selector.selectedItems.filter(function(t,e){return t.data.id===this.data.id||t.data.name===this.data.name}.bind(this));if(t.length){t[0].addItem(this);this.selectedItem=t[0];this.setSelected()}}});MWF.xApplication.Selector.Duty.ItemSelected=new Class({Extends:MWF.xApplication.Selector.Person.ItemSelected,_getShowName:function(){debugger;return this.data.name},_setIcon:function(){this.iconNode.setStyle("background-image","url("+"/x_component_Selector/$Selector/default/icon/duty.png)")}});