{"size": 60889, "ext": "js", "max_stars_repo_path": "o2server/servers/webServer/x_component_Report/Common.min.js", "max_stars_repo_name": "huangxinping/o2oa", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "o2server/servers/webServer/x_component_Report/Common.min.js", "max_issues_repo_name": "huangxinping/o2oa", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "o2server/servers/webServer/x_component_Report/Common.min.js", "max_forks_repo_name": "huangxinping/o2oa", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 60889.0, "max_line_length": 60889, "alphanum_fraction": 0.7507760022}
MWF.xDesktop.requireApp("Template","MPopupForm",null,!1),MWF.xDesktop.requireApp("Template","MTooltips",null,!1),MWF.xDesktop.requireApp("Template","MForm",null,!1),MWF.require("MWF.widget.O2Identity",null,!1),MWF.xDesktop.requireApp("Selector","package",null,!1),MWF.xDesktop.requireApp("Report","Attachment",null,!1),MWF.xApplication.Report=MWF.xApplication.Report||{},MWF.xApplication.Report.Common=new Class({initialize:function(t){this.app=t},getIdentity:function(t,e){t||(t=(layout.desktop.session.user||layout.user).distinguishedName),this.identityList||(this.identityList={}),this.identityList[t]?e&&e(this.identityList[t]):MWF.Actions.get("x_organization_assemble_express").listIdentityWithPersonValue({personList:[t]},function(i){this.identityList[t]=i.data.identityList,e&&e(this.identityList[t])}.bind(this))},openReport:function(t,e){if("已完成"==t.reportStatus||"结束"==t.reportStatus||"董事长审阅"==t.reportStatus)MWF.Actions.get("x_processplatform_assemble_surface").listWorkByJob(t.wf_JobId,function(t){var e=t.data.workCompletedList;if(e.length>0){var i={workCompletedId:e[0].id,appId:e[0].id,onQueryClose:function(){}.bind(this)};this.app.desktop.openApplication(null,"process.Work",i)}}.bind(this));else{var i={workId:t.wf_WorkId,appId:t.wf_WorkId,onQueryClose:function(){this.obj.app.restActions.getReport(t.id,function(t){if(this.reportData.activityName!=t.data.activityName)try{e.reload()}catch(t){}}.bind(this))}.bind({obj:this,reportData:t})};this.app.desktop.openApplication(null,"process.Work",i)}},addWork:function(t,e,i,s){var o=new MWF.xApplication.Report.WorkForm(this.app,{reportId:t.id,targetPerson:t.targetPerson},{orderNumber:s},{app:this.app});o.view=i,o.reportData=t,o.keyworkData=e,o.create()},editWork:function(t,e,i){var s=new MWF.xApplication.Report.WorkForm(this.app,t,{},{app:this.app});s.reportData=e,s.view=i,s.edit()},openWork:function(t,e,i,s,o){var n=new MWF.xApplication.Report.WorkForm(this.app,t,{editedAble:o},{app:this.app});n.reportData=e,n.keyworkData=i,n.view=s,n.open()},deleteWork:function(t,e,i){var s=this,o=this.app.lp.delete_work.replace(/{name}/g,t.progressContent);this.app.confirm("infor",e,this.app.lp.delete_work_title,o,380,150,(function(){s._deleteWork(t,i,e),this.close()}),(function(){this.close()}))},_deleteWork:function(t,e,i){this.app.restActions.deleteWork(t.id,function(){e&&e(),this.app.notice(this.app.lp.deleteDocumentOK,"success",i.target)}.bind(this))},addCustomWork:function(t,e,i,s){var o=new MWF.xApplication.Report.CustomWorkForm(this.app,{reportId:t.id,targetPerson:t.targetPerson},{orderNumber:s},{app:this.app});o.view=i,o.reportData=t,o.keyworkData=e,o.create()},editCustomWork:function(t,e,i){var s=new MWF.xApplication.Report.CustomWorkForm(this.app,t,{},{app:this.app});s.reportData=e,s.view=i,s.edit()},openCustomWork:function(t,e,i,s,o){var n=new MWF.xApplication.Report.CustomWorkForm(this.app,t,{editedAble:o},{app:this.app});n.reportData=e,n.keyworkData=i,n.view=s,n.open()},deleteCustomWork:function(t,e,i){var s=this,o=this.app.lp.delete_work.replace(/{name}/g,t.workTitle);this.app.confirm("infor",e,this.app.lp.delete_work_title,o,380,150,(function(){s._deleteCustomWork(t,i,e),this.close()}),(function(){this.close()}))},_deleteCustomWork:function(t,e,i){this.app.restActions.deleteWork(t.id,function(){e&&e(),this.app.notice(this.app.lp.deleteDocumentOK,"success",i.target)}.bind(this))},addExtWork:function(t,e,i,s,o){var n=new MWF.xApplication.Report.ExtWorkForm(this.app,{reportId:t.id,targetPerson:t.targetPerson},{category:o,orderNumber:s},{app:this.app});n.view=i,n.reportData=t,n.keyworkData=e,n.create()},editExtWork:function(t,e,i,s,o){var n=new MWF.xApplication.Report.ExtWorkForm(this.app,t,{category:o},{app:this.app});n.reportData=e,n.keyworkData=i,n.view=s,n.edit()},openExtWork:function(t,e,i,s,o,n){var r=new MWF.xApplication.Report.ExtWorkForm(this.app,t,{editedAble:o,category:n},{app:this.app});r.reportData=e,r.keyworkData=i,r.view=s,r.open()},deleteExtWork:function(t,e,i,s){var o=this;this.app.confirm("infor",e,this.app.lp.delete_work_title,"确定要删除该工作？",380,150,(function(){o._deleteExtWork(t,i,e,s),this.close()}),(function(){this.close()}))},_deleteExtWork:function(t,e,i,s){this.app.restActions["delete"+s](t.id,function(){e&&e(),this.app.notice(this.app.lp.deleteDocumentOK,"success",i.target)}.bind(this))},addPlan:function(t,e,i,s,o){var n=new MWF.xApplication.Report.PlanForm(this.app,{reportId:t.id,targetPerson:t.targetPerson},{isPlanNext:s,orderNumber:o},{app:this.app});n.reportData=t,n.keyworkData=e,n.view=i,n.create()},editPlan:function(t,e,i,s,o){var n=new MWF.xApplication.Report.PlanForm(this.app,t,{isPlanNext:o},{app:this.app});n.reportData=e,n.keyworkData=i,n.view=s,n.edit()},openPlan:function(t,e,i,s,o,n){var r=new MWF.xApplication.Report.PlanForm(this.app,t,{isPlanNext:o,editedAble:n},{app:this.app});r.reportData=e,r.keyworkData=i,r.view=s,r.open()},deletePlan:function(t,e,i){var s=this,o=this.app.lp.delete_plan.replace(/{name}/g,t.planContent);this.app.confirm("infor",e,this.app.lp.delete_plan_title,o,380,150,(function(){s._deletePlan(t,i,e),this.close()}),(function(){this.close()}))},_deletePlan:function(t,e,i){this.app.restActions.deletePlan(t.id,function(){e&&e(),this.app.notice(this.app.lp.deleteDocumentOK,"success",i.target)}.bind(this))},deletePlanNext:function(t,e,i){var s=this,o=this.app.lp.delete_plan.replace(/{name}/g,t.planContent);this.app.confirm("infor",e,this.app.lp.delete_plan_title,o,380,150,(function(){s._deletePlanNext(t,i,e),this.close()}),(function(){this.close()}))},_deletePlanNext:function(t,e,i){this.app.restActions.deletePlanNext(t.id,function(){e&&e(),this.app.notice(this.app.lp.deleteDocumentOK,"success",i.target)}.bind(this))},getUnitWithExportPermission:function(t){this.getIdentity(null,function(e){this.unitList=[],e.each(function(t){MWF.Actions.get("x_organization_assemble_express").listUnitWithDuty({name:"部门战略管理员",identity:t},function(t){for(var e=0;e<t.data.length;e++)this.unitList.push(t.data[e].distinguishedName)}.bind(this),null,!1),MWF.Actions.get("x_organization_assemble_express").listUnitWithDuty({name:"部主管",identity:t},function(t){for(var e=0;e<t.data.length;e++)this.unitList.push(t.data[e].distinguishedName)}.bind(this),null,!1)}.bind(this)),t&&t(this.unitList)}.bind(this))},hasExportAllUnitPermission:function(){if("boolean"==typeOf(this.exportFlag))return this.exportFlag;if(this.exportFlag=!1,this.isAdmin())return this.exportFlag=!0,this.exportFlag;var t=(layout.desktop.session.user||layout.user).distinguishedName;return MWF.Actions.get("x_organization_assemble_express").listPersonWithGroup({groupList:["ReportExporter"]},function(e){for(var i=0;i<e.data.length;i++)if(e.data[i].distinguishedName==t){this.exportFlag=!0;break}}.bind(this),null,!1),this.exportFlag},isAdmin:function(){return"boolean"==typeOf(this.adminFlag)||this.app.restActions.isAdmin(function(t){this.adminFlag=t.data.value}.bind(this),null,!1),this.adminFlag},addZero:function(t,e){var i="";t=t.toString();for(var s=0;s<e;s++)i+="0";var o=i+t;return o.substr(o.length-e,e)},listSetting:function(t){this.setting?t&&t(this.setting):(this.setting={},this.app.restActions.listSetting(function(e){e.data.each(function(t){var e=t.configValue;if("string"==typeOf(e))"NONE"==e&&(e="");else if("array"==typeOf(e))for(var i=0;i<e.length-1;i++)"NONE"==e[i]&&(e[i]="");this.setting[t.configCode]=e}.bind(this)),t&&t(this.setting)}.bind(this)))},replaceWithBr:function(t){if("string"!=typeOf(t))return"";var e=new RegExp("\n","g");return t.replace(e,"<br/>")},splitWithLength:function(t,e){var i=[];return t.split("\n").each((function(t){do{i.push(t.substr(0,Math.min(t.length,e))),t=t.length>e?t.substr(e,t.length):""}while(t)})),i.join("\n")}}),MWF.xApplication.Report.ReportFileter=new Class({Implements:[Options,Events],options:{items:["reportType","title","year","month","reportDate","targetList","activityList","currentPersonList","reportStatus"],defaultResult:{}},initialize:function(t,e,i){this.setOptions(i),this.container=t,this.app=e,this.lp=e.lp,this.css=e.css,this.load()},load:function(){this.searchBarAreaNode=new Element("div",{styles:this.css.searchBarAreaNode}).inject(this.container),this.searchBarNode=new Element("div",{styles:this.css.searchBarNode}).inject(this.searchBarAreaNode),this.searchBarInputBoxNode=new Element("div",{styles:this.css.searchBarInputBoxNode}).inject(this.searchBarNode),this.searchBarInputNode=new Element("input",{type:"text",value:this.lp.searchKey,styles:this.css.searchBarInputNode}).inject(this.searchBarInputBoxNode),this.searchBarResetActionNode=new Element("div",{styles:this.css.searchBarResetActionNode}).inject(this.searchBarInputBoxNode),this.searchBarResetActionNode.setStyle("display","none"),this.searchBarActionNode=new Element("div",{styles:this.css.searchBarActionNode}).inject(this.searchBarNode),this.searchBarMoreActionNode=new Element("div",{styles:this.css.searchMoreActionNode,title:"高级搜索"}).inject(this.searchBarNode);var t=this;this.searchBarActionNode.addEvent("click",function(){this.search()}.bind(this)),this.searchBarResetActionNode.addEvent("click",function(){this.reset()}.bind(this)),this.searchBarInputNode.addEvents({focus:function(){this.value==t.lp.searchKey&&this.set("value","")},blur:function(){this.value||this.set("value",t.lp.searchKey)},keydown:function(t){13==t.code&&(this.search(),t.preventDefault())}.bind(this)}),this.loadMore()},destroy:function(){this.tootip.destroy(),this.container.empty()},reload:function(t){this.removeEvent("search"),this.setOptions(t),this.tootip.reload(t)},getResult:function(){var t=this.searchBarInputNode.get("value"),e={title:t==this.lp.searchKey?"":t};return e.title||(e={}),this.options.defaultResult&&(e=Object.merge(e,this.options.defaultResult)),e},search:function(t){this.searchBarResetActionNode.setStyle("display",""),this.fireEvent("search",t||this.getResult())},reset:function(t){this.searchBarResetActionNode.setStyle("display","none"),this.searchBarInputNode.set("value",this.lp.searchKey),this.fireEvent("search",t||this.options.defaultResult)},loadMore:function(){this.tootip=new MWF.xApplication.Report.FileterTooltip(this.app.content,this.searchBarMoreActionNode,this.app,{},this.options),this.tootip.parent=this}}),MWF.xApplication.Report.FileterTooltip=new Class({Extends:MTooltips,options:{event:"click",position:"right",nodeStyles:{"font-size":"12px",position:"absolute","max-width":"500px","min-width":"360px","z-index":"11","background-color":"#fff",padding:"20px","border-radius":"8px","box-shadow":"0 0 18px 0 #999","-webkit-user-select":"text","-moz-user-select":"text"},items:["reportType","title","year","month","reportDate","targetList","activityList","currentPersonList","reportStatus","reportObjType"],defaultResult:{}},destroy:function(){this.node&&this.node.destroy(),this.markNode&&this.markNode.destroy(),this.node=null,this.markNode=null},reload:function(t){this.node&&this.node.destroy(),this.markNode&&this.markNode.destroy(),this.node=null,this.markNode=null,this.setOptions(t)},_customNode:function(t){},_loadCustom:function(t){this.getReportType(function(){this.loadHTML(),this.loadForm(),t&&t()}.bind(this))},_getHtml:function(){},getReportType:function(t){this.app.common.listSetting(function(e){this.setting=e,this.reportType={value:[""],text:["全部"]},"true"==e.MONTHREPORT_ENABLE&&(this.reportType.value.push("MONTH"),this.reportType.text.push("月报")),"true"==e.WEEKREPORT_ENABLE&&(this.reportType.value.push("WEEK"),this.reportType.text.push("周报")),"true"==e.DAYREPORT_ENABLE&&(this.reportType.value.push("DAILY"),this.reportType.text.push("日报")),t&&t()}.bind(this))},getItemTemplate:function(){var t={title:{text:"标题",type:"text"},year:{text:"年度",type:"select",defaultValue:(new Date).getFullYear(),selectValue:["",2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037]},month:{text:"月份",type:"select",selectValue:["","01","02","03","04","05","06","07","08","09","10","11","12"]},targetList:{text:"汇报者",type:"org",orgType:"person"},activityList:{text:"审核环节"},currentPersonList:{text:"当前处理人",type:"org",orgType:"person"},reportObjType:{text:"汇报类型",type:"select",selectValue:["","PERSON","UNIT"],selectText:["","个人汇报","组织汇报"]},reportStatus:{text:"汇报状态",type:"select",selectValue:["","汇报者填写","审核中","已完成"]}};for(var e in this.reportType.value.length>2&&(t.reportType={text:"类别",type:"select",selectValue:this.reportType.value,selectText:this.reportType.text}),t)this.options.items.contains(e)||delete t[e];return t.filterAction={text:"搜索",value:"搜索",type:"button",className:"inputSeachButton",event:{click:function(){this.parent.search(this.getResult())}.bind(this)}},t.resetAction={text:"重置",value:"重置",type:"button",className:"inputResetButton",event:{click:function(){this.parent.reset(this.reset())}.bind(this)}},t},loadHTML:function(){this.formNode=new Element("div").inject(this.node);var t={title:"<tr><td styles='formTableTitle14' lable='title' width='30%'></td><td item='title' styles='formTableValue14' width='70%'></td></tr>",year:"<tr><td styles='formTableTitle14' lable='year'></td><td item='year' styles='formTableValue14'></td></tr>",month:"<tr><td styles='formTableTitle14' lable='month'></td><td item='month' styles='formTableValue14'></td></tr>",targetList:"<tr><td styles='formTableTitle14' lable='targetList'></td><td item='targetList' styles='formTableValue14'></td></tr>",currentPersonList:"<tr><td styles='formTableTitle14' lable='currentPersonList'></td><td item='currentPersonList' styles='formTableValue14'></td></tr>",activityList:"<tr><td styles='formTableTitle14' lable='activityList'></td><td item='activityList' styles='formTableValue14'></td></tr>"};for(var e in this.reportType.value.length>2&&(t.reportType="<tr><td styles='formTableTitle14' lable='reportType'></td><td item='reportType' styles='formTableValue14'></td></tr>"),t)this.options.items.contains(e)||delete t[e];var i="<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable'>";for(var e in t)i+=t[e];i+="<tr><td></td><td styles='formTableValue14'><span item='filterAction'></span><span item='resetAction'></span></td></tr>",i+="</table>",this.formNode.set("html",i)},loadForm:function(){this.form=new MForm(this.formNode,{},{usesNewVersion:!0,isEdited:!0,style:"report",hasColon:!0,itemTemplate:this.getItemTemplate()},this.app),this.form.load()},reset:function(){return this.form.reset(),this.options.defaultResult},getResult:function(){var t=this.form.getResult(!1,null,!1,!1,!1);for(var e in t){var i=t[e];"array"==typeOf(i)&&0==i.length?delete t[e]:i||delete t[e]}return delete t.filterAction,this.options.defaultResult&&(t=Object.merge(t,this.options.defaultResult)),t.activityList&&(t.activityList=[t.activityList]),t}}),MWF.xApplication.Report.PlanForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:400,minWidth:700,minHeight:320,hasTop:!0,hasIcon:!1,hasTopIcon:!1,hasTopContent:!1,maxAction:!0,hasBottom:!0,draggable:!0,resizeable:!0,editedAble:!0,closeAction:!0,isPlanNext:!0},_createTableContent:function(){this.data.planContent&&"暂无内容"==this.data.planContent&&(this.data.planContent=""),this.formTopTextNode.set("text",this.options.isPlanNext?"下月计划":"本月计划");this.isEdited||this.isNew;this.formTableArea.set("html","<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '><tr><td styles='formTableTitle' lable='workTitle' width='20%'></td>    <td styles='formTableValue14' colspan='3'>       <div item='workTitle' style=''></div></td></tr><tr><td styles='formTableTitle' lable='planContent'></td>    <td styles='formTableValue14' item='planContent' colspan='3'></td></tr></table>"),this.loadForm()},loadForm:function(){this.data&&(this.data.workTitle=this.keyworkData.workTitle),MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{workTitle:{type:"innertext",text:this.lp.keyWork,isEdited:!1},workContent:{text:this.lp.workContent,type:"innertext",defaultValue:this.keyworkData.workDescribe||"　"},planContent:{text:this.lp.planContent,type:"textarea",notEmpty:!0,style:{height:"150px"}}}},this.app),this.form.load()}.bind(this),!0)},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.save}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.save(t)}.bind(this))),this.isEdited&&(this.removeAction=new Element("button.inputCancelButton",{styles:this.css.inputCancelButton,text:this.lp.remove}).inject(this.formBottomNode),this.removeAction.addEvent("click",function(t){this.remove(t)}.bind(this))),this.isEdited||this.isNew||!this.getEditPermission()||(this.editAction=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.edit}).inject(this.formBottomNode),this.editAction.addEvent("click",function(t){this.editWork(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},editWork:function(){this.formTopNode=null,this.setFormNodeSizeFun&&this.app&&this.app.removeEvent("resize",this.setFormNodeSizeFun),this.formMaskNode&&this.formMaskNode.destroy(),this.formAreaNode.destroy(),this.edit()},save:function(){var t=this.form.getResult(!0,null,!0,!1,!0);if(t){t.flag||(t.reportId=this.reportData.id,t.workInfoId=this.keyworkData.id,t.keyWorkId=this.keyworkData.keyWorkId,t.flag=this.reportData.flag,t.year=this.reportData.year,t.month=this.reportData.month,t.week=this.reportData.week,t.date=this.reportData.date,t.targetPerson=(layout.desktop.session.user||layout.user).distinguishedName,t.orderNumber=this.options.orderNumber||1),t.workDescribe=t.workContent,t.title=t.workTitle;var e=this.options.isPlanNext?"savePlanNext":"savePlan";this.actions[e](t,function(t){this.app.notice(this.lp.save_success,"success",this.formNode);this.view;this.close(),this.view.reload()}.bind(this))}},remove:function(t){var e=this.view;this.app.common[this.options.isPlanNext?"deletePlanNext":"deletePlan"](this.data,t,function(){e.reload(),this.close()}.bind(this))},loadAttachment:function(t){this.attachment=new MWF.xApplication.Report.Attachment(t,this.app,this.app.restActions,this.lp,{documentId:this.advanceId||this.data.id,isNew:this.isNew,isEdited:this.isEdited,size:"min",onQueryUploadAttachment:function(){this.attachment.isQueryUploadSuccess=!0}.bind(this),onDelete:function(t){}.bind(this)}),this.attachment.load()},getEditPermission:function(){if(!this.options.editedAble)return!1;var t=(layout.desktop.session.user||layout.user).distinguishedName,e=this.view&&this.view.report&&this.view.report.data&&this.view.report.data.targetPerson;return!(t!=this.data.targetPerson&&!this.app.common.isAdmin()&&t!=e)}}),MWF.xApplication.Report.WorkForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:450,minWidth:700,minHeight:320,hasTop:!0,hasIcon:!1,hasTopIcon:!1,hasTopContent:!1,maxAction:!0,hasBottom:!0,draggable:!0,resizeable:!0,editedAble:!0,closeAction:!0},_createTableContent:function(){this.data.progressContent&&"暂无内容"==this.data.progressContent&&(this.data.progressContent=""),this.formTopTextNode.set("text",this.lp.work);this.isEdited||this.isNew;this.formTableArea.set("html","<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '><tr><td styles='formTableTitle' lable='workTitle' width='20%'></td>    <td styles='formTableValue14' colspan='3'>       <div item='workTitle' style=''></div></td></tr><tr><td styles='formTableTitle' lable='progressContent'></td>    <td styles='formTableValue14' item='progressContent' colspan='3'></td></tr></table>"),this.loadForm()},loadForm:function(t){MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{workTitle:{type:"innertext",text:this.lp.keyWork,defaultValue:this.keyworkData.workTitle,isEdited:!1},workContent:{text:this.lp.workContent,type:"innertext",defaultValue:this.keyworkData.workDescribe||"　"},progressContent:{text:this.lp.completion,type:"textarea",notEmpty:!0,style:{height:"150px"}}}},this.app),this.form.load()}.bind(this),!0)},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.save}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.save(t)}.bind(this))),this.isEdited&&(this.removeAction=new Element("button.inputCancelButton",{styles:this.css.inputCancelButton,text:this.lp.remove}).inject(this.formBottomNode),this.removeAction.addEvent("click",function(t){this.remove(t)}.bind(this))),this.isEdited||this.isNew||!this.getEditPermission()||(this.editAction=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.edit}).inject(this.formBottomNode),this.editAction.addEvent("click",function(t){this.editWork(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},editWork:function(){this.formTopNode=null,this.setFormNodeSizeFun&&this.app&&this.app.removeEvent("resize",this.setFormNodeSizeFun),this.formMaskNode&&this.formMaskNode.destroy(),this.formAreaNode.destroy(),this.edit()},save:function(){var t=this.form.getResult(!0,null,!0,!1,!0);t&&(t.flag||(t.reportId=this.reportData.id,t.workInfoId=this.keyworkData.id,t.keyWorkId=this.keyworkData.keyWorkId,t.flag=this.reportData.flag,t.year=this.reportData.year,t.month=this.reportData.month,t.week=this.reportData.week,t.date=this.reportData.date,t.targetPerson=(layout.desktop.session.user||layout.user).distinguishedName,t.orderNumber=this.options.orderNumber||1),t.workDescribe=t.workContent,t.title=t.workTitle,this.actions.saveWork(t,function(t){this.app.notice(this.lp.save_success,"success",this.formNode);this.view;this.close(),this.view.reload()}.bind(this)))},remove:function(t){var e=this.view;this.app.common.deleteWork(this.data,t,function(){e.reload(),this.close()}.bind(this))},loadAttachment:function(t){this.attachment=new MWF.xApplication.Report.Attachment(t,this.app,this.app.restActions,this.lp,{documentId:this.advanceId||this.data.id,isNew:this.isNew,isEdited:this.isEdited,size:"min",onQueryUploadAttachment:function(){this.attachment.isQueryUploadSuccess=!0}.bind(this),onDelete:function(t){}.bind(this)}),this.attachment.load()},getEditPermission:function(){if(!this.options.editedAble)return!1;var t=(layout.desktop.session.user||layout.user).distinguishedName,e=this.view&&this.view.report&&this.view.report.data&&this.view.report.data.targetPerson;return!(t!=this.data.targetPerson&&!this.app.common.isAdmin()&&t!=e)}}),MWF.xApplication.Report.CustomWorkForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:550,hasTop:!0,hasIcon:!1,maxAction:!0,draggable:!0,resizeable:!0,editedAble:!0},_createTableContent:function(){this.data.progressContent&&"暂无内容"==this.data.progressContent&&(this.data.progressContent=""),this.formTopTextNode.set("text",this.lp.work);this.isEdited||this.isNew;this.formTableArea.set("html","<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '><tr><td styles='formTableTitle' lable='workTitle' width='20%'></td>    <td styles='formTableValue14' colspan='3' item='workTitle'></td></tr><tr><td styles='formTableTitle' lable='workDescribe'></td>    <td styles='formTableValue14' item='workDescribe' colspan='3'></td></tr><tr><td styles='formTableTitle' lable='workTag'></td>    <td styles='formTableValue14' item='workTag' colspan='3'></td></tr><tr><td styles='formTableTitle' lable='progressContent'></td>    <td styles='formTableValue14' item='progressContent' colspan='3'></td></tr></table>"),this.loadForm()},loadForm:function(){var t=this;MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{workTitle:{type:"text",text:"工作标题",notEmpty:!0},workDescribe:{type:"textarea",text:this.lp.workContent,notEmpty:!0},workTag:{type:"mselector",text:"工作标签",notEmpty:!0,mSelectorOptions:{defaultOptionLp:"选择或填写标签",inputEnable:!0,valueField:"tagName",width:"500px",onLoadData:function(e){t.actions.listWorkTagWithUnit(t.reportData.targetUnit,function(t){var i=[];(t.data||[]).each((function(t){"部门重点工作"!=t.tagName&&i.push(t)})),e(i)}.bind(this))}}},progressContent:{text:this.lp.completion,type:"textarea",notEmpty:!0,style:{height:"150px"}}}},this.app),this.form.load()}.bind(this),!0)},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.save}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.save(t)}.bind(this))),this.isEdited&&(this.removeAction=new Element("button.inputCancelButton",{styles:this.css.inputCancelButton,text:this.lp.remove}).inject(this.formBottomNode),this.removeAction.addEvent("click",function(t){this.remove(t)}.bind(this))),this.isEdited||this.isNew||!this.getEditPermission()||(this.editAction=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.edit}).inject(this.formBottomNode),this.editAction.addEvent("click",function(t){this.editWork(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},editWork:function(){this.formTopNode=null,this.setFormNodeSizeFun&&this.app&&this.app.removeEvent("resize",this.setFormNodeSizeFun),this.formMaskNode&&this.formMaskNode.destroy(),this.formAreaNode.destroy(),this.edit()},save:function(){var t=this.form.getResult(!0,null,!0,!1,!0);if(t){if("选择或填写标签"==t.workTag||""==t.workTag)return this.app.notice("请选择或填写工作标签","error",this.formTableArea),!1;t.flag||(t.reportId=this.reportData.id,t.flag=this.reportData.flag,t.year=this.reportData.year,t.month=this.reportData.month,t.week=this.reportData.week,t.date=this.reportData.date,t.targetPerson=(layout.desktop.session.user||layout.user).distinguishedName,t.orderNumber=this.options.orderNumber||1),t.keyWorkObject&&delete t.keyWorkObject,this.actions.saveWork(t,function(t){this.app.notice(this.lp.save_success,"success",this.formNode);this.view;this.close(),this.view.reload()}.bind(this))}},remove:function(t){var e=this.view;this.app.common.deleteCustomWork(this.data,t,function(){e.reload(),this.close()}.bind(this))},loadAttachment:function(t){this.attachment=new MWF.xApplication.Report.Attachment(t,this.app,this.app.restActions,this.lp,{documentId:this.advanceId||this.data.id,isNew:this.isNew,isEdited:this.isEdited,size:"min",onQueryUploadAttachment:function(){this.attachment.isQueryUploadSuccess=!0}.bind(this),onDelete:function(t){}.bind(this)}),this.attachment.load()},getEditPermission:function(){if(!this.options.editedAble)return!1;var t=(layout.desktop.session.user||layout.user).distinguishedName,e=this.view&&this.view.report&&this.view.report.data&&this.view.report.data.targetPerson;return!(t!=this.data.targetPerson&&!this.app.common.isAdmin()&&t!=e)}}),MWF.xApplication.Report.ExtWorkForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:450,hasTop:!0,hasIcon:!1,maxAction:!0,draggable:!0,resizeable:!0,editedAble:!0,category:""},_createTableContent:function(){this.formTopTextNode.set("text",this.lp[this.options.category]);this.isEdited||this.isNew;this.formTableArea.set("html","<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '><tr><td styles='formTableTitle' lable='title' width='20%'></td>    <td styles='formTableValue14' colspan='3' item='title'></td></tr><tr><td styles='formTableTitle' lable='content'></td>    <td styles='formTableValue14' item='content' colspan='3'></td></tr></table>"),this.loadForm()},loadForm:function(){MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{title:{type:"innerText",text:"类别",notEmpty:!0,defaultValue:this.lp[this.options.category]},content:{text:"内容",type:"textarea",notEmpty:!0,style:{height:"150px"}}}},this.app),this.form.load()}.bind(this),!0)},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.save}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.save(t)}.bind(this))),this.isEdited&&(this.removeAction=new Element("button.inputCancelButton",{styles:this.css.inputCancelButton,text:this.lp.remove}).inject(this.formBottomNode),this.removeAction.addEvent("click",function(t){this.remove(t)}.bind(this))),this.isEdited||this.isNew||!this.getEditPermission()||(this.editAction=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.edit}).inject(this.formBottomNode),this.editAction.addEvent("click",function(t){this.editWork(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},editWork:function(){this.formTopNode=null,this.setFormNodeSizeFun&&this.app&&this.app.removeEvent("resize",this.setFormNodeSizeFun),this.formMaskNode&&this.formMaskNode.destroy(),this.formAreaNode.destroy(),this.edit()},save:function(){var t=this.form.getResult(!0,null,!0,!1,!0);t&&(t.id||(t.reportId=this.reportData.id,t.category=this.keyworkData.id,t.targetPerson=(layout.desktop.session.user||layout.user).distinguishedName,t.orderNumber=this.options.orderNumber||1),this.actions["save"+this.options.category](t,function(t){this.app.notice(this.lp.save_success,"success",this.formNode);this.view;this.close(),this.view.reload()}.bind(this)))},remove:function(t){var e=this.view;this.app.common.deleteExtWork(this.data,t,function(){e.reload(),this.close()}.bind(this),this.options.category)},loadAttachment:function(t){this.attachment=new MWF.xApplication.Report.Attachment(t,this.app,this.app.restActions,this.lp,{documentId:this.advanceId||this.data.id,isNew:this.isNew,isEdited:this.isEdited,size:"min",onQueryUploadAttachment:function(){this.attachment.isQueryUploadSuccess=!0}.bind(this),onDelete:function(t){}.bind(this)}),this.attachment.load()},getEditPermission:function(){if(!this.options.editedAble)return!1;var t=(layout.desktop.session.user||layout.user).distinguishedName,e=this.view&&this.view.report&&this.view.report.data&&this.view.report.data.targetPerson;return!(t!=this.data.targetPerson&&!this.app.common.isAdmin()&&t!=e)}}),MWF.xApplication.Report.ReportTooltip=new Class({Extends:MTooltips,_loadCustom:function(t){t&&t()},_getHtml:function(){var t=this.data,e=this.lp,i="font-size:14px;color:#333",s="font-size:14px;color:#666;padding-right:20px";return"<div style='overflow: hidden;padding:15px 20px 20px 10px;height:16px;line-height:16px;'>   <div style='font-size: 16px;color:#333;float: left'>"+e[t.reportObjType]+e[t.reportType]+"</div></div><div style='font-size: 16px;color:#333;padding:0px 10px 15px 20px;'>"+t.title+"</div><div style='height:1px;margin:0px 20px;border-bottom:1px solid #ccc;'></div><table width='100%' bordr='0' cellpadding='7' cellspacing='0' style='margin:13px 13px 13px 13px;'><tr><td style='"+i+"' width='100'>管理员:</td>    <td style='"+s+"'>"+(t.targetPerson?t.targetPerson.split("@")[0]:"")+"</td></tr><tr><td style='"+i+"'>"+e.targetUnit+":</td>    <td style='"+s+"'>"+(t.targetUnit?t.targetUnit.split("@")[0]:"")+"</td></tr><tr><td style='"+i+"'>"+e.createDate+":</td>    <td style='"+s+"'>"+t.createDateString+"</td></tr><tr><td style='"+i+"'>"+e.activityName+":</td>    <td style='"+s+"'>"+t.activityName+"</td></tr><tr><td style='"+i+"'>"+e.currentPersonName+":</td>    <td style='"+s+"'>"+(t.currentPersonName?t.currentPersonName.split("@")[0]:"")+"</td></tr></table>"}}),MWF.xApplication.Report.SideBar=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,i){this.setOptions(i),this.container=t,this.app=e,this.lp=this.app.lp,this.isHidden=!1,this.cssPath="../x_component_Report/$Common/"+this.options.style+"/sidebar/css.wcss",this._loadCss(),this.load()},load:function(){this.node=new Element("div.sideBar",{styles:this.css.node,events:{mousedown:function(t){t.stopPropagation()}}}).inject(this.container),this.contentNode=new Element("div",{styles:this.css.contentNode}).inject(this.node),this.loadStatusArea(),new Element("div.contentLine",{styles:this.css.contentLine}).inject(this.contentNode),this.loadWaitDoNode(),this.trapezoid=new Element("div.trapezoid",{styles:this.css.trapezoid_toRight,events:{click:function(){this.trigger()}.bind(this)}}).inject(this.node),this.listData(function(){this.loadWaitDo(function(){var t=this.node.getSize().x-8;this.node.setStyle("right","-"+t+"px"),this.resetNodeSize(),this.resetNodeSizeFun=this.resetNodeSize.bind(this),this.app.addEvent("resize",this.resetNodeSizeFun),this.hideFun=this.hide.bind(this),this.app.node.addEvent("mousedown",this.hideFun)}.bind(this))}.bind(this))},loadStatusArea:function(){var t=new Element("div",{styles:this.css.statusArea}).inject(this.contentNode),e=this.lp.config,i="<div class='titleDiv'>"+e.reportStatus+"</div><div class = 'statusStyle'>   <div class='statusIconStyle' style='background-color:"+e.waitColor+"'></div>   <div class = 'statusTextStyle'>"+e.wait+"</div></div></div><div class = 'statusStyle'>   <div class='statusIconStyle' style='background-color:"+e.auditColor+"'></div>   <div class = 'statusTextStyle'>"+e.audit+"</div></div></div><div class = 'statusStyle'>   <div class='statusIconStyle' style='background-color:"+e.progressColor+"'></div>   <div class = 'statusTextStyle'>"+e.progress+"</div></div></div><div class = 'statusStyle'>   <div  class='statusIconStyle' style='background-color:"+e.completedColor+"'></div>   <div class = 'statusTextStyle'>"+e.completed+"</div></div></div>";t.set("html",i),t.getElements("div.titleDiv").setStyles(this.css.titleDiv),t.getElements("div.statusStyle").setStyles(this.css.statusStyle),t.getElements("div.statusIconStyle").setStyles(this.css.statusIconStyle),t.getElements("div.statusIconStyle2").setStyles(this.css.statusIconStyle2),t.getElements("div.statusTextStyle").setStyles(this.css.statusTextStyle)},loadWaitDoNode:function(){var t=new Element("div.reportArea",{styles:this.css.reportArea}).inject(this.contentNode);new Element("div.titleDiv",{styles:this.css.titleDiv,text:this.lp.reportNotice}).inject(t),this.reportNode=Element("div",{styles:this.css.reportNode}).inject(t)},loadWaitDo:function(t){new Date;var e=layout.desktop.session.user||layout.user,i=(e.distinguishedName,this.data);if(e.distinguishedName)var s=e.distinguishedName.split("@")[0];else s=e.name;var o=i.length?this.lp.reportTopInfor:this.lp.noReportTopInfor;this.reportTopNode=new Element("div",{styles:this.css.reportTopNode,html:o.replace("{userName}",s).replace("{count}",i.length)}).inject(this.reportNode),this.scrollNode=new Element("div.scrollNode",{styles:this.css.scrollNode}).inject(this.reportNode),this.reportItemContainer=new Element("div.reportItemContainer",{styles:this.css.reportItemContainer}).inject(this.scrollNode),i.each(function(t,i){var s=new Element("div.reportItemNode",{styles:this.css.reportItemNode,events:{click:function(){this.obj.app.common.openReport(this.data)}.bind({obj:this,data:t})}}).inject(this.reportItemContainer);this.tooltipList=this.tooltipList||[],this.tooltipList.push(new MWF.xApplication.Report.ReportTooltip(this.app.content,s,this.app,t,{axis:"x",hiddenDelay:300,displayDelay:300}));var o=new Element("div.reportItemColorNode",{styles:this.css.reportItemColorNode,text:i+1}).inject(s),n=(new Element("div.reportItemTextNode",{styles:this.css.reportItemTextNode,text:t.title}).inject(s),this.lp.config);switch("审核中"==t.reportStatus&&e.distinguishedName==t.currentPersonName?"需要我审核":t.reportStatus){case"汇报者填写":o.setStyles({"background-color":n.waitColor});break;case"审核中":o.setStyles({"background-color":n.progressColor});break;case"需要我审核":o.setStyles({"background-color":n.auditColor});break;case"已完成":o.setStyles({"background-color":n.completedColor})}var r=s.getSize().y;o.setStyle("margin-top",(r-20)/2)}.bind(this)),this.setScrollBar(this.scrollNode),t&&t()},listData:function(t){this.app.restActions.listReportNextWithFilter(0,100,{targetList:[this.app.userName],reportStatus:"汇报者填写"},function(e){e.data||(e.data=[]),this.data=e.data,this.app.restActions.listReportNextWithFilter(0,100,{currentPersonList:[this.app.userName],reportStatus:"审核中"},function(e){e.data||(e.data=[]),e.data.each(function(t){this.data.push(t)}.bind(this)),t&&t()}.bind(this))}.bind(this))},trigger:function(){this.isHidden?this.show(!0):this.hide(!0)},hide:function(t){var e=this.node.getSize().x-9;new Fx.Morph(this.node,{duration:"300",transition:Fx.Transitions.Expo.easeOut}).start({}).chain(function(){this.isHidden=!0,this.node.setStyles({right:"-"+e+"px"}),this.trapezoid.setStyles(this.css.trapezoid_toLeft)}.bind(this))},show:function(t){this.node.setStyles(this.css.node),this.trapezoid.setStyles(this.css.trapezoid_toRight);var e=new Fx.Morph(this.node,{duration:"500",transition:Fx.Transitions.Expo.easeOut});this.app.fireAppEvent("resize"),e.start({opacity:1}).chain(function(){this.node.setStyles({right:"0px"}),this.isHidden=!1}.bind(this))},resetNodeSize:function(){var t=this.container.getSize();this.node.setStyle("height",t.y-50),this.trapezoid.setStyle("top",(t.y-50)/2-this.trapezoid.getSize().y/2);var e=t.y-395,i=this.reportItemContainer.getSize().y+12;this.scrollNode.setStyle("height",Math.min(e,i))},getSize:function(){return{x:9,y:0}},showByType:function(t){},reload:function(){this.destory(),this.app.reload()},openReport:function(t){var e=new MWF.xApplication.Report.ReportForm(this,t,{},{app:this.app});e.view=this.app,e.open()},destory:function(){this.tooltipList.each((function(t){t.destory()})),this.app.removeEvent("resize",this.resetNodeSizeFun),this.app.node.removeEvent("mousedown",this.hideFun),this.node.destory()}}),MWF.xApplication.Report.ReportArea=new Class({initialize:function(t,e,i){this.container=t,this.view=e,this.css=this.view.css,this.app=this.view.app,this.data=i,this.beginDate=Date.parse(this.data.startTime),this.endDate=Date.parse(this.data.completedTime),this.userName=(layout.desktop.session.user||layout.user).distinguishedName,this.userId=(layout.desktop.session.user||layout.user).id,this.path="../x_component_Report/$Common/default/reportarea/",this.cssPath="../x_component_Report/$Common/default/reportarea/css.wcss",this._loadCss(),this.load()},load:function(){var t=this.data;this.node=new Element("div",{styles:this.css.reportNode}).inject(this.container),this.node.addEvents({mouseenter:function(){this.node.setStyles(this.css.reportNode_over),this.subjectNode.setStyles(this.css.reportSubjectNode_over)}.bind(this),mouseleave:function(){this.node.setStyles(this.css.reportNode),this.subjectNode.setStyles(this.css.reportSubjectNode)}.bind(this),click:function(){this.openReport()}.bind(this)}),this.colorNode=new Element("div",{styles:this.css.reportColorNode}).inject(this.node),this.contentNode=new Element("div",{styles:this.css.reportContentNode}).inject(this.node),this.subjectNode=new Element("div",{styles:this.css.reportSubjectNode,text:this.data.title}).inject(this.contentNode),this.descriptionNode=new Element("div",{styles:this.css.reportDescriptionNode,text:this.app.lp[t.reportObjType]+this.app.lp[t.reportType]+"　"+(t.currentPersonName?t.currentPersonName.split("@")[0]+"　":"")+t.activityName}).inject(this.contentNode);var e=this.app.lp.config;switch("审核中"==t.reportStatus&&this.app.userName==t.currentPersonName?"需要我审核":t.reportStatus){case"汇报者填写":this.colorNode.setStyles({"background-color":e.waitColor});break;case"审核中":this.colorNode.setStyles({"background-color":e.progressColor});break;case"需要我审核":this.colorNode.setStyles({"background-color":e.auditColor});break;case"已完成":this.colorNode.setStyles({"background-color":e.completedColor})}this.resetNodeSize(),this.loadTooltip()},getString:function(t){var e="00"+t;return e.substr(e.length-2,2)},_loadCss:function(){var t=encodeURIComponent(this.cssPath);MWF.widget.css[t]?this.css=MWF.widget.css[t]:new Request.JSON({url:this.cssPath,secure:!1,async:!1,method:"get",noCache:!1,onSuccess:function(e,i){this.css=e,MWF.widget.css[t]=e}.bind(this),onError:function(t,e){alert(e+t)}}).send()},loadTooltip:function(t){this.tooltip=new MWF.xApplication.Report.ReportTooltip(this.app.content,this.node,this.app,this.data,{axis:"x",hiddenDelay:300,displayDelay:300,isHideAttachment:t})},openReport:function(){this.app.common.openReport(this.data,this.view)},resetNodeSize:function(){var t=this.contentNode.getSize();this.colorNode.setStyle("height",t.y)},destroy:function(){this.tooltip&&this.tooltip.destroy(),this.node.destroy(),MWF.release(this)}}),MWF.xApplication.Report.KeyWorkTooltip=new Class({Extends:MTooltips,_loadCustom:function(t){t&&t()},_getHtml:function(){var t=this.data,e=this.lp.keyWorkList.popupForm,i="font-size:14px;color:#333;",s="font-size:14px;color:#666;padding-right:20px",o=[];return t.deptlist&&t.deptlist.each((function(t){o.push(t.split("@")[0])})),"<div style='overflow: hidden;padding:15px 20px 20px 10px;height:16px;line-height:16px;'>   <div style='font-size: 16px;color:#333;float: left'>"+this.lp.keyWorkList.name+"</div></div><div style='font-size: 16px;color:#333;padding:0px 10px 15px 20px;'>"+t.strategydeploytitle+"</div><div style='height:1px;margin:0px 20px;border-bottom:1px solid #ccc;'></div><table width='100%' bordr='0' cellpadding='7' cellspacing='0' style='margin:13px 13px 13px 13px;'><tr><td style='"+i+"' width='80'>"+e.sequencenumber+":</td>    <td style='"+s+"'>"+t.sequencenumber+"</td></tr><tr><td style='"+i+"'>"+e.year+":</td>    <td style='"+s+"'>"+t.strategydeployyear+"</td></tr><tr style='display: "+(o.length?"":"none")+"'><td style='"+i+"'>"+e.department+":</td>    <td style='"+s+"'>"+o.join("  ")+"</td></tr><tr><td style='"+i+"'>"+e.description+":</td>    <td style='"+s+"'>"+t.strategydeploydescribe+"</td></tr></table>"}}),MWF.xApplication.Report.MeasureTooltip=new Class({Extends:MTooltips,_loadCustom:function(t){var e=this.data,i=this.lp.measure.popupForm,s=[];e.deptlist.each((function(t){s.push(t.split("@")[0])}));var o=new Element("table",{width:"100%",border:"0",cellpadding:"5",cellspacing:"0",styles:this.css.formTable}).inject(this.contentNode),n=new Element("tr").inject(o);new Element("td",{text:"举措",width:"70",styles:this.css.formTableTitle}).inject(n);new Element("td",{styles:this.css.formTableValue,text:e.measuresinfotitle}).inject(n);n=new Element("tr").inject(o),new Element("td",{text:i.sequencenumber,width:"70",styles:this.css.formTableTitle}).inject(n);new Element("td",{styles:this.css.formTableValue,text:e.sequencenumber}).inject(n);n=new Element("tr").inject(o),new Element("td",{text:i.year,width:"70",styles:this.css.formTableTitle}).inject(n);new Element("td",{styles:this.css.formTableValue,text:e.measuresinfoyear}).inject(n);n=new Element("tr").inject(o),new Element("td",{text:i.department,width:"70",styles:this.css.formTableTitle}).inject(n);new Element("td",{styles:this.css.formTableValue,text:s.join("  ")}).inject(n);n=new Element("tr").inject(o),new Element("td",{text:i.description,width:"70",styles:this.css.formTableTitle}).inject(n);new Element("td",{styles:this.css.formTableValue,text:e.measuresinfodescribe}).inject(n);t&&t()},setContent:function(){},_getHtml:function(){}}),MWF.xApplication.Report.PriorityTooltip=new Class({Extends:MTooltips,_loadCustom:function(t){this.data.keyWorkId?this.app.strategyActions.getPriorityById(this.data.keyWorkId,function(e){this.priorityData=e.data,this.setContent(),t&&t()}.bind(this)):t&&t()},setContent:function(){this.contentNode.set("html",this._getHtml())},_getHtml:function(){if(this.priorityData||!this.data.keyWorkId){var t=this.priorityData||this.data,e=this.lp.priority.popupForm,i="font-size:14px;color:#333",s="font-size:14px;color:#666;padding-right:20px";return"<div style='overflow: hidden;padding:15px 20px 20px 10px;height:16px;line-height:16px;'>   <div style='font-size: 16px;color:#333;float: left'>"+this.lp.priority.name+"</div></div><div style='font-size: 16px;color:#333;padding:0px 10px 15px 20px;'>"+t.keyworktitle+"</div><div style='height:1px;margin:0px 20px;border-bottom:1px solid #ccc;'></div><table width='100%' bordr='0' cellpadding='7' cellspacing='0' style='margin:13px 13px 13px 13px;'><tr><td style='"+i+"' width='80'>"+e.sequencenumber+":</td>    <td style='"+s+"'>"+t.sequencenumber+"</td></tr><tr><td style='"+i+"'>"+e.year+":</td>    <td style='"+s+"'>"+t.keyworkyear+"</td></tr><tr><td style='"+i+"'>"+e.validDate+":</td>    <td style='"+s+"'>"+t.keyworkbegindate+" "+e.validDateConnect+" "+t.keyworkenddate+"</td></tr><tr><td style='"+i+"'>"+e.department+":</td>    <td style='"+s+"'>"+(t.keyworkunit?t.keyworkunit.split("@")[0]:"")+"</td></tr><tr><td style='"+i+"'>"+e.description+":</td>    <td style='"+s+"'>"+t.keyworkdescribe+"</td></tr></table>"}}}),MWF.xApplication.Report.ShowMeasureTooltip=new Class({Extends:MTooltips,options:{overflow:"scroll",nextMonth:!1},_loadCustom:function(t){var e=this.data,i=new Element("div",{}).inject(this.contentNode),s={};((this.options.nextMonth?e.nextMonth_selectableMeasures:e.selectableMeasures)||[]).each(function(t){s[t.id]=t}.bind(this)),this.measuresList.each(function(t){var e=s[t];if(e){var o=new Element("table",{width:"100%",border:"0",cellpadding:"5",cellspacing:"0",styles:this.css.formTable}).inject(i),n=new Element("tr").inject(o);new Element("td",{text:"举措",width:"70",styles:this.css.formTableTitle}).inject(n),new Element("td",{text:e.measuresinfotitle,styles:this.css.formTableValue}).inject(n),n=new Element("tr").inject(o),new Element("td",{text:"内容",styles:this.css.formTableTitle}).inject(n),new Element("td",{text:e.measuresinfodescribe,styles:this.css.formTableValue}).inject(n)}}.bind(this)),t&&t()}}),MWF.xApplication.Report.SelectMeasureTooltips=new Class({Extends:MTooltips,options:{overflow:"scroll"},_loadCustom:function(t){var e=this.data,i=new Element("div",{}).inject(this.contentNode);i.setStyle("padding-bottom","10px"),(e.nextMonth_selectableMeasures||[]).each(function(t){var e=new Element("table",{width:"100%",border:"0",cellpadding:"5",cellspacing:"0",styles:this.css.formTable}).inject(i),s=new Element("tr").inject(e);s=new Element("tr").inject(e),new Element("td",{text:"举措",width:"70",styles:this.css.formTableTitle}).inject(s);var o=new Element("td",{styles:this.css.formTableValue}).inject(s),n=new Element("table",{width:"100%",border:"0",cellpadding:"0",cellspacing:"0"}).inject(o),r=new Element("tr").inject(n),a=new Element("td",{width:"30"}).inject(r);new Element("input",{type:"checkbox","data-id":t.id,checked:this.measuresList.contains(t.id)}).inject(a).addEvent("click",function(){var t=[];this.contentNode.getElements("input[type='checkbox']").each(function(e){e.get("checked")&&t.push(e.get("data-id"))}.bind(this));var e=[];(this.data.nextMonth_selectableMeasures||[]).each(function(i){t.contains(i.id)&&e.push(i)}.bind(this)),this.fireEvent("select",[e,t])}.bind(this));a=new Element("td").inject(r);new Element("div",{text:t.measuresinfotitle}).inject(a),s=new Element("tr").inject(e),new Element("td",{text:"内容",styles:this.css.formTableTitle}).inject(s),new Element("td",{text:t.measuresinfodescribe,styles:this.css.formTableValue}).inject(s)}.bind(this)),t&&t()}}),MWF.xApplication.Report.SelectMeasureForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:450,minWidth:700,minHeight:300,hasTop:!0,hasIcon:!1,hasTopIcon:!1,hasTopContent:!1,maxAction:!0,hasBottom:!0,draggable:!0,resizeable:!0,editedAble:!0,closeAction:!0},_createTableContent:function(){var t=this.data;this.formTopTextNode.set("text","选择举措");var e=new Element("div",{styles:{overflow:"hidden",padding:"10px",margin:"20px 20px"}}).inject(this.formTableArea),i=new Element("div",{styles:this.css.measureDeployNode}).inject(e),s=[],o=[],n={};t.selectableMeasures.each(function(t){s.push(t.id),o.push(t.measuresinfotitle),n[t.id]=t}.bind(this)),this.item=new MDomItem(i,{name:"measures",type:"checkbox",selectValue:s,selectText:o,value:t.measuresList,style:{overflow:"hidden"},onPostLoad:function(t){t.items.each(function(t){var e=new Element("span",{styles:this.css.measureIconNode}).inject(t,"top"),i=t.getElement("input[type='checkbox']").get("value");this.loadMeasureTooltip(e,i);var s=n[i];new Element("div",{styles:this.css.measuresDescribeNode,text:"工作内容："+s.measuresinfodescribe}).inject(t,"after")}.bind(this))}.bind(this)},null,this.app,this.css),this.item.load()},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:"确定"}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.save(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},loadMeasureTooltip:function(t,e){new MWF.xApplication.Report.MeasureTooltip(this.app.content,t,this.app,null,{position:{x:"right",y:"auto"},measureId:e,displayDelay:300})},save:function(){var t=[],e=this.item.getValue();this.data.selectableMeasures.each(function(i){e.contains(i.id)&&t.push(i)}.bind(this)),this.fireEvent("postOk",[t,e]),this.close()}}),MWF.xApplication.Report.StatisticsForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:800,height:450,hasTop:!0,hasIcon:!1,maxAction:!0,draggable:!0,resizeable:!0,editedAble:!0,category:""},_createTableContent:function(){this.lp={ok:"导出",close:"取消"},this.formTopTextNode.set("text","导出");this.isEdited||this.isNew;this.formTableArea.setStyle("margin-top","20px");var t="";(this.app.common.isAdmin()||this.app.exportAllFlag)&&(t="<tr><td styles='formTableTitleP14' lable='allUnit'></td>    <td styles='formTableValueP14' item='allUnit' ></td></tr>");var e="<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable'><tr><td styles='formTableTitleP14' lable='year' width='20%'></td>    <td styles='formTableValueP14' item='year'></td></tr><tr><td styles='formTableTitleP14' lable='month'></td>    <td styles='formTableValueP14' item='month' ></td></tr><tr><td styles='formTableTitleP14' lable='wfProcessStatus'></td>    <td styles='formTableValueP14' item='wfProcessStatus' ></td></tr><tr><td styles='formTableTitleP14' lable='unitList'></td>    <td styles='formTableValueP14' item='unitList' ></td></tr>"+t+"</table>";this.formTableArea.set("html",e),this.loadForm()},loadForm:function(){MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{year:{type:"select",notEmpty:!0,text:"年度",selectText:function(){var t=[],e=new Date;e.decrement("year",5);for(var i=0;i<11;i++)e.increment("year",1),t.push(e.getFullYear()+"年");return t},selectValue:function(){var t=[],e=new Date;e.decrement("year",5);for(var i=0;i<11;i++)e.increment("year",1),t.push(e.getFullYear().toString());return t},defaultValue:(new Date).getFullYear().toString(),event:{change:function(){this.listUnitNamesForReport()}.bind(this)}},month:{type:"select",notEmpty:!0,text:"月份",selectText:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],selectValue:["01","02","03","04","05","06","07","08","09","10","11","12"],defaultValue:(new Date).format("%m").toString(),event:{change:function(){this.listUnitNamesForReport()}.bind(this)}},unitList:{type:"checkbox",notEmpty:!0,text:"部门"},wfProcessStatus:{type:"select",text:"审批状态",selectText:["全部","已完成","流转中"],selectValue:["","已完成","流转中"],event:{change:function(){this.listUnitNamesForReport()}.bind(this)}},allUnit:{type:"checkbox",text:"所有部门",selectValue:["yes"],selectText:["是"],event:{change:function(t,e){"yes"==t.getValue().join()?this.form.getItem("unitList").setValue(this.allUnitList):this.form.getItem("unitList").setValue("")}.bind(this)}}}},this.app),this.form.load(),this.listUnitNamesForReport((new Date).getFullYear().toString(),(new Date).format("%m").toString())}.bind(this),!0)},listUnitNamesForReport:function(t,e,i){var s=this.formTableArea.getElement("[item='unitList']");this.nounitListNode&&this.nounitListNode.destroy(),t||(t=this.form.getItem("year").getValue()),e||(e=this.form.getItem("month").getValue()),i||(i=this.form.getItem("wfProcessStatus").getValue()),this.app.restActions.listUnitNamesForReport({year:t,month:e,wfProcessStatus:i?[i]:null},function(i){var o=this.allUnitList=[],n=[],r=i.data||[];if(this.app.exportAllFlag?r.each((function(t){o.push(t.value),n.push(t.value.split("@")[0])})):r.each(function(t){this.app.unitWithExport.contains(t.value)&&(o.push(t.value),n.push(t.value.split("@")[0]))}.bind(this)),0==o.length){this.form.getItem("unitList").disable(),this.nounitListNode=new Element("div",{text:"系统未找"+t+"年"+e+"月"+this.form.getItem("wfProcessStatus").getValue()+"的工作汇报"}).inject(s),(a=this.form.getItem("allUnit"))&&a.setValue("")}else{this.nounitListNode&&this.nounitListNode.destroy();var a,l=this.form.getItem("unitList");l.resetItemOptions(o,n,!0),l.setValue(this.allUnitList),(a=this.form.getItem("allUnit"))&&a.setValue("yes")}}.bind(this),null,!1)},_createBottomContent:function(){(this.isNew||this.isEdited)&&(this.okActionNode=new Element("button.inputOkButton",{styles:this.css.inputOkButton,text:this.lp.ok}).inject(this.formBottomNode),this.okActionNode.addEvent("click",function(t){this.export(t)}.bind(this))),this.cancelActionNode=new Element("button.inputCancelButton",{styles:this.isEdited||this.isNew||this.getEditPermission()?this.css.inputCancelButton:this.css.inputCancelButton_long,text:this.lp.close}).inject(this.formBottomNode),this.cancelActionNode.addEvent("click",function(t){this.close(t)}.bind(this))},export:function(){var t=this.form.getResult(!0,null,!0,!1,!0);t&&(t.wfProcessStatus=t.wfProcessStatus?[t.wfProcessStatus]:null,t.unitList=t.unitList||null,this.app.restActions.statByUnit(t,function(t){t.data&&t.data.id?this.app.restActions.getExportFileStream(t.data.id):this.app.notice("系统中未找到指定条件的数据","error")}.bind(this)))}}),MWF.xApplication.Report.SummarizationForm=new Class({Extends:MPopupForm,Implements:[Options,Events],options:{style:"report",width:"80%",height:"90%",hasTop:!0,hasBottom:!1,hasIcon:!1,maxAction:!0,draggable:!0,resizeable:!0,editedAble:!0,category:""},createContent:function(){this.tableContainer=new Element("div.formTabContainer",{styles:{"padding-top":"10px",margin:"0px auto 20px",width:"90%"}}).inject(this.formNode),this.formContentNode=new Element("div.formContentNode",{styles:this.css.formContentNode}).inject(this.formNode),this.formTableContainer=new Element("div.formTableContainer",{styles:this.css.formTableContainer}).inject(this.formContentNode),this.formTableArea=new Element("div.formTableArea",{styles:this.css.formTableArea}).inject(this.formTableContainer),this._createTableContent()},_createTableContent:function(){this.lp={ok:"查询",close:"取消"},this.formTopTextNode.set("text","部门五项重点工作统览");this.isEdited||this.isNew;this.formTableArea.setStyle("margin-top","20px"),this.formTableContainer.setStyle("width","90%");this.tableContainer.set("html","<table width='96%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable'><tr><td styles='formTableTitleP14' lable='year'></td>    <td styles='formTableValueP14' item='year'></td>    <td styles='formTableTitleP14' lable='month'></td>    <td styles='formTableValueP14' item='month' ></td>   <td styles='formTableTitleP14' lable='wfProcessStatus'></td>    <td styles='formTableValueP14' item='wfProcessStatus' ></td>    <td styles='formTableValueP14' item='ok' style='width: 80px;'></td></tr></table>"),this.loadForm()},loadForm:function(){MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.tableContainer,this.data,{usesNewVersion:!0,isEdited:this.isEdited||this.isNew,style:"report",hasColon:!0,itemTemplate:{year:{type:"select",notEmpty:!0,text:"年度",selectText:function(){var t=[],e=new Date;e.decrement("year",5);for(var i=0;i<11;i++)e.increment("year",1),t.push(e.getFullYear()+"年");return t},selectValue:function(){var t=[],e=new Date;e.decrement("year",5);for(var i=0;i<11;i++)e.increment("year",1),t.push(e.getFullYear().toString());return t},defaultValue:(new Date).getFullYear().toString()},month:{type:"select",text:"月份",selectText:["全年","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],selectValue:["","01","02","03","04","05","06","07","08","09","10","11","12"]},unitList:{type:"checkbox",text:"部门"},ok:{type:"button",text:"查询",value:"查询",event:{click:function(){this.ok()}.bind(this)}},wfProcessStatus:{type:"select",text:"审批状态",selectText:["全部","已完成","流转中"],selectValue:["","已完成","流转中"]}}},this.app),this.form.load(),this.ok()}.bind(this),!0)},ok:function(){var t=this.form.getResult(!0,null,!0,!1,!0);t.wfProcessStatus=t.wfProcessStatus?[t.wfProcessStatus]:null,this.app.exportAllFlag||(t.unitList=this.app.unitWithExport),this.formTableArea.empty(),this.app.restActions.listWorkInfoByYear(t.year,t,function(t){var e=new Element("table",{width:"96%",border:"0",cellpadding:"5",cellspacing:"0",styles:this.form.css.formTable}).inject(this.formTableArea),i=new Element("tr").inject(e),s=new Element("th",{styles:this.form.css.formTableTitleP14,text:"部门"}).inject(i);s=new Element("th",{styles:this.form.css.formTableTitleP14,text:"月份"}).inject(i),s=new Element("th",{styles:this.form.css.formTableTitleP14,text:"重点工作"}).inject(i);t.data.each(function(t,o){i=new Element("tr").inject(e);var n=0,r=s=new Element("td",{styles:this.form.css.formTableValueP14,text:t.unitName.split("@")[0]+"("+t.workTotal+")"}).inject(i);if(s.setStyle("text-align","center"),t.workMonths){var a=!1;t.workMonths.each(function(t,o){if(t.workInfoList){a?i=new Element("tr").inject(e):a=!0;var r=0,l=s=new Element("td",{styles:this.form.css.formTableValueP14,text:parseInt(t.month)+"月"}).inject(i);s.setStyle("text-align","center"),t.workInfoList.each(function(t,s){n+=1,r+=1,0!=s&&(i=new Element("tr").inject(e));new Element("td",{styles:this.form.css.formTableValueP14,text:t.workName||"未设置"}).inject(i)}.bind(this)),l.set("rowspan",r)}}.bind(this))}r.set("rowspan",n)}.bind(this))}.bind(this))},setFormNodeSize:function(t,e,i,s){t||(t=this.options.width?this.options.width:"50%"),e||(e=this.options.height?this.options.height:"50%"),i||(i=this.options.top?this.options.top:0),s||(s=this.options.left?this.options.left:0);var o=this.container.getSize();o.x<t&&(t=o.x),o.y<e&&(e=o.y);var n=this.app.content.getSize(),r=n.x,a=n.y;"string"==typeof t&&1<t.length&&"%"==t.substr(t.length-1,1)&&(t=parseInt(r*parseInt(t,10)/100,10)),"string"==typeof e&&1<e.length&&"%"==e.substr(e.length-1,1)&&(e=parseInt(a*parseInt(e,10)/100,10)),300>t&&(t=300),220>e&&(e=220),i=i||parseInt((a-e)/2,10),s=s||parseInt((r-t)/2,10),this.formAreaNode.setStyles({width:t+"px",height:e+"px",top:i+"px",left:s+"px"}),this.formNode.setStyles({width:t+"px",height:e+"px"});var l=this.formIconNode?this.formIconNode.getSize():{x:0,y:0},d=this.formTopNode?this.formTopNode.getSize():{x:0,y:0},h=this.formBottomNode?this.formBottomNode.getSize():{x:0,y:0},p=this.tableContainer?this.tableContainer.getSize():{x:0,y:0},c=e-l.y-d.y-h.y-p.y-30;this.formContentNode.setStyles({height:c+"px"}),this.formTableContainer.setStyles({height:c+"px"})}});