|
地板

楼主 |
发表于 2021-4-24 14:15:56
|
只看该作者
- <script>
- if(window.showModalDialog == undefined){
- window.showModalDialog = function(url,mixedVar,features){
- if(window.hasOpenWindow){
- //alert("您已经打开了一个窗口!请先处理它");//避免多次点击会弹出多个窗口
- //window.myNewWindow.focus();
- window.myNewWindow.close(); //直接关闭,重新开始
- }
- window.hasOpenWindow = true;
- if(mixedVar) var mixedVar = mixedVar;
- //因window.showmodaldialog 与 window.open 参数不一样,所以封装的时候用正则去格式化一下参数
- if(features) var features = features.replace(/(dialog)|(px)/ig,"").replace(/;/g,',').replace(/\:/g,"=");
- //window.open("Sample.htm",null,"height=200,width=400,status=yes,toolbar=no,menubar=no");
- //window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
- var left = (window.screen.width - parseInt(features.match(/width[\s]*=[\s]*([\d]+)/i)[1]))/2;
- var top = (window.screen.height - parseInt(features.match(/height[\s]*=[\s]*([\d]+)/i)[1]))/2;
- window.myNewWindow = window.open(url,"_blank",features+",top="+top+",left="+left);
- }
- }
- </script>
- <style>
- A.sfcreporlink { TEXT-DECORATION: none; color: red }
- </style>
- <table border=0 width=100%><tr><td align=right>
- <a class="sfcreporlink"
- href="javascript:window.showModalDialog('/sfc/R.php/setupsheet/rkp_list?layerWO=COMMON','','center:yes;help:no;dialogWidth:720px;dialogHeight:400px;status:no;resizable:yes;')" ><small>查看工单替代料报表</small></a>
- </td></tr></table>
复制代码 |
|