diff --git a/WebContent/Frame/page/js/as_debug_message.js b/WebContent/Frame/page/js/as_debug_message.js new file mode 100644 index 000000000..18ece8473 --- /dev/null +++ b/WebContent/Frame/page/js/as_debug_message.js @@ -0,0 +1,190 @@ +var AsDebug = { + URL:"", + toggleWindow:function() { + var d = top.dialog.get('as-debug-dialog'); + if (d) { + d.remove(); + } else { + this.showWindow(); + } + }, + showWindow:function() { + var d = top.dialog({ + id: 'as-debug-dialog', + title: '调试工具栏['+AsDebug.getURL()+"]", + onclose: function () { + AsDebug.removeWindow(); + }, + quickClose: true + }); + var html="
"; + html+=" DWINFO "; + html+=" CTRLCT "; + html+=" PGSRC "; + html+=" COMP "; + html+=" REQ "; + html+=" ReloadCacheAll "; + html+="
"; + //html+=""+AsDebug.getPage()+" "; + html+=""+AsDebug.getPage()+" "; + //html+="【"+AsDebug.getURL()+"】"; + html+="【"+AsDebug.getURL()+"】"; + html+="
"; + d.content(html); + d.showModal(); + + }, + alert:function(title,message,width,height,mask,time,okButton,openCallback,closeCallback,flag) { + this.showMessage(title,message,width,height,mask,time,okButton,openCallback,closeCallback,flag); + }, + showMessage:function(title,message,width,height,mask,time,okButton,openCallback,closeCallback,flag){ + var d; + if(typeof(mask) == "undefined") mask = true; + if(!okButton){ + d = top.dialog({ + id: 'dialog-message', + width:width?width:"350px", + height:height?height:"50px", + skin:"ui-popup-show", + title: "" == title?"提示":title, + okValue: '确定', + ok:function(){ + AsDebug.removeMessage(); + }, + onclose: function(){ + AsDebug.removeMessage(); + }, + onshow:openCallback, + onremove:closeCallback, + cancel:false, + quickClose: mask?false:true + }); + }else{ + d = top.dialog({ + id: 'dialog-message', + width:width?width:"350px", + height:height?height:"40px", + skin:"ui-popup-show", + title: "" == title?"提示":title, + onclose: function(){ + AsDebug.removeMessage(); + }, + onshow:openCallback, + onremove:closeCallback, + cancel:false, + quickClose: mask?false:true + }); + } + var mesDiv = "

"+message+"

"; + d.content(mesDiv); + d.showModal(); + if(time){ + setTimeout(function(){ + AsDebug.removeMessage(); + },time); + } + }, + removeMessage:function() { + /*var d = window.top.dialog.get('dialog-message'); + if (d) d.remove();*/ + }, + + removeWindow:function() { + var d = top.dialog.get('as-debug-dialog'); + if (d) d.remove(); + }, + getURL:function() { + if (typeof(AsDebug_URL) != "undefined") this.URL = AsDebug_URL; + if (this.URL != "") return this.URL.substring(this.URL.lastIndexOf(sWebRootPath)+sWebRootPath.length); + return document.URL; + }, + getPage:function() { + if (typeof(AsDebug_URL) != "undefined") this.URL = AsDebug_URL; + if (this.URL != "") return this.URL.substring(this.URL.lastIndexOf("/")+1); + return document.URL; + }, + reloadAREService:function(serviceId){ + if (typeof(serviceId) == "undefined" || serviceId.length == 0) serviceId = "JBO"; + var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadServiceAction","reloadService","ServiceId="+serviceId); + if(sReturn=="SUCCESS") alert(getMessageText("AWES0017")); // 重载ARE服务成功! + else alert(getMessageText("AWES0018")); // 重载ARE服务失败! + }, + reloadCacheAll:function(){ + var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadCacheConfigAction","reloadCacheAll",""); + if(sReturn=="SUCCESS") alert(getMessageText("AWES0015")); // 重载参数缓存成功! + else alert(getMessageText("AWES0016")); // 重载参数缓存失败! + }, + reloadCache:function(CacheType){ + var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadCacheConfigAction","reloadCache","ConfigName="+CacheType); + if(sReturn=="SUCCESS") alert(getMessageText("AWES0019")); // 刷新参数缓存成功! + else alert(getMessageText("AWES0020")); // 刷新参数缓存失败! + }, + reloadFixSkins:function(){ + var sReturn = AsControl.RunJsp("/AppConfig/ControlCenter/ReloadSkin.jsp","ReloadType=FixSkins"); + if(sReturn=="SUCCESS") alert(getMessageText("AWES0021")); // 重载定制皮肤成功! + else alert(getMessageText("AWES0022")); // 重载定制皮肤失败! + }, + reloadConfigFile:function(){ + var sReturn = AsControl.RunJsp("/AppConfig/ControlCenter/ClearConfigFileCache.jsp","",""); + if(sReturn=="SUCCESS") alert(getMessageText("AWES0023")); // 重载配置文件成功! + else alert(getMessageText("AWES0024")); // 重载配置文件失败! + }, + openControlCenter:function() { + this.removeWindow(); + AsControl.OpenPage("/AppConfig/ControlCenter/ControlCenterTab.jsp","",""); + }, + displayHTML:function(oBody) { + var d = dialog({ + height:400, + width:800, + title: '页面运行代码['+AsDebug.getURL()+"]", + content: '', + onshow: function () { + $("#testSource").text(oBody.ownerDocument.documentElement.innerHTML); + }, + quickClose: true + }); + d.showModal(); + }, + displayBodyHTML:function() { + this.removeWindow(); + this.displayHTML(document.body); + }, + viewCompDetail:function() { + this.removeWindow(); + AsControl.OpenPage("/Frame/page/debug/tools/CompDetail.jsp","ToShowClientID="+sCompClientID,""); + }, + displayDwInfo:function() { + this.removeWindow(); + try{ + var sUrl = "/Frame/page/dw/DisplayDWInfo.jsp"; + if(!window.WindowType) sUrl = "/Frame/page/ow/DisplayOWInfo.jsp"; + window.open(sWebRootPath + sUrl+ "?dono="+DisplayDONO+"&url="+this.getURL(),"","status:no,resizable:yes,scrollbars=yes,height:768,width:1024"); + }catch(e){ + alert("No DWInfo"); + } + }, + displayURL:function displayURL() { + prompt("URLName",this.getURL()); + }, + displayPageName:function() { + prompt("PageName",this.getPage()); + }, + displayURLnPara:function() { + prompt("URL",document.URL); + }, + showOnlineUserList:function(){ + OpenPage("/AppConfig/ControlCenter/OnlineUserList.jsp?rand="+randomNumber()); + }, + editDW:function(){ + if(typeof(DisplayDONO)=="undefined" || DisplayDONO.length == 0){ + alert("No DWInfo"); + return; + } + if(typeof(WindowType) !="undefined" && WindowType.length != 0){ + AsControl.OpenNewWin("/AppConfig/PageMode/DWConfig/DataObjectStrip.jsp","DONO="+DisplayDONO+"&RightType=All"); + }else{ + AsControl.OpenNewWin("/AppConfig/PageMode/DWConfig/ObjectModelStrip.jsp","DONO="+DisplayDONO+"&RightType=All"); + } + } +};