mertmngauth.jsp

来自「培训考试系统代码」· JSP 代码 · 共 208 行

JSP
208
字号
<%@ page language = "java" contentType="text/html;charset=gb2312"%>


<%@ page import = "com.huawei.icd30.common.db.*"%>


<%@ page import = "com.huawei.icd30.agt.util.*" %>



<%    Object sessionRs      =  (SysResultSet)session.getAttribute("MERT_AUTHRES");


      SysResultSet turnOrderRs =  sessionRs == null ?null:(SysResultSet)sessionRs;

%>



<html>


<head>


<title>资料可浏览权限设置选择页面 </title>
<link href="/agt/public/css/gb.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>


<body bgcolor="B7D5F9" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<form name="form1">

  <table width="450" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
    <tr align="center"> 
      <td height="25" class="td-cs1">未具有浏览权限的姓名(工号)</td>
      <td width="100" rowspan="2" class="td-cs2"> 
        <p><br>
          <br>
          <br>
        </p>
        <p> <br>
          <input name="choise1" type="image" onClick="changeOptions('document.forms[0].outStaffNo' ,'document.forms[0].inStaffNo');return false;" src="/agt/public/images/choise1.gif" width="82" height="22" border="0" onMouseOver="this.src='/agt/public/images/'+ this.name + '_2.gif';" onMouseOut="this.src='/agt/public/images/'+ this.name + '.gif'">
          <br>
          <input name="del1" type="image" onclick="changeOptions('document.forms[0].inStaffNo' ,'document.forms[0].outStaffNo');return false;" src="/agt/public/images/del1.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'">
        </p></td>
      <td height="25" class="td-cs1">具有浏览权限的姓名(工号)</td>
    </tr>
    <tr align="center"> 
      <td class="td-cs1"> <select name="outStaffNo" class="listbox" multiple title="未具有浏览权限的姓名(工号)" ondblclick="changeOptions('document.forms[0].outStaffNo' ,'document.forms[0].inStaffNo')">
          <%


        if( turnOrderRs != null && turnOrderRs.getMetaData().getRecordCount() != 0 )


        {


           //此处是用来显示结果


           for(int i=0; turnOrderRs.setRecord(i)&&(i<turnOrderRs.getMetaData().getRecordCount()); i++)


           {


%>
          <option value="<%=turnOrderRs.getString(0)%>"><%=turnOrderRs.getString(1)%>(<%=turnOrderRs.getString(0)%>)</option>
          <%          }


        }


%>
        </select> </td>
      <td class="td-cs1"><select name="inStaffNo" class="listbox" multiple title="具有浏览权限的姓名(工号)" ondblclick="changeOptions('document.forms[0].inStaffNo' ,'document.forms[0].outStaffNo')">
        </select></td>
    </tr>
  </table>
  <table width="450" height="30" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td height="35" align="center"> <table width="44%" height="25" border="0" cellpadding="0" cellspacing="0">
          <tr align="left"> 
            <td width="50%"><input name="ok" type="image" onClick="return returnClass();" src="/agt/public/images/ok.gif" width="82" height="22" border="0" onMouseOver="this.src='/agt/public/images/'+ this.name + '_2.gif';" onMouseOut="this.src='/agt/public/images/'+ this.name + '.gif'"> 
            </td>
            <td width="50%"><input name="cancel" type="image" onclick="window.close();" src="/agt/public/images/cancel.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"> 
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>


  


 


 </body>


 </html>


 


 <script src="/agt/public/js/scriptfuns.js" type="text/javascript"></script>


 <script  language="JavaScript">


function returnClass()


{


    var inStaffNo = document.forms[0].inStaffNo ;


    var rValue = "" ;


    var rAuth = "" ;


    var len = inStaffNo.options.length ;


    for(var i=0 ;i<len ;i++)


    {


        var staffId = inStaffNo.options[i].value ;


        
        if(staffId != null && trim(staffId) != "")


        {


            if(trim(rValue) != "") 
            {
            
                rValue = rValue + "~" + staffId ;
                rAuth = rAuth + "~" + "2";
             }

            else
            {
               rValue = staffId ;
               rAuth = "2";
            }

        }


    }


    opener.document.forms[0].staffNoInfo.value = rValue ;


    opener.document.forms[0].authInfo.value = rAuth ;
    
    window.close() ;


}

  
    
   function init()
    {    
        var staffNo  = opener.document.forms[0].staffNoInfo.value.split("~");
        var outStaffNo = document.forms[0].outStaffNo;
        for( var i = 0; i < staffNo.length; i++)
        {             
             for(var j = 0; j<outStaffNo.length; j++)
             {
                 if(staffNo[i] == outStaffNo[j].value)
                 {
                     var opt = new Option(outStaffNo[j].text,staffNo[i]) ;
                     outStaffNo.options.remove(j);
                     document.forms[0].inStaffNo.add(opt);
                 }
             }
             
        }
        
       
    }
    
    init();

</script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?