AbnormalExport.min.js 3.3 KB

1
  1. MWF.xDesktop.requireApp("Attendance","Explorer",null,false);MWF.xDesktop.requireApp("Selector","package",null,false);MWF.xApplication.Attendance.AbnormalExport=new Class({Extends:MWF.xApplication.Attendance.Explorer,Implements:[Options,Events],initialize:function(t,e,n,i){this.setOptions(i);this.app=e;this.path="/x_component_Attendance/$AbnormalExport/";this.cssPath="/x_component_Attendance/$AbnormalExport/"+this.options.style+"/css.wcss";this._loadCss();this.actions=n;this.node=$(t);this.initData();if(!this.personActions)this.personActions=new MWF.xAction.org.express.RestActions},load:function(){this.loadToolbar();this.loadFilter();this.loadContentNode();this.setNodeScroll()},loadFilter:function(){this.fileterNode=new Element("div.fileterNode",{styles:this.css.fileterNode}).inject(this.node);var t=new Element("table",{width:"100%",border:"0",cellpadding:"5",cellspacing:"0",styles:this.css.filterTable,class:"filterTable"}).inject(this.fileterNode);var e=new Element("tr").inject(t);this.createYearSelectTd(e);this.createMonthSelectTd(e);this.createActionTd(e)},createYearSelectTd:function(t){var e=this;var n=new Element("td",{styles:this.css.filterTableTitle,text:"年度"}).inject(t);var n=new Element("td",{styles:this.css.filterTableValue}).inject(t);this.yearString=new MDomItem(n,{name:"yearString",type:"select",selectValue:function(){var t=[];var e=(new Date).getFullYear();for(var n=0;n<6;n++){t.push(e--)}return t}},true,this.app);this.yearString.load()},createMonthSelectTd:function(t){var e=this;var n=new Element("td",{styles:this.css.filterTableTitle,text:"月份"}).inject(t);var n=new Element("td",{styles:this.css.filterTableValue}).inject(t);this.monthString=new MDomItem(n,{name:"monthString",type:"select",selectValue:["01","02","03","04","05","06","07","08","09","10","11","12"]},true,this.app);this.monthString.load()},createActionTd:function(t){var e=new Element("td",{styles:this.css.filterTableValue}).inject(t);var n=new Element("button",{text:"导出",styles:this.css.filterButton}).inject(e);n.addEvent("click",function(){this.export(this.yearString.getValue(),this.monthString.getValue())}.bind(this))},setContentSize:function(){var t=this.toolbarNode?this.toolbarNode.getSize():{x:0,y:0};var e=this.app.titleBar?this.app.titleBar.getSize():{x:0,y:0};var n=this.fileterNode?this.fileterNode.getSize():{x:0,y:0};var i=this.node.getSize();var s=this.elementContentNode.getStyle("padding-top").toFloat();var o=this.elementContentNode.getStyle("padding-bottom").toFloat();var a=this.filterConditionNode?this.filterConditionNode.getSize():{x:0,y:0};var l=i.y-t.y-s-o-a.y-e.y-n.y;this.elementContentNode.setStyle("height",""+l+"px");this.pageCount=(l/30).toInt()+5;if(this.view&&this.view.items.length<this.pageCount){this.view.loadElementList(this.pageCount-this.view.items.length)}},export:function(t,e){this.actions.exportAbnormalAttachment(t,e)},loadView:function(t){},createDocument:function(){}});MWF.xApplication.Attendance.AbnormalExport.View=new Class({Extends:MWF.xApplication.Attendance.Explorer.View,_createItem:function(t){},_getCurrentPageData:function(t,e){},_removeDocument:function(t,e){},_createDocument:function(){},_openDocument:function(t){}});MWF.xApplication.Attendance.AbnormalExport.Document=new Class({Extends:MWF.xApplication.Attendance.Explorer.Document,agree:function(){},deny:function(){}});