text: var Flow={startFlow:function(a){Wb.request({url:"m?xwl=sys/tool/flow/start-flow",timeout:-1,params:{filename:a.filename,params:a.params},success:function(b){Flow.processResponse(Wb.apply({responseText:b.responseText},a))}})},openFlow:function(b,a){Wb.request({url:a?"m?xwl=sys/tool/flow/view-flow":"m?xwl=sys/tool/flow/open-flow",timeout:-1,params:{flowId:b.flowId,params:b.params,nodeName:b.nodeName},success:function(c){Flow.processResponse(Wb.apply({responseText:c.responseText},b))}})},viewFlow:function(a){Flow.openFlow(a,true)},processResponse:function(FlowVars){FlowVars.respObject=Wb.decode(FlowVars.responseText);if(!FlowVars.respObject.module){Ext.callback(FlowVars.onOpen,FlowVars.appScope||window,[FlowVars.appScope||null]);return}FlowVars.doOpen=function(){if(FlowVars.respObject.module.substring(0,10)!="(function("||FlowVars.respObject.module.slice(-3)!="();"){Wb.error("对话框 “"+FlowVars.respObject.path+"” 无效。");return}FlowVars.loc=window.location;FlowVars.respObject.module=Ext.String.insert(FlowVars.respObject.module,"\napp.flowParams="+Wb.encode(FlowVars.respObject.flowParams)+";",FlowVars.respObject.module.indexOf(";")+1);FlowVars.appScope=eval(FlowVars.respObject.module.slice(0,-2)+"{}, null);\n//# sourceURL="+FlowVars.loc.protocol+"//"+FlowVars.loc.host+FlowVars.loc.pathname.substring(0,FlowVars.loc.pathname.lastIndexOf("/"))+"/"+FlowVars.respObject.path);if(FlowVars.appScope.main){FlowVars.appScope.main.closeAction="destroy";FlowVars.appScope.main.modal=true;if(!FlowVars.appScope.main.onEnter){FlowVars.appScope.main.onEnter=function(){var btn=this.down("[name=pass]");if(btn){btn.fireEvent("click")}else{Wb.verify(this)}}}FlowVars.appScope.main.mon(FlowVars.appScope.main,"destroy",function(){Wb.destroy(FlowVars.appScope,FlowVars.appScope.main)});FlowVars.appScope.xFlowParams={params:FlowVars.params,filename:FlowVars.filename,flowId:FlowVars.flowId,nodeName:FlowVars.nodeName,onAction:FlowVars.onAction,minWidth:FlowVars.respObject.minWidth,history:FlowVars.respObject.history};Flow.addButtons(FlowVars.appScope,FlowVars.appScope.main,FlowVars.respObject.actions);FlowVars.appScope.main.show()}else{Wb.destroy(FlowVars.appScope);Wb.error("没有找到名称为main的主窗口");return}Ext.callback(FlowVars.onOpen,FlowVars.appScope||window,[FlowVars.appScope||null])};if(Ext.String.startsWith(FlowVars.respObject.module,"$$@blink")){FlowVars.scriptLinkEnd=FlowVars.respObject.module.indexOf("$$@elink");FlowVars.scriptObject=Wb.decode(FlowVars.respObject.module.substring(8,FlowVars.scriptLinkEnd));FlowVars.linksArray=[];if(FlowVars.scriptObject.css){Wb.each(FlowVars.scriptObject.css,function(item){FlowVars.linksArray.push({url:item,type:"css"})})}if(FlowVars.scriptObject.js){Wb.each(FlowVars.scriptObject.js,function(item){FlowVars.linksArray.push({url:item,type:"js"})})}FlowVars.respObject.module=FlowVars.respObject.module.substring(FlowVars.scriptLinkEnd+9);Wb.addLink(FlowVars.linksArray,FlowVars.doOpen,FlowVars.scriptObject.recursive)}else{FlowVars.doOpen()}},addButtons:function(c,f,g){if(Wb.isEmpty(g)){return}var a,b,e=[],d=f.getDockedItems('toolbar[dock="bottom"]');if(!d.length){a=true;b={xtype:"toolbar",dock:"bottom",ui:"footer",defaults:{minWidth:c.xFlowParams.minWidth||80}};d=f.addDocked(b)}d=d[0];if(a){e.push("->")}Wb.each(g,function(h){h.listeners={click:Flow.actionHandler};h.appScope=c;e.push(h)});d.add(e)},actionHandler:function(){var d=this,c=d.appScope,a=c.xFlowParams,b,e;if(d.name!="cancel"&&d.name!="turn"&&d.name!="reject"&&!Wb.verify(c.main)){return}if(d.beforeFn&&Ext.callback(c[d.beforeFn],c,[d])===false){return}if(d.name=="cancel"){if(d.afterFn&&Ext.callback(c[d.afterFn],c,[d])===false){return}c.main.close();return}b={filename:a.filename,flowId:a.flowId,startFlowId:c.flowParams["flow.id"],module:d.module,nodeName:a.nodeName};e={actionName:d.name,flowParams:b,main:c.main,params:Wb.apply(Wb.getValue(c.main),a.params,c.extraParams),callback:function(f){if(d.afterFn&&Ext.callback(c[d.afterFn],c,[d,f,c])===false){return}Ext.callback(c.xFlowParams.onAction,c,[Wb.decode(f),d.name,d,c]);Ext.callback(e.innerCallback);c.main.close()}};switch(d.name){case"pass":Flow.doAction(e);break;case"reject":Wb.run({url:"m?xwl=sys/tool/flow/reject-dialog",single:true,success:function(f){f.show(function(h,g){b.rejectTo=h;e.innerCallback=function(){g.close()};Flow.doAction(e)},{rows:a.history,title:d.text,iconCls:d.iconCls})}});break;case"beforeSign":case"afterSign":Wb.run({url:"m?xwl=sys/tool/flow/sign-dialog",single:true,success:function(f){f.show(function(g,l,j,i,h,k){Wb.apply(b,{userData:g,newNodeName:l,passName:j,nodeTitle:i,passUsers:h});e.innerCallback=function(){k.close()};Flow.doAction(e)},{nodeName:a.nodeName,title:d.text,iconCls:d.iconCls})}});break;case"plusSign":case"turn":Wb.run({url:"user-selector",single:true,success:function(f){f.show(function(g,h){b.userData=g;e.innerCallback=function(){h.close()};Flow.doAction(e)},{title:d.text,iconCls:d.iconCls})}});break}},doAction:function(c){var b={beforeSign:"before-sign",afterSign:"after-sign",plusSign:"plus-sign"},a=c.main.down("form");if(a){Wb.upload({url:"m?xwl=sys/tool/flow/"+(b[c.actionName]||c.actionName),form:a,timeout:-1,params:{xFlowParams:c.flowParams,params:c.params,xFlowId:c.flowParams.startFlowId},success:function(e,d,f){Ext.callback(c.callback,this,[f])}})}else{Wb.request({url:"m?xwl=sys/tool/flow/"+(b[c.actionName]||c.actionName),timeout:-1,out:c.main,params:{xFlowParams:c.flowParams,params:c.params,xFlowId:c.flowParams.startFlowId},success:function(d){Ext.callback(c.callback,this,[d.responseText])}})}}};