| 1 |
- MWF.xApplication.Execution=MWF.xApplication.Execution||{};MWF.xDesktop.requireApp("Template","Explorer",null,false);MWF.require("MWF.widget.Identity",null,false);MWF.xApplication.Execution.SettingExplorer=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,i,n){this.setOptions(n);this.app=e;this.lp=e.lp;this.path="/x_component_Execution/$SettingExplorer/";this.loadCss();this.actions=i;this.node=$(t)},loadCss:function(){this.cssPath="/x_component_Execution/$SettingExplorer/"+this.options.style+"/css.wcss";this._loadCss()},load:function(){this.middleContent=this.app.middleContent;this.createNaviContent();this.createContentDiv();this.resizeWindow();this.app.addEvent("resize",function(){this.resizeWindow()}.bind(this))},resizeWindow:function(){var t=this.app.middleContent.getSize();this.naviDiv.setStyles({height:t.y-40+"px"});this.naviContentDiv.setStyles({height:t.y-180+"px"});this.contentDiv.setStyles({height:t.y-40+"px"})},createNaviContent:function(){this.naviDiv=new Element("div.naviDiv",{styles:this.css.naviDiv}).inject(this.middleContent);this.naviTitleDiv=new Element("div.naviTitleDiv",{styles:this.css.naviTitleDiv,text:this.lp.systemSetting}).inject(this.naviDiv);this.naviContentDiv=new Element("div.naviContentDiv",{styles:this.css.naviContentDiv}).inject(this.naviDiv);this.naviBottomDiv=new Element("div.naviBottomDiv",{styles:this.css.naviBottomDiv}).inject(this.naviDiv);var t=this.path+"navi.json";MWF.getJSON(t,function(t){t.each(function(t,e){var i=new Element("li.naviContentLi",{styles:this.css.naviContentLi}).inject(this.naviContentDiv);i.addEvents({mouseover:function(t){if(this.bindObj.currentNaviItem!=this.node)this.node.setStyles(this.styles)}.bind({styles:this.css.naviContentLi_over,node:i,bindObj:this}),mouseout:function(t){if(this.bindObj.currentNaviItem!=this.node)this.node.setStyles(this.styles)}.bind({styles:this.css.naviContentLi,node:i,bindObj:this}),click:function(t){if(this.bindObj.currentNaviItem)this.bindObj.currentNaviItem.setStyles(this.bindObj.css.naviContentLi);this.node.setStyles(this.styles);this.bindObj.currentNaviItem=this.node;if(this.action&&this.bindObj[this.action])this.bindObj[this.action]()}.bind({styles:this.css.naviContentLi_current,node:i,bindObj:this,action:t.action})});var n=new Element("img.naviContentImg",{styles:this.css.naviContentImg,src:"/x_component_Execution/$Main/"+this.options.style+"/icon/"+t.icon}).inject(i);var s=new Element("span.naviContentSpan",{styles:this.css.naviContentSpan,text:t.title}).inject(i);if(e==0)i.click()}.bind(this))}.bind(this))},createContentDiv:function(){this.contentDiv=new Element("div.contentDiv",{styles:this.css.contentDiv}).inject(this.middleContent)},openSystemConfig:function(){if(this.contentDiv)this.contentDiv.empty();if(this.explorer){this.explorer.destroy();delete this.explorer}this.explorer=new MWF.xApplication.Execution.SettingExplorer.SystemConfigExplorer(this.contentDiv,this.app,this,{style:this.options.style});this.explorer.load()},openSecretarySetting:function(){if(this.contentDiv)this.contentDiv.empty();if(this.explorer){this.explorer.destroy();delete this.explorer}this.explorer=new MWF.xApplication.Execution.SettingExplorer.SecretarySettingExplorer(this.contentDiv,this.app,this,{style:this.options.style});this.explorer.load()},openCategorySetting:function(){if(this.contentDiv)this.contentDiv.empty();if(this.explorer){this.explorer.destroy();delete this.explorer}this.explorer=new MWF.xApplication.Execution.SettingExplorer.CategorySettingExplorer(this.contentDiv,this.app,this,{style:this.options.style});this.explorer.load()}});MWF.xApplication.Execution.SettingExplorer.SystemConfigExplorer=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,i,n){this.container=t;this.parent=i;this.app=e;this.css=this.parent.css;this.lp=this.app.lp},load:function(){this.container.empty();this.loadView()},destroy:function(){if(this.resizeWindowFun)this.app.removeEvent("resize",this.resizeWindowFun);this.view.destroy()},loadToolbar:function(){this.toolbar=new Element("div",{styles:this.css.toolbar}).inject(this.container);this.createActionNode=new Element("div",{styles:this.css.toolbarActionNode,text:this.lp.createConfig}).inject(this.toolbar);this.createActionNode.addEvent("click",function(){var t=new MWF.xApplication.Execution.SettingExplorer.SystemConfigForm(this,{},{onPostOk:function(){this.view.reload()}.bind(this)});t.create()}.bind(this));this.fileterNode=new Element("div",{styles:this.css.fileterNode}).inject(this.toolbar)},loadView:function(){this.viewContainer=Element("div",{styles:this.css.viewContainer}).inject(this.container);this.resizeWindow();this.resizeWindowFun=this.resizeWindow.bind(this);this.app.addEvent("resize",this.resizeWindowFun);this.view=new MWF.xApplication.Execution.SettingExplorer.SystemConfigView(this.viewContainer,this.app,this,{templateUrl:this.parent.path+"listItem_config.json",scrollEnable:true});this.view.load()},resizeWindow:function(){var t=this.app.content.getSize();this.viewContainer.setStyles({height:t.y-65+"px"})}});MWF.xApplication.Execution.SettingExplorer.SystemConfigView=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexView,_createDocument:function(t){return new MWF.xApplication.Execution.SettingExplorer.SystemConfigDocument(this.viewNode,t,this.explorer,this)},_getCurrentPageData:function(t,e){if(!e)e=20;this.actions.listConfigAll(function(e){if(t)t(e)}.bind(this))},_removeDocument:function(t,e){this.actions.deleteConfig(t.id,function(t){this.reload();this.app.notice(this.app.lp.deleteDocumentOK,"success")}.bind(this))},_create:function(){},_openDocument:function(t){var e=new MWF.xApplication.Execution.SettingExplorer.SystemConfigForm(this,t,{onPostOk:function(){this.reload()}.bind(this)});e.edit()},_queryCreateViewNode:function(){},_postCreateViewNode:function(t){},_queryCreateViewHead:function(){},_postCreateViewHead:function(t){}});MWF.xApplication.Execution.SettingExplorer.SystemConfigDocument=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexDocument,_queryCreateDocumentNode:function(t){},_postCreateDocumentNode:function(t,e){}});MWF.xApplication.Execution.SettingExplorer.SystemConfigForm=new Class({Extends:MWF.xApplication.Template.Explorer.PopupForm,Implements:[Options,Events],options:{style:"default",width:"600",height:"290",hasTop:true,hasIcon:false,hasTopIcon:true,hasTopContent:true,hasBottom:true,title:MWF.xApplication.Execution.LP.categoryFormTitle,draggable:true,closeAction:true},_createTableContent:function(){var t="<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+"<tr><td styles='formTableTitle' lable='configName' width='20%'></td>"+" <td styles='formTableValue' item='configName' width='80%'></td></tr>"+"<tr><td styles='formTableTitle' lable='configValue'></td>"+" <td styles='formTableValue' item='configValue'></td></tr>"+"<tr><td styles='formTableTitle' lable='orderNumber'></td>"+" <td styles='formTableValue' item='orderNumber'></td></tr>"+"<tr><td styles='formTableTitle' lable='description'></td>"+" <td styles='formTableValue' item='description'></td></tr>"+"</table>";this.formTableArea.set("html",t);var e={text:this.lp.configValue};e.tType=this.data.valueType;if(e.tType=="select"){e.type="select";e.selectValue=this.data.selectContent.split("|")}else if(e.tType=="identity"){if(this.data.isMultiple){e.count=0}}else{}MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{style:"execution",isEdited:this.isEdited||this.isNew,itemTemplate:{configName:{text:this.lp.configName,type:"innerText"},configValue:e,orderNumber:{text:this.lp.orderNumber,type:"innerText"},description:{text:this.lp.description,type:"innerText"}}},this.app);this.form.load()}.bind(this),true)},_ok:function(t,e){this.app.restActions.saveConfig(t,function(t){if(e)e(t);this.fireEvent("postOk")}.bind(this))}});MWF.xApplication.Execution.SettingExplorer.SecretarySettingExplorer=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,i,n){this.container=t;this.parent=i;this.app=e;this.css=this.parent.css;this.lp=this.app.lp},load:function(){this.container.empty();this.loadToolbar();this.loadView()},destroy:function(){if(this.resizeWindowFun)this.app.removeEvent("resize",this.resizeWindowFun);this.view.destroy()},loadToolbar:function(){this.toolbar=new Element("div",{styles:this.css.toolbar}).inject(this.container);this.createActionNode=new Element("div",{styles:this.css.toolbarActionNode,text:this.lp.createSecretary}).inject(this.toolbar);this.createActionNode.addEvent("click",function(){var t=new MWF.xApplication.Execution.SettingExplorer.SecretarySettingForm(this,{},{onPostOk:function(){this.view.reload()}.bind(this)});t.create()}.bind(this));this.fileterNode=new Element("div",{styles:this.css.fileterNode}).inject(this.toolbar)},loadView:function(){this.viewContainer=Element("div",{styles:this.css.viewContainer}).inject(this.container);this.resizeWindow();this.resizeWindowFun=this.resizeWindow.bind(this);this.app.addEvent("resize",this.resizeWindowFun);this.view=new MWF.xApplication.Execution.SettingExplorer.SecretarySettingView(this.viewContainer,this.app,this,{templateUrl:this.parent.path+"listItem_secretary.json",scrollEnable:true});this.view.load()},resizeWindow:function(){var t=this.app.content.getSize();this.viewContainer.setStyles({height:t.y-121+"px"})}});MWF.xApplication.Execution.SettingExplorer.SecretarySettingView=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexView,_createDocument:function(t){return new MWF.xApplication.Execution.SettingExplorer.SecretarySettingDocument(this.viewNode,t,this.explorer,this)},_getCurrentPageData:function(t,e){if(!e)e=20;var i=this.items.length?this.items[this.items.length-1].data.id:"(0)";var n=this.filterData||{};this.actions.listSecretaryNext(i,e,n,function(e){if(t)t(e)}.bind(this))},_removeDocument:function(t,e){this.actions.deleteSecretary(t.id,function(t){this.reload();this.app.notice(this.app.lp.deleteDocumentOK,"success")}.bind(this))},_create:function(){},_openDocument:function(t){var e=new MWF.xApplication.Execution.SettingExplorer.SecretarySettingForm(this,t,{onPostOk:function(){this.reload()}.bind(this)});e.edit()},_queryCreateViewNode:function(){},_postCreateViewNode:function(t){},_queryCreateViewHead:function(){},_postCreateViewHead:function(t){}});MWF.xApplication.Execution.SettingExplorer.SecretarySettingDocument=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexDocument,_queryCreateDocumentNode:function(t){},_postCreateDocumentNode:function(t,e){}});MWF.xApplication.Execution.SettingExplorer.SecretarySettingForm=new Class({Extends:MWF.xApplication.Template.Explorer.PopupForm,Implements:[Options,Events],options:{style:"default",width:"600",height:"260",hasTop:true,hasIcon:false,hasTopIcon:true,hasTopContent:true,hasBottom:true,title:MWF.xApplication.Execution.LP.secretaryFormTitle,draggable:true,closeAction:true},_createTableContent:function(){var t="<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+"<tr><td styles='formTableTitle' lable='secretaryName'></td>"+" <td styles='formTableValue' item='secretaryName'></td></tr>"+"<tr><td styles='formTableTitle' lable='leaderIdentity'></td>"+" <td styles='formTableValue' item='leaderIdentity'></td></tr>"+"<tr><td styles='formTableTitle' lable='description'></td>"+" <td styles='formTableValue' item='description'></td></tr>"+"</table>";this.formTableArea.set("html",t);MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{style:"execution",isEdited:this.isEdited||this.isNew,itemTemplate:{secretaryName:{text:this.lp.secretaryName,tType:"person",notEmpty:true},leaderIdentity:{text:this.lp.leaderIdentity,tType:"identity",notEmpty:true},description:{text:this.lp.description,type:"textarea"}}},this.app);this.form.load()}.bind(this),true)},_ok:function(t,e){this.app.restActions.saveSecretary(t,function(t){if(e)e(t);this.fireEvent("postOk")}.bind(this))}});MWF.xApplication.Execution.SettingExplorer.CategorySettingExplorer=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,i,n){this.container=t;this.parent=i;this.app=e;this.css=this.parent.css;this.lp=this.app.lp},load:function(){this.container.empty();this.loadToolbar();this.loadView()},destroy:function(){if(this.resizeWindowFun)this.app.removeEvent("resize",this.resizeWindowFun);this.view.destroy()},loadToolbar:function(){this.toolbar=new Element("div",{styles:this.css.toolbar}).inject(this.container);this.createActionNode=new Element("div",{styles:this.css.toolbarActionNode,text:this.lp.createCategory}).inject(this.toolbar);this.createActionNode.addEvent("click",function(){var t=new MWF.xApplication.Execution.SettingExplorer.CategorySettingForm(this,{},{onPostOk:function(){this.view.reload()}.bind(this)});t.create()}.bind(this));this.fileterNode=new Element("div",{styles:this.css.fileterNode}).inject(this.toolbar)},loadView:function(){this.viewContainer=Element("div",{styles:this.css.viewContainer}).inject(this.container);this.resizeWindow();this.resizeWindowFun=this.resizeWindow.bind(this);this.app.addEvent("resize",this.resizeWindowFun);this.view=new MWF.xApplication.Execution.SettingExplorer.CategorySettingView(this.viewContainer,this.app,this,{templateUrl:this.parent.path+"listItem_category.json",scrollEnable:true});this.view.load()},resizeWindow:function(){var t=this.app.content.getSize();this.viewContainer.setStyles({height:t.y-121+"px"})}});MWF.xApplication.Execution.SettingExplorer.CategorySettingView=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexView,_createDocument:function(t){return new MWF.xApplication.Execution.SettingExplorer.CategorySettingDocument(this.viewNode,t,this.explorer,this)},_getCurrentPageData:function(t,e){if(!e)e=20;this.actions.listCategoryAll(function(e){if(t)t(e)}.bind(this))},_removeDocument:function(t,e){this.actions.deleteCategory(t.id,function(t){this.reload();this.app.notice(this.app.lp.deleteDocumentOK,"success")}.bind(this))},_create:function(){},_openDocument:function(t){var e=new MWF.xApplication.Execution.SettingExplorer.CategorySettingForm(this,t,{onPostOk:function(){this.reload()}.bind(this)});e.edit()},_queryCreateViewNode:function(){},_postCreateViewNode:function(t){},_queryCreateViewHead:function(){},_postCreateViewHead:function(t){}});MWF.xApplication.Execution.SettingExplorer.CategorySettingDocument=new Class({Extends:MWF.xApplication.Template.Explorer.ComplexDocument,_queryCreateDocumentNode:function(t){},_postCreateDocumentNode:function(t,e){}});MWF.xApplication.Execution.SettingExplorer.CategorySettingForm=new Class({Extends:MWF.xApplication.Template.Explorer.PopupForm,Implements:[Options,Events],options:{style:"default",width:"600",height:"260",hasTop:true,hasIcon:false,hasTopIcon:true,hasTopContent:true,hasBottom:true,title:MWF.xApplication.Execution.LP.categoryFormTitle,draggable:true,closeAction:true},_createTableContent:function(){var t="<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+"<tr><td styles='formTableTitle' lable='workTypeName'></td>"+" <td styles='formTableValue' item='workTypeName'></td></tr>"+"<tr><td styles='formTableTitle' lable='orderNumber'></td>"+" <td styles='formTableValue' item='orderNumber'></td></tr>"+"<tr><td styles='formTableTitle' lable='description'></td>"+" <td styles='formTableValue' item='description'></td></tr>"+"</table>";this.formTableArea.set("html",t);MWF.xDesktop.requireApp("Template","MForm",function(){this.form=new MForm(this.formTableArea,this.data,{style:"execution",isEdited:this.isEdited||this.isNew,itemTemplate:{workTypeName:{text:this.lp.workTypeName,notEmpty:true},orderNumber:{text:this.lp.orderNumber,tType:"number"},description:{text:this.lp.description,type:"textarea"}}},this.app);this.form.load()}.bind(this),true)},_ok:function(t,e){this.app.restActions.saveCategory(t,function(t){if(e)e(t);this.fireEvent("postOk")}.bind(this))}});
|