⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 choosedepttree.jsp

📁 oa办公系统
💻 JSP
字号:
<%@ page language="java" import="java.util.*,cn.jx.ecjtu.oa.services.*,cn.jx.ecjtu.oa.ps.pojo.*" pageEncoding="GBK"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>选择人员</title>
<link rel="StyleSheet" href="../../common/defaultFa/css/dtree.css" type="text/css" />
<link href="../../common/defaultFa/css/all.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../../common/js/dtree.js"></script>
<script type="text/javascript">
	function showCompany(comId){
		document.f1.com_id.value=comId;
		document.f1.submit();
	}
	function showDept(deptId){
		document.f1.dept_id.value=deptId;
		document.f1.submit();
	}
	function doReturnValue(){
		window.parent.returnValue=uids;
	}
	var uids="${requestScope.users}";
	function addUser(user){
		offset=uids.indexOf(user+",");
		if(offset<0) uids+=user+",";
	}
	function removeUser(user){
		offset=uids.indexOf(user+",");
		if(offset>=0){
			var begin=uids.substring(0,offset);
			begin+=uids.substring(offset+user.length+1,uids.length);
			uids=begin;
		}
	}
	function checkUser(user){
		return uids.indexOf(user+",")>=0;
	}
</script>
</head>

<body style="overflow-y:auto" onunload="doReturnValue()" bgcolor="#EEEEEE">

<table width="100%" height="310">
 	<tr>
	<td valign="top">
<div id="mytree" style="width:100%; height:100%; z-index:2;overflow:auto">

      <script type="text/javascript">
<%!
  private String getChildrenTree(List<Node> children,String currentNodeId){
    StringBuffer str=new StringBuffer();
  	for(Node node:children){
  		str.append("d.add('");
  		str.append(node.getId());
  		str.append("','");
  		str.append(currentNodeId);
  		str.append("','");
  		str.append(node.getName());
  		str.append("','javascript:showDept(");
  		str.append(node.getId());
  		str.append(")');\n");
  		if(node.getChildren() != null && node.getChildren().size()>0){
  			str.append(getChildrenTree(node.getChildren(),String.valueOf(node.getId())));
  		}
  	}
  	return str.toString();  	
  }
%>
<%
RootNode root=(RootNode)request.getAttribute("depts");
out.println("var d=new dTree('d');");
out.println("d.add('0',-1,'"+root.getName()+"','javascript:showDept("+root.getId()+")');\n");
out.println(this.getChildrenTree(root.getChildren(),"0"));
List<Node> badChildren=root.getBadChildren();
for(Node node:badChildren){
    out.println("d.add('"+node.getId()+"',0,'"+node.getName()+"','javascript:showDept("+node.getId()+")');\n");
}
%>
document.write(d);
  </script>
  </div>
  </td>
</tr>
</table>
<form name="f1" target="choose_userList" action="listDeptUsers" method="post">
	<input type="hidden" name="dept_id">
	<input type="hidden" name="com_id">
</form>
</body>
</html>

⌨️ 快捷键说明

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