personorg.jsp

来自「java jsp教程」· JSP 代码 · 共 163 行

JSP
163
字号
<!-- \jsp\common\personorg.jsp by cuixg 2005-8-17 -->
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>

<%@ page import="com.icss.cnpc.base.vo.*" %>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
<%
List orgList =(List) request.getAttribute("orgList");
String rightType=(String) request.getAttribute("rightType");
System.out.println("personorg.jsp中的rightType---->"+rightType);
String personUuid =(String) request.getAttribute("personUuid");
System.out.println("[Parameter]在personorg.jsp中从PersonOrgListServlet传入的personUuid---->"+personUuid);
String pName = (String) request.getAttribute("pName");
%>
<html>
<head>
<title>授权个人察看部门</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css">
<script language="JavaScript" src="<%=request.getContextPath()%>/common/common.js"></script>
<script language="JavaScript">
/**
 * 查看是否选择了checkbox
 * @param sub_nobody alert提示信息
 * @return true--已选择, false--未选择
 * @author ray
 */
function checkdel(sub_nobody){
  var chosed = 0; 
  with(document.all.tags("INPUT")){
    for(i = 0; i < length; i++ ){
      if( item(i).checked == true && item(i).type == 'checkbox' ){
		  if(item(i).name != "all")
			chosed++;
      }
    }
  }
  if( chosed == 0 ){
    alert( sub_nobody );
    return false;
  }else{
    return true;
  }
}
function _createNew(){
	var url="<%=request.getContextPath()%>/jsp/common/OrgFrame.jsp?personUuid=<%=personUuid%>";
	var screenWidth = screen.Width;// 获取屏幕大小
	var screenHeight = screen.Height;
	var left=screenWidth*2/5;
	var top =screenHeight*1/8;
	var width=screenWidth*1/2;
	var height=screenHeight*3/4;
	window.open(url,"添加新部门",'width='+width+',height='+height+',left='+left+',top='+top+',scrollbars=yes');
}
/**function _add(){
	form1.oprate.value="add";
	var url="<%=request.getContextPath()%>/jsp/base/org/OrgFrame.jsp?personUuid=<%=personUuid%>&rightType=<%=rightType%>";
	var returnval=window.showModalDialog(url,"选择部门","dialogWidth:700px;dialogHeight:450px;dialogLeft:150px;dialogTop:150px;scrollbars:yes;status:no");
	if(returnval!=null){
	  //alert(returnval);
		form1.action="<%=request.getContextPath()%>/servlet/PersonOrgOperateServlet?orgUuid="+returnval;
		form1.submit();
	}
}**/
function _add(){
  form1.oprate.value = "add";
  var screenWidth = screen.Width;// 获取屏幕大小
  var screenHeight = screen.Height;
  var left=screenWidth*2/5;
  var top =screenHeight*1/8;
  var width=screenWidth*1/2;
  var height=screenHeight*1/2;
  var url = "<%=request.getContextPath()%>/jsp/base/org/OrgFrame.jsp?personUuid=<%=personUuid%>&rightType=<%=rightType%>";
  window.open(url,"选择部门",'width='+width+',height='+height+',left='+left+',top='+top+',scrollbars=yes');
}
function _selectAll(){
	var sForm = document.form1;
	if(sForm.orgUuids!=null){
		if(sForm.orgUuids.length!=null){
			for(var i=0;i<sForm.orgUuids.length;i++){
				if(sForm.orgUuids[i].type=="checkbox"){
					if(sForm.all.checked==true){
						 sForm.orgUuids[i].checked=true;
					}
					else{
						 sForm.orgUuids[i].checked=false;
					}
				}
			}
		}else{
			if(sForm.all.checked==true){
				sForm.orgUuids.checked=true;
			}
			else{
				 sForm.orgUuids.checked=false;
			}
		}		
	}
}
function _delOrg(){
	if(checkdel("请选择部门")){
	form1.oprate.value="del";
	form1.action="<%=request.getContextPath()%>/servlet/PersonOrgOperateServlet";
	form1.submit();
	}
}


</script>
</head>
<body leftmargin="0" topmargin="20" text="#000000" bgcolor="#FFFFFF" background=<%=request.getContextPath()%>/images/grid.gif >
<form name="form1" method=post>
<input type="hidden" name="personUuid" value="<%=personUuid%>">
<input type="hidden" name="oprate" value="">
<input type="hidden" name="rightType" value="<%=rightType%>">

<br>
      <table width="95%" border="0" cellspacing="1" cellpadding="2" bgcolor="#426199" align=center>
        <tr>  
          <td bgcolor="#A6D0F2" align="center" height="25" colspan="3">
          <%=pName%>&nbsp;被授权查看部门列表
          </td >  
        </tr> 
		<tr bgColor="#EEF4FF" height="25">	
		<td align="center" height="25" bgColor=#eef4ff width="8%"><input type="checkbox" class="radio1" name="all" onClick="_selectAll()"></td>
		<td align="center" height="25" bgColor=#eef4ff width="13%"><b>序号</b></td>
		<td align="center" height="25" bgColor=#eef4ff><b>部门名称</b></td>		
		</tr>
		<%int i=0;
		for(Iterator orgItr=orgList.iterator();orgItr.hasNext();){
			PersonOrgVO personOrgVO=(PersonOrgVO)orgItr.next();
      		i++;			
		 %>
		<tr onmouseover="this.bgColor='#EBEBEB';" onmouseout="this.bgColor='#EEF4FF';" bgColor=#eef4ff>	
		<td align="center" height="25"><input type="checkbox" class="radio" name="orgUuids" value="<%=personOrgVO.getOrguuid()%>"></td>
		<td align="center" height="25"><%=i%></td>		
	  <td align="center" height="25"><%=personOrgVO.getOrgname()%></td>	
	  </tr>	
		<%} %>	
	 </table>
	 <br>
	 <center>
	<!--
		<img border="0" src="<%=request.getContextPath()%>/images/buttons/add3.gif" onclick = '_createNew()' style ="cursor:hand">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
	--> 
				<img border="0" src="<%=request.getContextPath()%>/images/add.gif" onclick = '_add()' style ="cursor:hand">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
	
				<img border="0" src="<%=request.getContextPath()%>/images/delete.gif" onclick = '_delOrg()' style ="cursor:hand">

	 </center>
	 </form>
</body>
</html>

⌨️ 快捷键说明

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