JS中showModalDialog 详细使用

基本介绍:
          showModalDialog()         (IE 4+ 支持)
          showModelessDialog()      (IE 5+ 支持)
          window.showModalDialog()                  方法用来创建一个显示HTML内容的模态对话框。
          window.showModelessDialog()             方法用来创建一个显示HTML内容的非模态对话框。
使用方法:
          vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
          vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
参数说明:
         sURL          --  必选参数,类型:字符串。用来指定对话框要显示的文档的URL。
         vArguments    -- 可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。对话框通过
 

                          window.dialogArguments来取得传递进来的参数。
         sFeatures     -- 可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。
----------------
1.    dialogHeight:    对话框高度,不小于100px
2.    dialogWidth:    对话框宽度。
3.    dialogLeft:     离屏幕左的距离。
4.    dialogTop:     离屏幕上的距离。
5.    center:          { yes | no | 1 | 0 } :              是否居中,默认yes,但仍可以指定高度和宽度。
6.    help:             {yes | no | 1 | 0 }:                是否显示帮助按钮,默认yes。
7.    resizable:       {yes | no | 1 | 0 } [IE5+]:     是否可被改变大小。默认no。
8.    status:          {yes | no | 1 | 0 } [IE5+]:      是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
9.    scroll:            { yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。

下面几个属性是用在HTA中的,在一般的网页中一般不使用。
10.    dialogHide:{ yes | no | 1 | 0 | on | off }:在
打印或者打印预览时对话框是否隐藏。默认为no。
11.    edge:{ sunken | raised }:指明对话框的边框样式。默认为raised。
12.    unadorned:{ yes | no | 1 | 0 | on | off }:默认为no。

参数传递:
1. 要想对话框传递参数,是通过vArguments来进行传递的。类型不限制,对于字符串类型,最大为4096个字符。也可以传递对象,例如:
-------------------------------
parent.htm
<script>
          var obj = new Object();
          obj.name="51js";
          window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
          var obj = window.dialogArguments
          alert("您传递的参数为:" + obj.name)
</script>
-------------------------------
2.可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:
------------------------------
parent.htm
<script>
          str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
          alert(str);
</script>
modal.htm
<script>
          window.returnValue="http://homepage.yesky.com";
</script>

常见技巧:

一、怎样才让在showModalDialog和showModelessDialog的超连接不弹出新窗口?
  在被打开的网页里加上<base target="_self">就可以了。这句话一般是放在<head>之间的。

二、怎样才刷新showModalDialog和showModelessDialog里的内容?
  在showModalDialog和showModelessDialog里是不能按F5刷新的,又不能弹出菜单。这个只能依靠

javascript了,以下是相关代码:

<body onkeydown="if (event.keyCode==116){reload.click()}">
<a id="reload" href="filename.htm" style="display:none">reload...</a>

  将filename.htm替换成网页的名字然后将它放到你打开的网页里,按F5就可以刷新了,注意,这个要

配合<base target="_self">使用,不然你按下F5会弹出新窗口的。

三、如何用javascript关掉showModalDialog(或showModelessDialog)打开的窗口。
  <input type="button" value="关闭" onclick="window.close()">
  也要配合<base target="_self">,不然会打开一个新的IE窗口,然后再关掉的。

四、Math.random与showModalDialog。

   当你设置的弹出网页固定时(如上面的"modal.htm"页面),ie很可能到临时文件区,下载上次产生的该页面(openPage.html),而没有重新加载,

   对于动态加载的页面来说,这样往往产生误会,如没有及时更新数据,也就更不利于开发者测试。所以,你可以采用如下方式:

      var strPage = “/medal.htm?random="+Math.random();

   这样每次产生的strPage是不一样的,原因也就不言自明了。

详细分析下面代码: <#import "/decorators/includes/macros.ftl" as m> <#assign ww = JspTaglibs["/WEB-INF/webwork.tld"] /> <#include "/template/includes/actionerrors.ftl"> <script> xmlParse = new function(){ this.xmlDoc = null; this.parse=function(response){ this.xmlDoc = response.responseXML.documentElement; } //取得所有节点 this.getRows=function(_xpath){ return this.xmlDoc.selectNodes(_xpath); } //取得单个节点 this.getRow=function(_xpath){ return this.xmlDoc.selectSingleNode(_xpath); } //取得单个节点的文本值 this.getRowValue=function(_xpath){ return this.xmlDoc.selectSingleNode(_xpath).text; } //取得属性值 this.getRowAttribute=function(_rowItem,attr){ var xpath="@"+attr; return _rowItem.selectSingleNode(xpath).text; } } function checkRuncardStatus(){ var url ="checkFormData.action"; var ajaxRequest = new Ajax.Request( url,{ method: 'post', asynchronous: 'false', parameters: $('requestFormId').serialize(), onComplete: function(transport){ //alert(transport.responseText); xmlParse.parse(transport); var status =xmlParse.getRows("/roots/status"); var flag=status[0].getAttribute("value"); //alert(xmlParse.getRowValue("/roots/status")); if(flag=="nodraft"){ alert("This runcard had been issued, don't click the button of back off in the browser.\n\n Please apply new application !"); } }}); } function checkPageToPreview(){ var form = document.forms['updateRequestForm']; var holdStepNo=form.elements["requestForm.holdStepNo"]; var ercStepNo=form.elements["requestForm.ercStepNo"]; var holdStepNoMes=form.elements["requestForm.holdStepNoMes"]; var ercStepNoMes=form.elements["requestForm.ercStepNoMes"]; clearHoldLotInfo(holdStepNo); clearCompleteLotInfo(ercStepNo); /* remove the Lot Type check. var lotType="${requestForm.lotType?default('')?if_exists}"; var runcardCategory=$F("requestForm.ercCategory"); if(lotType=="P" | lotType=="R" | lotType=="M" |lotType=="B" |lotType=="E1" |lotType=="E2"|lotType=="E3" |lotType=="E9"){ if(runcardCategory!="Input the STR Number" && runcardCategory!="STR" && runcardCategory!="MSTR" ) { alert("Because the lotType is "+lotType+ ". Please select 'the For STR/MSTR lots(Pls input the effective STR or MSTR number)' in RunCard Category, and input the STR# ! "); $("requestForm.ercCategory").focus(); return false; } }*/ if (typeof form.elements["requestForm.lotId"]!= "undefined"){ var element = form.elements["requestForm.lotId"].value; if (element==""){ alert("The Lot field can not be null"); form.elements["requestForm.lotId"].focus(); return false; } } if (typeof form.elements["requestForm.ercRunMode"]!= "undefined"){ if (!form["requestForm.ercRunMode"][0].checked&&!form["requestForm.ercRunMode"][1].checked){ alert("Please choose the Runcard's Follow mode after Runcard completed!"); return false; } } if (typeof form.elements["requestForm.needCheck"]!= "undefined"){ if (!form["requestForm.needCheck"][0].checked&&!form["requestForm.needCheck"][1].checked){ alert("Please choose the check RunCard's Product Id method!"); return false; } } if (typeof form.elements["requestForm.holdStepNo"]!= "undefined"){ var element = form.elements["requestForm.holdStepNo"].value; if (element==""){ alert("The Hold Step No field can not be null"); form.elements["requestForm.holdStepNo"].focus(); return false; } var elementMes = form.elements["requestForm.holdStepNoMes"].value; if (elementMes==null || element!=elementMes){ alert("Please click [go] to get MES information."); form.elements["requestForm.holdStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.holdStepNo"]!= "undefined"){ var element = form.elements["requestForm.holdStepNo"].value; if (element==""){ alert("The Hold Step No field can not be null"); form.elements["requestForm.holdStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.relatedModlue"]!= "undefined"){ var element = form.elements["requestForm.relatedModlue"].value; if (element==""){ alert("You must select related module manager to sign runcard"); form.elements["requestForm.relatedModlue"].focus(); return false; } } if (typeof form.elements["requestForm.E1Mgr"]!= "undefined"){ var element = form.elements["requestForm.E1Mgr"].value; if (element==""){ alert("You must select E1 manager to sign runcard"); form.elements["requestForm.E1Mgr"].focus(); return false; } } if (typeof form.elements["requestForm.mfgMgr"]!= "undefined"){ var element = form.elements["requestForm.mfgMgr"].value; if (element==""){ alert("You must select MFG manager to sign runcard"); form.elements["requestForm.mfgMgr"].focus(); return false; } } if (typeof form.elements["requestForm.ercCategory"]!= "undefined"){ var element = form.elements["requestForm.ercCategory"].value; if (element=="Please Select"){ alert("You must select Runcard Category!"); form.elements["requestForm.ercCategory"].focus(); return false; } } if (typeof form.elements["requestForm.purpose"]!= "undefined"){ var element = form.elements["requestForm.purpose"].value; if(element.length>150){ alert("Remark最多150个字符!"); element.focus(); return false; } if (element==""){ alert("Purpose can not be null!"); form.elements["requestForm.purpose"].focus(); return false; } } if (typeof form.elements["requestForm.strEnNo"]!= "undefined"){ var element = form.elements["requestForm.strEnNo"].value; if (element==""){ if(form.elements["requestForm.ercCategory"].value=="For Customer Request") alert("EN#. can not be null!"); else alert("STR NO#. can not be null!"); form.elements["requestForm.strEnNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercContamination"]!= "undefined"){ var element = form.elements["requestForm.ercContamination"].value; if (element=="Please Select"){ alert("Please select Lot Contamination Flag!"); form.elements["requestForm.ercContamination"].focus(); return false; } } if (typeof form.elements["requestForm.ercStepNo"]!= "undefined"){ var element = form.elements["requestForm.ercStepNo"].value; if (element==""){ alert("Step No#. can not be null!"); form.elements["requestForm.ercStepNo"].focus(); return false; } var elementMes = form.elements["requestForm.ercStepNoMes"].value; if (elementMes==null || element!=elementMes){ alert("Please click [go] to get MES information."); form.elements["requestForm.ercStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercEngineerNo"]!= "undefined"){ var element = form.elements["requestForm.ercEngineerNo"].value; if (element==""){ alert("Engineer can not be null!"); form.elements["requestForm.ercEngineerNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercEngineerTel"]!= "undefined"){ var element = form.elements["requestForm.ercEngineerTel"].value; if (element==""){ alert("Engineer Tel. can not be null!"); form.elements["requestForm.ercEngineerTel"].focus(); return false; } } <#if requestForm.formType=="Normal" || requestForm.formType=="Auto Reposition Step"> var wHeight=400; var wWidth=620; var wTop=(screen.height-wHeight)/2; var wLeft=(screen.width-wWidth)/2; var str=window.showModalDialog("stepCompareRule.action?requestFormId=${requestForm.id}","","dialogTop:"+wTop+"px; dialogLeft:"+wLeft+"px;dialogheight :"+wHeight+"px; dialogwidth :"+wWidth+"px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll:Yes;"); if(str=="null" || str==undefined || str!="Yes"){ return false; } </#if> form.action="updateRequestForm.action"; form.submit(); } </script> <#if requestForm.status!="DRAFT"><div><font color="red">This runcard had been issued.If you want to apply the case,please click the new application.</font></div></#if> <#if requestForm.haveQtime?has_content><div><font color="red">This runcard information had been stored the MES.If you want to delete this runcard,please click the button(Prview and Cancel Runcard ).If you want to submit it,please click the button (Preview and Continue Runcard)</font></div></#if> <#if (requestForm.match)?default("")=="N"><div>Compare with MES Result:  <font color="red">Not match MES Info</font></div><#elseif (requestForm.match)?default("")=="Y"> <div>Compare with MES Result:  <font color="red">Match MES Info</font></div><#else><div>Compare with MES Result:  <font color="red">${requestForm.match?default("")}</font></div> </#if> <div class="app"> <h3>e-Runcard Request Form(${requestForm.formType?if_exists})</h3> <form name="updateRequestForm" action="updateRequestForm.action" namespace="/user" method="post"> <@ww.hidden name="'requestFormId'" value="${requestForm.id}"/> <@ww.hidden name="'requestForm.match'" value="'No Comparison'"/> <@ww.hidden name="'requestForm.compareResultComment'" value="''"/> <@ww.hidden name="'requestForm.holdStepNoMes'"/> <@ww.hidden name="'requestForm.ercStepNoMes'"/> <input type="hidden" name="paginationSupport.startIndex" value="0"/> <input type="hidden" name="paginationSupport.countOnEachPage" value="10"/> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <tr class="b"> <td>RunCard No.:</td> <td>${requestForm.caseNo?if_exists}</td> <td>Status:</td> <td><font color="red">${requestForm.status?if_exists}</font></td> </tr> <tr class="b"> <td>Applicant:</td> <td><@m.directoryLink requestForm.applicant?if_exists/> </td> <td>Organization:</td> <td>${requestForm.applicantOrg?if_exists}</td> </tr> <tr class="b"> <td>Submit Date:</td> <td>${requestForm.submitDate?if_exists}</td> <td>Effective Date:</td> <td>${requestForm.effectiveDate?if_exists}</td> </tr> <#switch requestForm.formType> <#case "Auto Reposition Step"> <#include "includeLotInfo.ftl"/> <#include "includeSignInfo.ftl"/> <#include "includeErcHeaderInfo_reposition.ftl"/> <#include "includeErcCompleteInfo.ftl"/> </table> <#break> <#default> <#include "includeLotInfo.ftl"/> <#include "includeSignInfo.ftl"/> <#include "includeErcHeaderInfo.ftl"/> <#include "includeErcCompleteInfo.ftl"/> </table> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <#assign showWGRbtn="true"/> <#include "includeStepInfo.ftl"/> </table> </#switch> <#if requestForm.lotCategory?exists> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <tr><td><center><font color="#FF0000"><b>!!! Special lot, category is ${requestForm.lotCategory}, pls take care !!!</b></font></center></td></tr> </table> </#if> <hr/> <table width="100%"> <tr> <td class="center"> <!--input type="button" onclick="window.open('../stepForm/printRuncard.action?requestFormId=${requestForm.id}','','resizable=yes,scrollbars=yes,width=800,height=600')" value="Print"/-->     <input type="button" onclick="checkPageToPreview()" value="Preview"/> </td> </tr> </table> </form> </div>
09-18
详细分析下面代码,是否有回滚机制以及如何防止呢: <#import "/decorators/includes/macros.ftl" as m> <#assign ww = JspTaglibs["/WEB-INF/webwork.tld"] /> <#include "/template/includes/actionerrors.ftl"> <script> xmlParse = new function(){ this.xmlDoc = null; this.parse=function(response){ this.xmlDoc = response.responseXML.documentElement; } //取得所有节点 this.getRows=function(_xpath){ return this.xmlDoc.selectNodes(_xpath); } //取得单个节点 this.getRow=function(_xpath){ return this.xmlDoc.selectSingleNode(_xpath); } //取得单个节点的文本值 this.getRowValue=function(_xpath){ return this.xmlDoc.selectSingleNode(_xpath).text; } //取得属性值 this.getRowAttribute=function(_rowItem,attr){ var xpath="@"+attr; return _rowItem.selectSingleNode(xpath).text; } } function checkRuncardStatus(){ var url ="checkFormData.action"; var ajaxRequest = new Ajax.Request( url,{ method: 'post', asynchronous: 'false', parameters: $('requestFormId').serialize(), onComplete: function(transport){ //alert(transport.responseText); xmlParse.parse(transport); var status =xmlParse.getRows("/roots/status"); var flag=status[0].getAttribute("value"); //alert(xmlParse.getRowValue("/roots/status")); if(flag=="nodraft"){ alert("This runcard had been issued, don't click the button of back off in the browser.\n\n Please apply new application !"); } }}); } function checkPageToPreview(){ var form = document.forms['updateRequestForm']; var holdStepNo=form.elements["requestForm.holdStepNo"]; var ercStepNo=form.elements["requestForm.ercStepNo"]; var holdStepNoMes=form.elements["requestForm.holdStepNoMes"]; var ercStepNoMes=form.elements["requestForm.ercStepNoMes"]; clearHoldLotInfo(holdStepNo); clearCompleteLotInfo(ercStepNo); /* remove the Lot Type check. var lotType="${requestForm.lotType?default('')?if_exists}"; var runcardCategory=$F("requestForm.ercCategory"); if(lotType=="P" | lotType=="R" | lotType=="M" |lotType=="B" |lotType=="E1" |lotType=="E2"|lotType=="E3" |lotType=="E9"){ if(runcardCategory!="Input the STR Number" && runcardCategory!="STR" && runcardCategory!="MSTR" ) { alert("Because the lotType is "+lotType+ ". Please select 'the For STR/MSTR lots(Pls input the effective STR or MSTR number)' in RunCard Category, and input the STR# ! "); $("requestForm.ercCategory").focus(); return false; } }*/ if (typeof form.elements["requestForm.lotId"]!= "undefined"){ var element = form.elements["requestForm.lotId"].value; if (element==""){ alert("The Lot field can not be null"); form.elements["requestForm.lotId"].focus(); return false; } } if (typeof form.elements["requestForm.ercRunMode"]!= "undefined"){ if (!form["requestForm.ercRunMode"][0].checked&&!form["requestForm.ercRunMode"][1].checked){ alert("Please choose the Runcard's Follow mode after Runcard completed!"); return false; } } if (typeof form.elements["requestForm.needCheck"]!= "undefined"){ if (!form["requestForm.needCheck"][0].checked&&!form["requestForm.needCheck"][1].checked){ alert("Please choose the check RunCard's Product Id method!"); return false; } } if (typeof form.elements["requestForm.holdStepNo"]!= "undefined"){ var element = form.elements["requestForm.holdStepNo"].value; if (element==""){ alert("The Hold Step No field can not be null"); form.elements["requestForm.holdStepNo"].focus(); return false; } var elementMes = form.elements["requestForm.holdStepNoMes"].value; if (elementMes==null || element!=elementMes){ alert("Please click [go] to get MES information."); form.elements["requestForm.holdStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.holdStepNo"]!= "undefined"){ var element = form.elements["requestForm.holdStepNo"].value; if (element==""){ alert("The Hold Step No field can not be null"); form.elements["requestForm.holdStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.relatedModlue"]!= "undefined"){ var element = form.elements["requestForm.relatedModlue"].value; if (element==""){ alert("You must select related module manager to sign runcard"); form.elements["requestForm.relatedModlue"].focus(); return false; } } if (typeof form.elements["requestForm.E1Mgr"]!= "undefined"){ var element = form.elements["requestForm.E1Mgr"].value; if (element==""){ alert("You must select E1 manager to sign runcard"); form.elements["requestForm.E1Mgr"].focus(); return false; } } if (typeof form.elements["requestForm.mfgMgr"]!= "undefined"){ var element = form.elements["requestForm.mfgMgr"].value; if (element==""){ alert("You must select MFG manager to sign runcard"); form.elements["requestForm.mfgMgr"].focus(); return false; } } if (typeof form.elements["requestForm.ercCategory"]!= "undefined"){ var element = form.elements["requestForm.ercCategory"].value; if (element=="Please Select"){ alert("You must select Runcard Category!"); form.elements["requestForm.ercCategory"].focus(); return false; } } if (typeof form.elements["requestForm.purpose"]!= "undefined"){ var element = form.elements["requestForm.purpose"].value; if(element.length>150){ alert("Remark最多150个字符!"); element.focus(); return false; } if (element==""){ alert("Purpose can not be null!"); form.elements["requestForm.purpose"].focus(); return false; } } if (typeof form.elements["requestForm.strEnNo"]!= "undefined"){ var element = form.elements["requestForm.strEnNo"].value; if (element==""){ if(form.elements["requestForm.ercCategory"].value=="For Customer Request") alert("EN#. can not be null!"); else alert("STR NO#. can not be null!"); form.elements["requestForm.strEnNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercContamination"]!= "undefined"){ var element = form.elements["requestForm.ercContamination"].value; if (element=="Please Select"){ alert("Please select Lot Contamination Flag!"); form.elements["requestForm.ercContamination"].focus(); return false; } } if (typeof form.elements["requestForm.ercStepNo"]!= "undefined"){ var element = form.elements["requestForm.ercStepNo"].value; if (element==""){ alert("Step No#. can not be null!"); form.elements["requestForm.ercStepNo"].focus(); return false; } var elementMes = form.elements["requestForm.ercStepNoMes"].value; if (elementMes==null || element!=elementMes){ alert("Please click [go] to get MES information."); form.elements["requestForm.ercStepNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercEngineerNo"]!= "undefined"){ var element = form.elements["requestForm.ercEngineerNo"].value; if (element==""){ alert("Engineer can not be null!"); form.elements["requestForm.ercEngineerNo"].focus(); return false; } } if (typeof form.elements["requestForm.ercEngineerTel"]!= "undefined"){ var element = form.elements["requestForm.ercEngineerTel"].value; if (element==""){ alert("Engineer Tel. can not be null!"); form.elements["requestForm.ercEngineerTel"].focus(); return false; } } <#if requestForm.formType=="Normal" || requestForm.formType=="Auto Reposition Step"> var wHeight=400; var wWidth=620; var wTop=(screen.height-wHeight)/2; var wLeft=(screen.width-wWidth)/2; var str=window.showModalDialog("stepCompareRule.action?requestFormId=${requestForm.id}","","dialogTop:"+wTop+"px; dialogLeft:"+wLeft+"px;dialogheight :"+wHeight+"px; dialogwidth :"+wWidth+"px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll:Yes;"); if(str=="null" || str==undefined || str!="Yes"){ return false; } </#if> form.action="updateRequestForm.action"; form.submit(); } </script> <#if requestForm.status!="DRAFT"><div><font color="red">This runcard had been issued.If you want to apply the case,please click the new application.</font></div></#if> <#if requestForm.haveQtime?has_content><div><font color="red">This runcard information had been stored the MES.If you want to delete this runcard,please click the button(Prview and Cancel Runcard ).If you want to submit it,please click the button (Preview and Continue Runcard)</font></div></#if> <#if (requestForm.match)?default("")=="N"><div>Compare with MES Result:  <font color="red">Not match MES Info</font></div><#elseif (requestForm.match)?default("")=="Y"> <div>Compare with MES Result:  <font color="red">Match MES Info</font></div><#else><div>Compare with MES Result:  <font color="red">${requestForm.match?default("")}</font></div> </#if> <div class="app"> <h3>e-Runcard Request Form(${requestForm.formType?if_exists})</h3> <form name="updateRequestForm" action="updateRequestForm.action" namespace="/user" method="post"> <@ww.hidden name="'requestFormId'" value="${requestForm.id}"/> <@ww.hidden name="'requestForm.match'" value="'No Comparison'"/> <@ww.hidden name="'requestForm.compareResultComment'" value="''"/> <@ww.hidden name="'requestForm.holdStepNoMes'"/> <@ww.hidden name="'requestForm.ercStepNoMes'"/> <input type="hidden" name="paginationSupport.startIndex" value="0"/> <input type="hidden" name="paginationSupport.countOnEachPage" value="10"/> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <tr class="b"> <td>RunCard No.:</td> <td>${requestForm.caseNo?if_exists}</td> <td>Status:</td> <td><font color="red">${requestForm.status?if_exists}</font></td> </tr> <tr class="b"> <td>Applicant:</td> <td><@m.directoryLink requestForm.applicant?if_exists/> </td> <td>Organization:</td> <td>${requestForm.applicantOrg?if_exists}</td> </tr> <tr class="b"> <td>Submit Date:</td> <td>${requestForm.submitDate?if_exists}</td> <td>Effective Date:</td> <td>${requestForm.effectiveDate?if_exists}</td> </tr> <#switch requestForm.formType> <#case "Auto Reposition Step"> <#include "includeLotInfo.ftl"/> <#include "includeSignInfo.ftl"/> <#include "includeErcHeaderInfo_reposition.ftl"/> <#include "includeErcCompleteInfo.ftl"/> </table> <#break> <#default> <#include "includeLotInfo.ftl"/> <#include "includeSignInfo.ftl"/> <#include "includeErcHeaderInfo.ftl"/> <#include "includeErcCompleteInfo.ftl"/> </table> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <#assign showWGRbtn="true"/> <#include "includeStepInfo.ftl"/> </table> </#switch> <#if requestForm.lotCategory?exists> <table border="0" cellspacing="1" cellpadding="8" width="100%"> <tr><td><center><font color="#FF0000"><b>!!! Special lot, category is ${requestForm.lotCategory}, pls take care !!!</b></font></center></td></tr> </table> </#if> <hr/> <table width="100%"> <tr> <td class="center"> <!--input type="button" onclick="window.open('../stepForm/printRuncard.action?requestFormId=${requestForm.id}','','resizable=yes,scrollbars=yes,width=800,height=600')" value="Print"/-->     <input type="button" onclick="checkPageToPreview()" value="Preview"/> </td> </tr> </table> </form> </div>
最新发布
09-19
String.prototype.trim = function(){return this.replace(/(^[\s]*)|([\s]*$)/g, "");}; String.prototype.lTrim = function(){return this.replace(/(^[\s]*)/g, "");}; String.prototype.rTrim = function(){return this.replace(/([\s]*$)/g, "");}; if(typeof Array.indexOf != "function") Array.prototype.indexOf = function(arg, n){ var i = isNaN(n) || n < 0 ? 0 : n; for(; i < this.length; i++) if(this[i] == arg) return i; return -1; }; var AsControl = { _getDefaultOpenStyle:function() { return "width="+screen.availWidth+"px,height="+screen.availHeight+"px,top=0,left=0,toolbar=no,scrollbars=yes,resizable=yes,status=no,menubar=no"; }, _getDefaultDialogStyle:function() { return "dialogWidth:"+screen.availWidth+"px;dialogHeight:"+screen.availHeight+"px;resizable:yes;maximize:yes;help:no;status:no;"; }, _getDialogStyle:function(sStyle) { if(typeof(sStyle)=="undefined" || sStyle=="") return this._getDefaultDialogStyle(); else return sStyle; }, _getParaString:function(sPara) { if(typeof(sPara)=="undefined" || sPara=="") { return ""; } else if (sPara.substring(0,1)=="&") { return encodeURI(encodeURI(sPara)); } else { return "&"+encodeURI(encodeURI(sPara)); } }, randomNumber:function() { return Math.abs(Math.sin(new Date().getTime())).toString().substr(2); } }; AsControl.OpenObjectTab = function(sPara){ if(sPara.indexOf("ObjectType=")<0){ alert("参数串必须有ObjectType定义!"); return; } if(sPara.indexOf("ObjectNo=")<0){ alert("参数串必须有ObjectNo定义!"); return; } /*if(sPara.indexOf("ViewID=")<0){ alert("参数串必须有ViewID定义!"); return; }*/ this.PopView("/Frame/ObjectTab.jsp", sPara); }; AsControl.OpenObject = function(sObjectType,sObjectNo,sViewID,sStyle){ return OpenObject(sObjectType,sObjectNo,sViewID,sStyle); // }; AsControl.PopObject = function(sObjectType,sObjectNo,sViewID,sDialogStyle,sDialogParas){ return PopObject(sObjectType,sObjectNo,sViewID,sDialogStyle,sDialogParas); // }; AsControl.OpenPage = function(sURL,sPara,sTargetWindow,sStyle) { if(typeof(sURL)=="undefined" || sURL=="") { alert("系统繁忙,请关掉窗口或刷新后重试!"); return false; } if(sURL.indexOf("?")>=0){ alert("URL中存在\"?\"!"); return false; } if(sTargetWindow=="_blank") { alert("弹出的页面不能使用OpenPage函数!"); return false; } var temp_targetWindow=""; try{ temp_targetWindow = Layout.getRegionName(sTargetWindow); sTargetWindow=temp_targetWindow; }catch(e){ } var sWindowToUnload; if(sTargetWindow==null || sTargetWindow=="_self"){ sWindowToUnload="self"; }else if(sTargetWindow=="_top"){ sWindowToUnload="top"; }else if(sTargetWindow=="_blank"){ sWindowToUnload=""; }else if(sTargetWindow=="_parent"){ sWindowToUnload="parent"; }else sWindowToUnload=sTargetWindow; try{ oWindow = eval(sWindowToUnload); }catch(e){ } if(window.checkOpenUrlModified != false){ try{ oWindow = eval(sWindowToUnload); if(!oWindow.checkModified()) return; }catch(e){ try{if(!parent.frames[sWindowToUnload].checkModified()) return;}catch(e2){} } } var sPageURL=sWebRootPath+sURL; if(sURL.indexOf("?")<0) {sPageURL = sPageURL+"?"; } else if (sURL.substr(sURL.length-1)!="?"){sPageURL = sPageURL+"&";} sPageURL = sPageURL + "CompClientID="+sCompClientID+this._getParaString(sPara)+"&randp="+this.randomNumber(); this.switchDiv(sTargetWindow); if(typeof(sStyle)=="undefined") sStyle=AsControl._getDefaultOpenStyle(); window.open(sPageURL,sTargetWindow,sStyle); }; AsControl.OpenCompNewWin = function(sURL,sPara,sStyle) { if(sURL.indexOf("?")>=0) { alert("URL中存在\"?\"!"); return false; } var sCompPara = sPara; while(sCompPara.indexOf("&")>=0) sCompPara = sCompPara.replace("&","$[and]"); var sPageURL = sWebRootPath+"/RedirectorDialog?&TargetWindow=_blank&DiaglogURL=/Frame/page/control/OpenCompDialog.jsp&ComponentURL="+sURL+this._getParaString("CompPara="+sCompPara); window.open(sPageURL,"_blank",this._getDefaultOpenStyle()); }; AsControl.OpenComp = function(sURL,sPara,sTargetWindow,sStyle) { if(sURL.indexOf("?")>=0) { alert("URL中存在\"?\"!"); return false; } sTargetWindow = Layout.getRegionName(sTargetWindow); var sToDestroyClientID=""; var sWindowToUnload = sTargetWindow; if(sTargetWindow=="_blank") { return this.PopComp(sURL,sPara); }else{ if(sTargetWindow==null || sTargetWindow=="_self") sWindowToUnload="self"; else if(sTargetWindow=="_top") sWindowToUnload="top"; try{ oWindow = eval(sWindowToUnload); sToDestroyClientID = oWindow.sCompClientID; if (sWindowToUnload !="self" && sWindowToUnload !="top" && sToDestroyClientID==sCompClientID) sToDestroyClientID = ""; }catch(e){ sToDestroyClientID = ""; } if(window.checkOpenUrlModified != false){ try{if(!oWindow.checkModified()) return;}catch(e1){ try{if(!parent.frames[sWindowToUnload].checkModified()) return;}catch(e2){} } } } if(typeof(sToDestroyClientID)=="undefined" || sToDestroyClientID=="") {sToDestroyClientID="&TargetWindow="+sTargetWindow;} else {sToDestroyClientID="&TargetWindow="+sTargetWindow+"&ToDestroyClientID="+sToDestroyClientID;} var sPageURL = sWebRootPath + "/Redirector?OpenerClientID="+sCompClientID+sToDestroyClientID+"&ComponentURL="+sURL+this._getParaString(sPara); this.switchDiv(sTargetWindow); this._OpenIFrame(sPageURL,sTargetWindow); }; AsControl._OpenIFrame = function(sPageURL,sIFrame) { if (!document.body) { window.open(sPageURL,sIFrame); return; } var a = document.createElement('a'); a.setAttribute('href', sPageURL); a.setAttribute('target',sIFrame); a.setAttribute('id', "ID_"+sIFrame); document.body.appendChild(a); a.click(); document.body.removeChild(a); } /** * 校验窗口内所有页面是否都未做修改 * @param win 被校验的窗口对象,如window、self、top或frames[name]等 * @returns {boolean} true 校验通过,false 校验不通过 */ AsControl.CheckWindowModified = function(win){ try{ if(typeof win.checkModified == "function" && !win.checkModified()) return false; } catch (e) {return true;} for(var i = 0; i < win.frames.length; i++){ if(!AsControl.CheckWindowModified(win.frames[i])) return false; } return true; }; /** * 根据iFrame的字符串名字获取iFrame对象 * @param sFrame iFrame的字符串名字 * @returns iFrame对象 */ AsControl.getOFrame = function(sFrame) { var frame = null; if(typeof sFrame !== "string") return frame; if(sFrame === "_top"){ frame = top; }else if(sFrame == self.name || sFrame === "_self"){ frame = window; }else{ var win = window; while(true){ try {frame = win.frames[sFrame];} catch(e){break;} if(frame) break; if(win.parent === win) break; win = win.parent; } } return frame; } AsControl.switchDiv = function(sTargetWindow) { if(window.showDiv==false) return; var frame = AsControl.getOFrame(sTargetWindow); if(!frame) return; try {frame.document;} catch(e){return;} var doc = frame.document; if(!doc || !doc.body) return; try { var switch_mask_div = doc.getElementById("switch_page_mask"); if (switch_mask_div) { switch_mask_div.style.display="block"; return; } var sm_child_div_span = doc.createElement("span"); sm_child_div_span.style.cssText = "color:#772200;display:block;font-size:14px"; sm_child_div_span.textContent="页面切换中,请等待......"; var sm_child_count_span = doc.createElement("span"); sm_child_count_span.id = "switch_page_mask_count"; sm_child_div_span.appendChild(sm_child_count_span); var sm_child_div = doc.createElement("div"); sm_child_div.style.cssText = "position:absolute;left:0;top:0;width:100%;height:100%;background:#e8e8e8;filter:alpha(opacity=60);opacity:0.6;z-index:-1;"; var width = Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth)-20; var height = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight)-20; var sm_div = doc.createElement("div"); sm_div.id = "switch_page_mask"; sm_div.style.cssText = "position:absolute;left:0;top:0;width:"+width+"px;height:"+height+"px;text-align:center;z-index:9999;"; if(!doc || !doc.body) return; sm_div.appendChild(sm_child_div); sm_div.appendChild(sm_child_div_span); doc.body.appendChild(sm_div); } catch (e) {}; var mask_timer = setTimeout(function(){ try{ if(!frame||!doc || !doc.body) {clearTimeout(mask_timer);return;} frame.switchDivFlag=true; var mask_interval= setInterval(function(){ try{ if(!frame||!doc || !doc.body) {clearInterval(mask_interval);return;} var switch_page_mask_count = doc.getElementById("switch_page_mask_count"); if (!switch_page_mask_count) {clearInterval(mask_ierval);return;} var time = parseInt(switch_page_mask_count.textContext||switch_page_mask_count.innerText, 10); if(isNaN(time)) time = 0; switch_page_mask_count.textContent =""+ (++time); //console.log("time:"+time+"switch_page_mask_count.textContent:"+switch_page_mask_count.textContent+"switchDivFlag:"+frame.switchDivFlag); //console.trace(); if (time > 60 || !frame.switchDivFlag) {clearInterval(mask_interval);return;} }catch(e){clearInterval(mask_interval);} }, 1000); }catch(e){} }, 100); } ; AsControl.showReadyMessage = function(msg) { var top =AsDialog._getTop(); try {top.document;} catch(e){return;} var doc = top.document; if(!doc || !doc.body) return; try { var switch_mask_div = doc.getElementById("page_ready_mask"); if (switch_mask_div) { switch_mask_div.style.display="block"; return; } var sm_child_div_span = doc.createElement("span"); sm_child_div_span.style.cssText = "color:#668800;display:block;font-size:14px;padding:100px"; sm_child_div_span.textContent="页面正在初始化,请稍等......"; if (msg ) sm_child_div_span.textContent=msg; var sm_child_div = doc.createElement("div"); sm_child_div.style.cssText = "position:absolute;left:0;top:0;width:100%;height:100%;background:#e8e8e8;filter:alpha(opacity=60);opacity:0.6;z-index:-1;"; var width = Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth); var height = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight); var sm_div = doc.createElement("div"); sm_div.id = "page_ready_mask"; sm_div.style.cssText = "position:absolute;display:block;left:0;top:0;width:"+width+"px;height:"+height+"px;text-align:center;z-index:10001;"; sm_div.appendChild(sm_child_div); sm_div.appendChild(sm_child_div_span); doc.body.appendChild(sm_div); switch_mask_div = doc.getElementById("page_ready_mask"); } catch (e) {}; } ; AsControl.hideReadyMessage = function() { var top =AsDialog._getTop(); try {top.document;} catch(e){return;} var doc = top.document; if(!doc || !doc.body) return; try { var switch_mask_div = doc.getElementById("page_ready_mask"); if (switch_mask_div) { switch_mask_div.style.display="none"; return; } } catch (e) {}; } ; AsControl.PopPage = function(sURL,sPara,sStyle,dialogArgs){ if(sURL.indexOf("?")>=0){ alert("错误:页面URL中存在\"?\"。请将页面参数在第二个参数中传入!"); return false; } var sDialogStyle = this._getDialogStyle(sStyle); var sPageURL = sWebRootPath+"/RedirectorDialog?DiaglogURL="+sURL+"&OpenerClientID="+sCompClientID+"&ComponentURL="+sURL+this._getParaString(sPara); if (!window.showModalDialog) {alert("本功能PopPage暂时只支持IE11!"); console.trace();return;} if (typeof(dialogArgs) == "undefined" ) dialogArgs=self; return window.showModalDialog(sPageURL,dialogArgs,sDialogStyle); }; AsControl.PopPageEx = function(sURL,sPara,oTarget,sStyle){ if(sURL.indexOf("?")>=0){ alert("错误:页面URL中存在\"?\"。请将页面参数在第二个参数中传入!"); return false; } var sDialogStyle = this._getDialogStyle(sStyle); var sPageURL = sWebRootPath+"/RedirectorDialog?DiaglogURL="+sURL+"&OpenerClientID="+sCompClientID+"&ComponentURL="+sURL+this._getParaString(sPara); if (!window.showModalDialog) {alert("本功能showModalDialog暂时只支持IE11!"); console.trace();return;} return window.showModalDialog(sPageURL,oTarget,sDialogStyle); }; AsControl.PopComp = function(sURL,sPara,sStyle,dialogArgs){ if(sURL.indexOf("?")>=0) { alert("URL中存在\"?\"!"); return false; } var sDialogStyle = this._getDialogStyle(sStyle); var sCompPara = sPara; while(sCompPara.indexOf("&")>=0) sCompPara = sCompPara.replace("&","$[and]"); var sPageURL = sWebRootPath+"/RedirectorDialog?DiaglogURL=/Frame/page/control/OpenCompDialog.jsp&OpenerClientID="+sCompClientID+"&ComponentURL="+sURL+this._getParaString("CompPara="+sCompPara); if (!window.showModalDialog) {alert("本功能PopComp暂时只支持IE11!"); console.trace();return;} if (typeof(dialogArgs) == "undefined" ) dialogArgs=self; return window.showModalDialog(sPageURL,dialogArgs,sDialogStyle); }; AsControl.OpenPageOld = function(sURL,sTargetWindow,sStyle) { if(sTargetWindow=="_blank") { alert("弹出的页面不能使用OpenPage函数!");} var sPageURL=sURL; var sPara = ""; if(sURL.indexOf("?")>0) { sPageURL = sURL.substring(0,sURL.indexOf("?")); sPara = sURL.substring(sURL.indexOf("?")+1); } this.OpenPage(sPageURL, sPara, sTargetWindow,sStyle); }; AsControl.PopPageOld = function(sURL,sStyle){ var sPageURL=sURL; var sPara = ""; if(sURL.indexOf("?")>0) { sPageURL = sURL.substring(0,sURL.indexOf("?")); sPara = sURL.substring(sURL.indexOf("?")+1); } return this.PopPage(sPageURL, sPara, sStyle); }; AsControl.OpenView = function(sURL,sPara,sTargetWindow,sStyle){ return this.OpenComp(sURL,sPara,sTargetWindow,sStyle);}; AsControl.PopView = function(sURL, sPara, sStyle, dialogArgs){ return this.PopComp(sURL, sPara, sStyle, dialogArgs);}; AsControl.DestroyComp = function (ToDestroyClientID) { $.ajax({url: sWebRootPath+"/Frame/page/control/DestroyCompAction.jsp?ToDestroyClientID="+ToDestroyClientID,async: false}); }; AsControl.RunJavaMethod = function (ClassName,MethodName,Args) { return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,""),ClassName); }; AsControl.RunJavaMethodSqlca = function (ClassName,MethodName,Args) { return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,"&ArgsObject=Sqlca"),ClassName); }; AsControl.RunJavaMethodTrans = function (ClassName,MethodName,Args) { return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,"&ArgsObject=Trans"),ClassName); }; AsControl.ExportFinanceReport = function(sObjectType, sObjectNo, sReportScope, sReportDate){ var sParam; if(arguments.length == 1) sParam = "ReportNo="+arguments[0]; else sParam = "ObjectType="+ObjectType+",ObjectNo="+sObjectNo+",ReportScope="+sReportScope+",ReportDate="+sReportDate; var sReportExcelPath = AsControl.RunJavaMethodSqlca("com.amarsoft.biz.finance.ExportExcel", "run", sParam); if(!sReportExcelPath) return; if(!frames["exportfsframe"]) $("<iframe name='exportfsframe' style='display:none;'></iframe>").appendTo("body"); window.open(sWebRootPath+"/servlet/view/file?CompClientID="+sCompClientID+"&filename="+sReportExcelPath+"&viewtype=download", "exportfsframe"); }; AsControl.CallJavaMethodJSP = function (ClassName,MethodName,Args,ArgsObjectText) { return $.ajax({ url: sWebRootPath+"/Frame/page/sys/tools/RunJavaMethod.jsp?ClassName="+ClassName+"&MethodName="+MethodName+this._getParaString("Args="+Args)+ArgsObjectText, async: false }).responseText.trim(); }; AsControl.CallJavaMethod = function (ClassName,MethodName,Args,ArgsObjectText) { return $.ajax({ type: "POST", url: sWebRootPath+"/servlet/run?1=1"+ArgsObjectText, data : { "ClassName":ClassName, "MethodName":MethodName, // FIXME 加号替换,请修改为特殊字符,见com.amarsoft.awe.control.RunJavaMethodServlet.doGet "Args":encodeURI(Args.replace(/\+/g, 'Ж').replace(/\%/g, 'ё')) }, async: false }).responseText.trim(); }; AsControl.GetJavaMethodReturn = function (sReturnText,ClassName) { /*window.onerror = function(msg, url, line) { if(msg.indexOf("AWS0003")>0||msg.indexOf("!DOCTYP")>0){ alert("运行异常:【操作超时】:可能是网络故障或您的电脑长时间未操作造成的页面超时,请重新登录!") return ; } console.trace(); alert("运行异常: " + msg + "\n"); //alert("JS异常: " + msg + "\n" + goUrlName(sWebRootPath,url) + ":" + line); return true; }; */ if (typeof(sReturnText)=='undefined' || sReturnText.length<8) { var msg="【AWES0007】后台服务调用出错!\n【"+ClassName+"】"; alert("运行异常: " + msg + "\n"); throw new Error(msg); } if(sReturnText.indexOf("AWES0003")>0 || sReturnText.indexOf("!DOCTYP")>0){ alert("运行异常:【操作超时】:可能是网络故障或您的电脑长时间未操作造成的页面超时,请重新登录!"); AsControl.OpenPage("/Frame/page/sys/SessionExpire.jsp", "", "_top", ""); return ; } var rCode = sReturnText.substring(0,8); if (rCode != '00000000') { var msg="【"+rCode+"】"+sReturnText.substring(8)+"\n【"+ClassName+"】"; alert("运行异常: " + msg + "\n"); throw new Error(msg); } sReturnText = sReturnText.substring(8); if(sReturnText.length>0 && sReturnText.substring(0,1)=="{") return eval("("+ sReturnText +")"); else{ sReturnText=this.clearString(sReturnText); return sReturnText; } }; AsControl.clearString=function(sReturnText){ try{ if(typeof(sReturnText)!="undefined"){ if(sReturnText.indexOf("系统错误")>0){ var tempText=sReturnText.split("系统错误"); sReturnText=tempText[tempText.length-1]; sReturnText=this.replaceAll(sReturnText,":",""); sReturnText=this.replaceAll(sReturnText,"执行script时出错",""); sReturnText=this.replaceAll(sReturnText,"com.amarsoft.app.als.sys.function.action.BizFunctionAction",""); sReturnText=this.replaceAll(sReturnText,"执行Bizlet时出错",""); sReturnText=this.replaceAll(sReturnText,"Bizlet",""); sReturnText=this.replaceAll(sReturnText,"。",""); sReturnText=this.replaceAll(sReturnText,":",""); sReturnText=this.replaceAll(sReturnText,":",""); sReturnText=this.replaceAll(sReturnText,":[",""); sReturnText=this.replaceAll(sReturnText,"]]",""); sReturnText=this.replaceAll(sReturnText,"]]",""); sReturnText=this.replaceAll(sReturnText,"[[",""); sReturnText=this.replaceAll(sReturnText,"[[",""); sReturnText=this.replaceAll(sReturnText,"FinishPutOut",""); sReturnText=this.replaceAll(sReturnText,"[]",""); sReturnText=this.replaceAll(sReturnText,"com.amarsoft.app.als.sys.function.action.BizFunctionAction",""); sReturnText=this.replaceAll(sReturnText,"执行Function错误","交易失败!"); return sReturnText; } } }catch(e){ alert(e.message); } return sReturnText; }; AsControl.replaceAll=function(sSource,sOldString,sNewString){ try{ if(typeof(sSource)!='string') return sSource; var iPosBegin = 0; sReturn = sSource; //alert(sReturn+"\r\n"+sOldString+"\r\n"+sNewString); iPosBegin = sReturn.indexOf(sOldString,iPosBegin); while(iPosBegin>=0){ //sReturn = sReturn.replace(sOldString,sNewString); sReturn = sReturn.substring(0,iPosBegin)+sNewString+sReturn.substring(iPosBegin+sOldString.length); iPosBegin = sReturn.indexOf(sOldString,iPosBegin+sNewString.length); } return sReturn; }catch(e){ alert(e.name+" "+e.number+" :"+e.message); } }; AsControl.RunJsp = function(sURL,sPara,fun) { if(sURL.indexOf("?")>=0){ alert("错误:页面URL中存在\"?\"。请将页面参数在第二个参数中传入!"); return false; } var sPageURL = sWebRootPath+sURL+"?CompClientID="+sCompClientID+this._getParaString(sPara); if(typeof fun == "function"){ return $.ajax({url:sPageURL,type:"POST",processData:false,async:true,success:fun}); }else{ return $.ajax({url:sPageURL,async:false}).responseText.trim(); } }; AsControl.RunJspOne = function(sURL) { var sPageURL=sURL; var sPara = ""; if(sURL.indexOf("?")>0) { sPageURL = sURL.substring(0,sURL.indexOf("?")); sPara = sURL.substring(sURL.indexOf("?")+1); } return this.RunJsp(sPageURL, sPara); }; AsControl.RunASMethod = function(ClassName,MethodName,Args) { return this.RunJsp("/Common/ToolsB/RunMethodAJAX.jsp","ClassName="+ClassName+"&MethodName="+MethodName+"&Args="+Args); }; AsControl.getErrMsg = function (MsgNo) { var ClassName="com.amarsoft.awe.res.ErrMsgManager"; var MethodName="getText"; var Args="MsgNo="+MsgNo; return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,""),ClassName); }; var OpenStyle=AsControl._getDefaultOpenStyle(); function randomNumber() { return AsControl.randomNumber();} function OpenComp(sCompID,sCompURL,sPara,sTargetWindow,sStyle) {return AsControl.OpenComp(sCompURL,sPara,sTargetWindow,sStyle);} function openComp(sCompID,sCompURL,sPara,sTargetWindow,sStyle) {return AsControl.OpenComp(sCompURL,sPara,sTargetWindow,sStyle);} function PopComp(sComponentID,sComponentURL,sParaString,sStyle) {return AsControl.PopComp(sComponentURL,sParaString,sStyle);} function popComp(sComponentID,sComponentURL,sParaString,sStyle) {return AsControl.PopComp(sComponentURL,sParaString,sStyle);} function PopPage(sURL,sTargetWindow,sStyle) {return AsControl.PopPageOld(sURL,sStyle);} function OpenPage(sURL,sTargetWindow,sStyle) {return AsControl.OpenPageOld(sURL,sTargetWindow,sStyle);} function RunJavaMethod(ClassName,MethodName,Args) {return AsControl.RunJavaMethod(ClassName,MethodName,Args);} function RunJavaMethodSqlca(ClassName,MethodName,Args) {return AsControl.RunJavaMethodSqlca(ClassName,MethodName,Args);} function RunJavaMethodTrans(ClassName,MethodName,Args) {return AsControl.RunJavaMethodTrans(ClassName,MethodName,Args);} function PopPageAjax(sURL,sTargetWindow,sStyle){return AsControl.RunJspOne(sURL);} function RunJspAjax(sURL,sTargetWindow,sStyle){return AsControl.RunJspOne(sURL);} function RunMethod(ClassName,MethodName,Args){return AsControl.RunASMethod(ClassName,MethodName,Args); } function getMessageText(iNo) { return AsControl.getErrMsg(iNo);} function openObjectInFrame(sObjectType,sObjectNo,sViewID,sFrameID){ AsControl.OpenComp("/Frame/ObjectViewer.jsp","ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID,sFrameID,""); } function openObject(sObjectType,sObjectNo,sViewID,sStyle){ AsControl.PopComp("/Frame/ObjectViewer.jsp","ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID,sStyle); } function openObjectNewWin(sObjectType,sObjectNo,sViewID,sStyle){ AsControl.OpenCompNewWin("/Frame/ObjectViewer.jsp","ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID,sStyle); } function OpenObject(sObjectType,sObjectNo,sViewID,sStyle){ openObject(sObjectType,sObjectNo,sViewID,sStyle); } function popObject(sObjectType,sObjectNo,sViewID,sDialogStyle){ AsControl.PopComp("/Frame/ObjectViewer.jsp","ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID,sDialogStyle); } function PopObject(sObjectType,sObjectNo,sViewID,sDialogStyle){ popObject(sObjectType,sObjectNo,sViewID,sDialogStyle); } function setWindowTitle(sTitle) { top.document.title=sTitle+"                                                                                                                                                          "; } function setDialogTitle(sTitle) { var tempWindow = self; do{ var title=getDialogTitle(); if(typeof(title)!="undefined" && title.length>0) return ; if(typeof tempWindow.setTopTitle == "function"){ tempWindow.setTopTitle(sTitle); break; } if(tempWindow == tempWindow.parent) break; tempWindow = tempWindow.parent; }while(true); } function getDialogTitle(){ var tempWindow = self; do{ if(typeof tempWindow.getTopTitle == "function"){ return tempWindow.getTopTitle(); } if(tempWindow == tempWindow.parent) break; tempWindow = tempWindow.parent; }while(true); } var AsDialog = { OpenSelector : function(sObjectType,sParaString,sStyle){ return selectObjectValue(sObjectType,sParaString,sStyle); //使用在SELECT_CATALOG中自定义查询选择信息 }, OpenSelectorCB : function(sObjectType,sParaString,sStyle, resolve){ AsDialog.selectCatalogDialog(sObjectType,sParaString,sStyle,resolve); }, SelectGridValue : function(sDoNo, sArgs, sFields, aSelected, isMulti, sStyle){ if(!sStyle) sStyle = "dialogWidth:700px;dialogHeight:500px;resizable:no;maximize:yes;help:no;status:no;"; if(sFields.indexOf("=") > -1){ return this.SetGridValue(sDoNo, sArgs, sFields, aSelected, sStyle); } var sPageURL = sWebRootPath+"/RedirectorDialog?DiaglogURL=/Frame/page/control/OpenCompDialog.jsp&OpenerClientID="+sCompClientID+"&ComponentURL=/Frame/page/tools/SelectDialog.jsp"+AsControl._getParaString("CompPara=SelectDialogUrl=/Frame/page/tools/SelectGridDialog.jsp&DoNo="+sDoNo+"&Parameters="+sArgs+"&Fields="+sFields+"&IsMulti="+isMulti); if (!window.showModalDialog) {alert("本功能SelectGridValue暂时只支持IE11!"); console.trace();return;} return window.showModalDialog(sPageURL,aSelected,sStyle); }, SelectGridValueCB : function(sDoNo, sArgs, sFields, aSelected, isMulti, sStyle, callback){ if(!sStyle) sStyle = "dialogWidth:700px;dialogHeight:500px;resizable:no;maximize:yes;help:no;status:no;"; var sSelected = aSelected; if ($.isArray(aSelected)) {sSelected = aSelected.join("@");} var sURL = "/Frame/page/tools/SelectDialog.jsp"; var sPara ="SelectDialogUrl=/Frame/page/tools/SelectGridDialog.jsp&DoNo="+sDoNo+"&Parameters="+sArgs+"&Fields="+sFields+"&IsMulti="+isMulti+"&ASelected="+sSelected; this.PopView(sURL,sPara,sStyle,callback); }, SetGridValue : function(sDoNo, sArgs, sFieldValues, aSelected, sStyle){ if(sFieldValues.indexOf("=") < 0){ return this.SelectGridValue(sDoNo, sArgs, sFieldValues, aSelected, false, sStyle); } var fieldValues = sFieldValues.split("@"); var fields = ""; var terminis = new Array(); var keyValue; for(var i = 0; i < fieldValues.length; i++){ if(fieldValues[i].indexOf("=") < 0) continue; keyValue = fieldValues[i].split("="); if(keyValue.length < 2 || keyValue[0] == "" || keyValue[1] == "") continue; terminis[terminis.length] = keyValue[0]; if(fields != "") fields += "@"; fields += keyValue[1]; } var sReturn = this.SelectGridValue(sDoNo, sArgs, fields, aSelected, false); if(!sReturn) return; if(sReturn == "_CLEAR_"){ if(typeof setItemValue == "function" && typeof getRow == "function"){ for(var i = 0; i < terminis.length; i++){ setItemValue(0, getRow(), terminis[i], ""); } } }else{ if(typeof setItemValue == "function" && typeof getRow == "function"){ var values = sReturn.split("@"); for(var i = 0; i < terminis.length; i++){ setItemValue(0, getRow(), terminis[i], values[i]); } } } return sReturn; }, SetGridValueCB : function(sDoNo, sArgs, sFieldValues, aSelected, sStyle,callback){ if(sFieldValues.indexOf("=") < 0){ return this.SelectGridValueCB(sDoNo, sArgs, sFieldValues, aSelected, false, sStyle,callback); } var fieldValues = sFieldValues.split("@"); var terminis = new Array(); // 接收字段 var fields = ""; // 返回字段 for(var i = 0; i < fieldValues.length; i++){ if(fieldValues[i].indexOf("=") < 0) continue; var keyValue = fieldValues[i].split("="); if(keyValue.length < 2 || keyValue[0] == "" || keyValue[1] == "") continue; terminis[terminis.length] = keyValue[0]; if(fields != "") fields += "@"; fields += keyValue[1]; } this.SelectGridValueCB(sDoNo, sArgs, fields, aSelected, false, sStyle, function(sObjectNoString){ AsDialog._setItemValues(terminis,sObjectNoString,false); if (jQuery.isFunction(callback)) {callback(sObjectNoString);} }); }, _getTop:function() { var mytop=window; var exttest=false; try{ !top.contentDocument; mytop = top; if (mytop.location.host != window.location.host) {exttest=true;} }catch(er){exttest=true;} if (exttest) { var mywin=window; mytop = window; while(true){ try { mytop = mytop.parent; if (mytop.location.host != window.location.host) {mytop = mywin; break;} !mytop.contentDocument; mywin = mytop; }catch(er){mytop = mywin; break;} } } if (!mytop.dialog) { AsDialog.InitDialog(mytop); } return mytop; }, InitDialog : function(mytop){ if (typeof(mytop.$)!="undefined") { mytop.$("head").append('<script type="text/javascript" charset="UTF-8" src="'+sWebRootPath+'/Frame/resources/js/dialog/dialog-min.js"></script>'); mytop.$("head").append('<link rel="stylesheet" type="text/css" href="'+sWebRootPath+'/Frame/page/resources/css/dialog.css">'); } }, _PopupPage : function(pageinfo,callback){ if (!$.isPlainObject(pageinfo)) {alert("Arguments is not fit!");return;} var sURL=pageinfo.url; var sPageURL = sWebRootPath + "/RedirectorDialog?DiaglogURL="+sURL+"&OpenerClientID="+sCompClientID+"&TargetWindow=Popup&ComponentURL="+sURL+AsControl._getParaString(pageinfo.para); var top =AsDialog._getTop(); var maxWidth=top.document.body.offsetWidth-2; var maxHeight=top.document.body.offsetHeight-2; if (pageinfo.width >maxWidth) pageinfo.width=maxWidth; if (pageinfo.height >maxHeight) pageinfo.height=maxHeight; var d = top.dialog({ width:pageinfo.width, height:pageinfo.height, cancel: function() { if(window.checkOpenUrlModified != false){ try{if(!AsControl.CheckWindowModified(top)) return false;}catch(e1){ } } }, cancelDisplay:false, resize:true, url:sPageURL }); if (pageinfo.title) d.title(pageinfo.title); d.addEventListener('close', function () { var sReturnValue=this.returnValue; //jQuery.ajax({url: sWebRootPath+"/Frame/page/control/DestroyCompAction.jsp?ToDestroyClientID="+sCompClientID+"&TargetWindow=Popup",async: false}); var did = this.id; this.remove(); var dels=top.document.getElementsByName(did); if (dels.length >0) { dels[0].parentNode.removeChild(dels[0]); } if (jQuery.isFunction(callback)) { setTimeout(function(){callback(sReturnValue);}); } else { alert("You Selected is \n\r["+sReturnValue+"]\n\rPlease set callback Function to handled!"); } }); d.returnValue=undefined; d.showModal(); }, /** * 通用的选择器,内嵌的SelectDialogUrl页面需实现doSure()方法,并将返回值以parent.closeDialog(返回值);的形式返回给选择器 * @param dialoginfo * @param callback */ SelectCommonDialog : function(dialoginfo,callback){ if (!jQuery.isFunctionPlainObject(dialoginfo)) {alert("Arguments is not fit!");return;} var pageinfo = { width: dialoginfo.width, height:dialoginfo.height, title: dialoginfo.title, para: dialoginfo.para.indexOf("SelectDialogUrl")<0 ? "SelectDialogUrl="+dialoginfo.para : dialoginfo.para, url:"/Frame/page/tools/dialog/SelectDialog.jsp" }; this._PopupPage(pageinfo,callback); }, selectCatalogDialog:function(sObjectType,sParaString,sStyle,callback){ var pageinfo = { width:this._getStyleDialogWidth(sStyle,700), height:this._getStyleDialogHeight(sStyle,540), url:"/Frame/DialogSelect.jsp", para:"SelName="+sObjectType+"&ParaString="+sParaString, title: '请选择:' }; this._PopupPage(pageinfo,callback); }, selectObjectInfo:function(sObjectType,sParaString,sStyle,callback){ var pageinfo = { width:this._getStyleDialogWidth(sStyle,700), height:this._getStyleDialogHeight(sStyle,540), url:"/Frame/page/tools/dialog/SelectObject.jsp", para:"ObjectType="+sObjectType+"&ParaString="+sParaString, title: '请选择:' }; this._PopupPage(pageinfo,callback); }, setObjectInfo:function(sObjectType,sValueString,iArgDW,iArgRow,sStyle,callback){ if(typeof(sStyle)=="undefined" || sStyle=="") sStyle = "dialogWidth:700px;dialogHeight:540px;"; if (jQuery.isFunction(sStyle)) {callback=sStyle; sStyle = "dialogWidth:700px;dialogHeight:540px;"} var iDW = iArgDW; if(iDW == null) iDW=0; var iRow = iArgRow; if(iRow == null) iRow=0; var sValues = sValueString.split("@"); var sParaString = sValues[0]; var i=sValues.length; i=i-1; if (i%2!=0){ alert("setObjectInfo()返回参数设定有误!\r\n格式为:@ID列名@ID在返回串中的位置..."); return; }else{ var j=i/2,m,sColumn,iID; this.selectObjectInfo(sObjectType,sParaString,sStyle,function(sObjectNoString){ if(typeof(sObjectNoString)=="undefined" || sObjectNoString=="null" || sObjectNoString==null || sObjectNoString=="_CANCEL_"){ return; }else if(sObjectNoString=="_CLEAR_"){ for(m=1;m<=j;m++){ sColumn = sValues[2*m-1]; if(sColumn!="") setItemValue(iDW,iRow,sColumn,""); } }else if(sObjectNoString!="_NONE_" && sObjectNoString!="undefined"){ sObjectNos = sObjectNoString.split("@"); for(m=1;m<=j;m++){ sColumn = sValues[2*m-1]; iID = parseInt(sValues[2*m],10); if(sColumn!="") setItemValue(iDW,iRow,sColumn,sObjectNos[iID]); } if (jQuery.isFunction(callback)) {callback(sObjectNoString); } return sObjectNoString; }else{ //alert("选取对象编号失败!对象类型:"+sObjectType); return; } return sObjectNoString; } ); } }, /**主要是使用在select_catalog中自定义查询选择信息 * sObjectType:对象类型 * sValueString格式: 传入参数 @ ID列名 @ ID在返回串中的位置 @ Name列名 @ Name在返回串中的位置 * iArgDW: 第几个DW,默认为0 * iArgRow: 第几行,默认为0 */ setObjectValue:function(sObjectType,sParaString,sValueString,iArgDW,iArgRow,sStyle,callback){ var i=sValueString.split("@").length-1; if (i%2!=0){ alert("setObjectValue()返回参数设定有误!\r\n格式为:@ID列名@ID在返回串中的位置..."); return; }else{ this.selectCatalogDialog(sObjectType,sParaString,sStyle,function(sObjectNoString){ var i=sValueString.split("@").length-1; var sValues = sValueString.split("@"); var iDW = iArgDW; if(isNaN(iDW)) iDW=0; var iRow = iArgRow; if(isNaN(iRow)) iRow=0; var j=i/2,m,sColumn,iID; if(typeof(sObjectNoString)=="undefined" || sObjectNoString=="null" || sObjectNoString==null || sObjectNoString=="_CANCEL_" ){ return; }else if(sObjectNoString=="_CLEAR_"){ for(var m=1;m<=j;m++){ sColumn = sValues[2*m-1]; if(sColumn!="") setItemValue(iDW,iRow,sColumn,""); } }else if(sObjectNoString!="_NONE_" && sObjectNoString!="undefined"){ var sObjectNos = sObjectNoString.split("@"); for(var m=1;m<=j;m++){ sColumn = sValues[2*m-1]; iID = parseInt(sValues[2*m],10); if(sColumn!="") setItemValue(iDW,iRow,sColumn,sObjectNos[iID]); } if (jQuery.isFunction(callback)) {callback(sObjectNoString); } return sObjectNoString; }else{ return; } }); } }, /** * 弹出配置树图选择器,并返回选择内容字符串 * @param sCodeNo 配置树图编号 必须 * @param sReturnFields 返回字段,以@符号分隔 必须 * * @param aSelected {Array} 默认选择数据 字段对应的值 ["F1V1,F1V2,...,F1VN","F2V1,F2V2,...,F2VN",...,"FNV1,FNV2,...,F1VN"] * @param isMulti 选择器树图多选标记,true 多选,否则 单选 * @param onlyLeaf 选择器树图只选功能节点 false 可选文件夹节点 否则 只能选末端叶子节点 * @param sStyle 选择器窗体外观特征,默认宽度为700像素,高度为500像素,不能自由拉伸窗体,不显示状态栏、帮助问号 * * @returns 选择器返回的字符串 单选:F1V@F2V@...@FNV 多选:F1V1@F2V1@...@FNV1~F1V2@F2V2@...@FNV2~F1VN@F2VN@...@FNVN * @belong AsDialog */ SelectConfigTreeValue : function(sCodeNo, sReturnFields, aSelected, isMulti, onlyLeaf, sStyle,callback){ if(sReturnFields.indexOf("=") > -1){ return this.SetConfigTreeValue(sCodeNo, sReturnFields, aSelected, isMulti, onlyLeaf, sStyle); } var sSelected = aSelected; if ($.isArray(aSelected)) {sSelected = aSelected.join("@");} var pageinfo = { width:this._getStyleDialogWidth(sStyle,700), height:this._getStyleDialogHeight(sStyle,500), url:"/Frame/page/tools/dialog/SelectDialog.jsp", para:"SelectDialogUrl=/Frame/page/tools/dialog/SelectCodeTreeDialog.jsp&CodeNo="+sCodeNo+"&ReturnFields="+sReturnFields+"&IsMulti="+isMulti+"&OnlyLeaf="+onlyLeaf+"&ASelected="+sSelected, title: '请选择:' }; this._PopupPage(pageinfo,callback); }, /** * 弹出配置树图选择器,并以选择内容字符串给对应字段赋值 * @param sCodeNo 配置树图编号 必须 * @param sReturnFields 返回并设置字段,FK1=FV1@FK2=FV2@...@FKN=FVN (当前显示模板字段=选择器字段) * @param aSelected {Array} 默认选择数据 字段对应的值 ["F1V1,F1V2,...,F1VN","F2V1,F2V2,...,F2VN",...,"FNV1,FNV2,...,F1VN"] * @param isMulti 选择器树图多选标记,true 多选,否则 单选 * @param onlyLeaf 选择器树图只选功能节点 false 可选文件夹节点 否则 只能选末端叶子节点 * @param sStyle 选择器窗体外观特征,默认宽度为700像素,高度为500像素,不能自由拉伸窗体,不显示状态栏、帮助问号 * @belong AsDialog */ SetConfigTreeValue : function(sCodeNo, sReturnFields, aSelected, isMulti, onlyLeaf, sStyle){ if(sReturnFields.indexOf("=") < 0){ return this.SelectConfigTreeValue(sCodeNo, sReturnFields, aSelected, isMulti, onlyLeaf, sStyle); } var fieldValues = sReturnFields.split("@"); var terminis = new Array(); // 接收字段 var fields = ""; // 返回字段 for(var i = 0; i < fieldValues.length; i++){ if(fieldValues[i].indexOf("=") < 0) continue; var keyValue = fieldValues[i].split("="); if(keyValue.length < 2 || keyValue[0] == "" || keyValue[1] == "") continue; terminis[terminis.length] = keyValue[0]; if(fields != "") fields += "@"; fields += keyValue[1]; } this.SelectConfigTreeValue(sCodeNo, fields, aSelected, isMulti, onlyLeaf, sStyle, function(sObjectNoString){ AsDialog._setItemValues(terminis,sObjectNoString,isMulti); }); }, /** * 弹出树图选择器,并返回选择内容字符串 * @param sDoNo 预定义显示模型编号 必须 * @param sArgs 预定义显示模型参数,规则同OW页面,以“,”分隔 * @param sReturnFields 返回字段,以@符号分隔 必须 * @param sSortField 节点排序字段 必须 * @param sTextField 节点显示字段 必须 * * @param aSelected {Array} 默认选择数据 字段对应的值 ["F1V1,F1V2,...,F1VN","F2V1,F2V2,...,F2VN",...,"FNV1,FNV2,...,F1VN"] * @param isMulti 选择器树图多选标记,true 多选,否则 单选 * @param onlyLeaf 选择器树图只选功能节点 false 可选文件夹节点 否则 只能选末端叶子节点 * @param sStyle 选择器窗体外观特征,默认宽度为700像素,高度为500像素,不能自由拉伸窗体,不显示状态栏、帮助问号 * * @returns 选择器返回的字符串 单选:F1V@F2V@...@FNV 多选:F1V1@F2V1@...@FNV1~F1V2@F2V2@...@FNV2~F1VN@F2VN@...@FNVN * @belong AsDialog */ SelectTreeValue : function(sDoNo, sArgs, sReturnFields, sSortField, sTextField, aSelected, isMulti, onlyLeaf, sStyle,callback){ var sSelected = aSelected; if ($.isArray(aSelected)) {sSelected = aSelected.join("@");} var pageinfo = { width:this._getStyleDialogWidth(sStyle,700), height:this._getStyleDialogHeight(sStyle,500), url:"/Frame/page/tools/dialog/SelectDialog.jsp", para:"SelectDialogUrl=/Frame/page/tools/dialog/SelectTreeDialog.jsp&DoNo="+sDoNo+"&Parameters="+sArgs+"&SortField="+sSortField+"&TextField="+sTextField+"&ReturnFields="+sReturnFields+"&IsMulti="+isMulti+"&OnlyLeaf="+onlyLeaf+"&ASelected="+sSelected, title: '请选择:' }; this._PopupPage(pageinfo,callback); }, /** * 弹出树图选择器,以选择内容字符串给对应字段赋值 * @param sDoNo 预定义显示模型编号 必须 * @param sArgs 预定义显示模型参数,规则同OW页面,以“,”分隔 * @param sReturnFields 返回并设置字段,FK1=FV1@FK2=FV2@...@FKN=FVN (当前显示模板字段=选择器显示模板字段) * @param sSortField 节点排序字段 必须 * @param sTextField 节点显示字段 必须 * @param aSelected {Array} 默认选择数据 字段对应的值 ["F1V1,F1V2,...,F1VN","F2V1,F2V2,...,F2VN",...,"FNV1,FNV2,...,F1VN"] * @param isMulti 选择器树图多选标记,true 多选,否则 单选 * @param onlyLeaf 选择器树图只选功能节点 false 可选文件夹节点 否则 只能选末端叶子节点 * @param sStyle 选择器窗体外观特征,默认宽度为700像素,高度为500像素,不能自由拉伸窗体,不显示状态栏、帮助问号 * @belong AsDialog */ SetTreeValue : function(sDoNo, sArgs, sReturnFields, sSortField, sTextField, aSelected, isMulti, onlyLeaf, sStyle){ if(sReturnFields.indexOf("=") < 0){ return this.SelectTreeValue(sDoNo, sArgs, sReturnFields, sSortField, sTextField, aSelected, isMulti, onlyLeaf, sStyle); } var fieldValues = sReturnFields.split("@"); var terminis = new Array(); // 接收字段 var fields = ""; // 返回字段 for(var i = 0; i < fieldValues.length; i++){ if(fieldValues[i].indexOf("=") < 0) continue; var keyValue = fieldValues[i].split("="); if(keyValue.length < 2 || keyValue[0] == "" || keyValue[1] == "") continue; terminis[terminis.length] = keyValue[0]; if(fields != "") fields += "@"; fields += keyValue[1]; } this.SelectTreeValue(sDoNo, sArgs, fields, sSortField, sTextField, aSelected, isMulti, onlyLeaf, sStyle, function(sObjectNoString){ AsDialog._setItemValues(terminis,sObjectNoString,isMulti); }); }, PopPage : function(sURL,sPara,objectStyle,callback){ var width = 700; var height = 500; var title = "&nbsp"; if ($.isPlainObject(objectStyle)) { if (objectStyle.width) width = objectStyle.width; if (objectStyle.height) height = objectStyle.height; title = objectStyle.title; } else if (typeof objectStyle=="string") { width = this._getStyleDialogWidth(objectStyle,width); height = this._getStyleDialogHeight(objectStyle,height); } var pageinfo = { width:width, height:height, title:title, url:sURL, para:sPara }; this._PopupPage(pageinfo,callback); }, OpenObject:function(sObjectType,sObjectNo,sViewID,objectStyle,callback){ if (!objectStyle) objectStyle =$.parseJSON(RunJspAjax("/Frame/page/tools/object/GetObjectInfo.jsp?ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID)); this.PopView("/Frame/page/tools/object/ObjectViewer.jsp","ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&ViewID="+sViewID,objectStyle,callback); }, PopView : function(sURL,sPara,objectStyle,callback){ var top =AsDialog._getTop(); var width = top.document.body.offsetWidth-2; var height = top.document.body.offsetHeight-2; var title = ""; if ($.isPlainObject(objectStyle)) { if (objectStyle.width) width = objectStyle.width; if (objectStyle.height) height = objectStyle.height; title = objectStyle.title; } else if (typeof objectStyle=="string") { width = this._getStyleDialogWidth(objectStyle,width); height = this._getStyleDialogHeight(objectStyle,height); } var maxWidth=top.document.body.offsetWidth-2; var maxHeight=top.document.body.offsetHeight-2; if (width >maxWidth) width=maxWidth; if (height >maxHeight) height=maxHeight; var initMax=0; if(width==maxWidth&&height==maxHeight) { initMax=1; } var sDialogPara = sPara; while(sDialogPara.indexOf("&")>=0) sDialogPara = sDialogPara.replace("&","$[and]"); var sPageURL = sWebRootPath+"/RedirectorDialog?DiaglogURL=/Frame/page/control/DialogFrame.jsp&OpenerClientID="+sCompClientID+AsControl._getParaString("&DialogTitle="+title)+"&DialogURL="+sURL+AsControl._getParaString("DialogPara="+sDialogPara); if(initMax==0){ var d = top.dialog({ width:width, height:height, cancelDisplay:false, //title:"<span style=\"\color:red\"\>点击此处拖动弹窗</span>", title:"<span class=\"\btn_text\"\>点击此处拖动弹窗</span>", drag:true, fixed:true, url:sPageURL }); }else{ var d = top.dialog({ width:width*0.8, height:height*0.8, cancelDisplay:false, drag:true, fixed:true, url:sPageURL }); } d.addEventListener('close', function () { var sReturnValue=this.returnValue; var did = this.id; this.remove(); var dels=top.document.getElementsByName(did); if (dels.length >0) { dels[0].parentNode.removeChild(dels[0]); } if (jQuery.isFunction(callback)) { setTimeout(function(){callback(sReturnValue);}); } }); d.returnValue=undefined; d.showModal(); }, SetDialogTitle : function(sTitle){ var top =AsDialog._getTop(); var d = top.dialog.getCurrent(); if (d) d.title(sTitle); }, ClosePage : function(sReturnValue){ var top =AsDialog._getTop(); var d = top.dialog.getCurrent();if (!d && top.dialog.list){for (var i in top.dialog.list) {d=top.dialog.list[i];}} if (d) { if (jQuery.isFunction(top.hideButtonTips)){top.hideButtonTips();} d.close(sReturnValue) ; } else { try { if(typeof(top.sObjectInfo)!="undefined" && typeof top.closeAndReturn == "function") { top.sObjectInfo = sReturnValue; top.closeAndReturn(); return; } else if (typeof top.dialogArguments !='undefined' && top==self){ if (typeof(sReturnValue)!="undefined") { top.returnValue=sReturnValue; } top.close(); return; } }catch (e) {alert("e"+e);} } }, RefreshMe : function(){ var top =AsDialog._getTop(); var d = top.dialog.getCurrent();if (!d && top.dialog.list){for (var i in top.dialog.list) {d=top.dialog.list[i];}} if (d) { if (d.iframeNode && d.iframeNode.contentWindow && d.iframeNode.contentWindow.refreshMe) { d.iframeNode.contentWindow.refreshMe(); } } else { try { if(typeof top.refreshMe == "function") { top.refreshMe(); return; } }catch (e) {alert("e"+e);} } }, ResizeDialog : function(){ var top =AsDialog._getTop(); var width = top.document.body.offsetWidth-2; var height = top.document.body.offsetHeight-2; var d = top.dialog.getCurrent(); d.width(width+"px"); d.height(height+"px"); }, _getStyleDialogWidth : function(sStyle, sDefaultValue){ if (!sDefaultValue ) sDefaultValue = 640; if (!sStyle) return sDefaultValue; var aMatch=sStyle.match(/dialogWidth[\s]*[:=][\s]*([\d]+)px/i); if (aMatch) return parseInt(aMatch[1]); aMatch=sStyle.match(/dialogWidth[\s]*[:=][\s]*([\d]+);/i); if (aMatch) return parseInt(aMatch[1]*16); else return sDefaultValue; }, _getStyleDialogHeight : function(sStyle, sDefaultValue){ if (!sDefaultValue ) sDefaultValue = 480; if (!sStyle) return sDefaultValue; var aMatch=sStyle.match(/dialogHeight[\s]*[:=][\s]*([\d]+)px/i); if (aMatch) return parseInt(aMatch[1]); aMatch=sStyle.match(/dialogHeight[\s]*[:=][\s]*([\d]+);/i); if (aMatch) return parseInt(aMatch[1]*16); else return sDefaultValue; }, _setItemValues : function(aField, sValues, isMulti){ if(typeof setItemValue != "function" && typeof getRow != "function") return; if(!sValues) return; if(sValues == "_CLEAR_"){ for(var i = 0; i < aField.length; i++){ setItemValue(0, getRow(), aField[i], ""); } return; }else{ if(typeof setItemValue == "function" && typeof getRow == "function"){ if(isMulti){ var aReturn = sValues.split("~"); var aValues = new Array(); for(var i = 0; i < aReturn.length; i++){ var vs = aReturn[i].split("@"); for(var j = 0; j < aField.length; j++){ if(i == 0) aValues[j] = ""; else aValues[j] += ","; aValues[j] += vs[j]; if(i == aReturn.length - 1) setItemValue(0, getRow(0), aField[j], aValues[j]); } } }else{ var aValues = sValues.split("@"); for(var i = 0; i < aField.length; i++){ setItemValue(0, getRow(), aField[i], aValues[i]); } } } } }, OpenCalender : function(obj,strFormat,startDate,endDate,postEvent,x,y){ if(typeof obj == "string") obj = document.getElementById(obj); if(!obj) return; var today = new Date();//.format(strFormat); //alert([getDate(startDate),getDate(endDate)]); SelectDate(obj,strFormat,getDate(startDate),getDate(endDate),postEvent,x,y); function getDate(sDate){ if(typeof sDate == "string" && sDate.toUpperCase() == "TODAY") return today; if(typeof sDate == "number"){ return new Date(today.getFullYear(), today.getMonth(), today.getDate()+parseInt(sDate, 10)); } return sDate; } } }; if(window == AsDialog._getTop()){ if (typeof($)!="undefined" && typeof(dialog)=="undefined") { $("head").append('<script type="text/javascript" charset="UTF-8" src="'+sWebRootPath+'/Frame/resources/js/dialog/dialog-min.js"></script>'); $("head").append('<link rel="stylesheet" type="text/css" href="'+sWebRootPath+'/Frame/page/resources/css/dialog.css">'); } } if(navigator.appName!="Microsoft Internet Explorer") { if (top && AsDialog) { AsDialog.srctop=top; AsDialog.mytop=AsDialog._getTop(); window.top = AsDialog.mytop; if (window == AsDialog.mytop) { window.parent=AsDialog.mytop}; } } if(navigator.appName!="Microsoft Internet Explorer") { if (Date.prototype.getFullYear) Date.prototype.getYear=Date.prototype.getFullYear; $(document).ready(function() { if (typeof(document.getElementByIdSrc)=="undefined") { document.getElementByIdSrc = document.getElementById; document.getElementById = function (idName) { var obj; try { obj = document.getElementByIdSrc(idName); } catch (e){} if (!obj) { obj = document.getElementsByName(idName)[0]; } return obj; } } }); } 请分析这段代码,然后如何在title里面加入缩放和扩大的按钮
06-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jarry.liu

如果对您有帮助,鼓励下博主吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值