扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
对应文件有: machmap.jsp,dtree,js,op.js,dtree.css 等.
数据库设计sys04_Machine表
machmap.jsp 代码如下
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ page import = "java.sql.*"%>
<%@ page import ="pub.*" %>
<html>
<head>
<title>#.Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/putong.css" type="text/css" rel="stylesheet">
<link rel="StyleSheet" href="../css/dtree.css" type="text/css">
<script type="text/javascript" src="../js/dtree.js"></script>
<script type="text/javascript" src="../js/op.js"></script>
</head>
<body bgcolor="ffffff" text="#000000" >
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#bfcae6" border="0" background="../images/subtitle.gif">
<tr>
<td width="100%" height="26"><FONT face="宋体">
<DIV align="left"><FONT face="宋体" color="#ffffff"> 当前位置:基础信息>>组织机构图 </FONT>
</DIV>
</FONT>
</td>
</tr>
</table>
<br>
<a href="javascript: d.openAll();"> 展开</a> | <a href="javascript: d.closeAll();">折叠</a>
<script type="text/javascript">
<!--
d = new dTree('d');
d.config.folderLinks=true;
//id, pid, name, url, title, target, icon, iconOpen, open
d.add(0,-1,'PICC组织机构图','','easydone','_blank');
<%
//String Sql = "select * from tree";
String Sql = "select * from sys04_Machine";
String strID="";
String strPid="";
String strName="";
String strCropID="";
String strUrl="";
String strTarget="";
DataTable dt =new DataTable();
//Connection conn = null;
try{
conn.execSql(Sql);
if(conn.querySql(Sql,dt)){
if(dt.getRowCount()>0){
for(int i=0;i<dt.getRowCount();i++){
//strID = dt.getItemForName(i,"id");
strID = dt.getItemForName(i,"MachID");
System.out.println("strID:"+strID);
//strPid = dt.getItemForName(i,"pid");
strPid = dt.getItemForName(i,"ParentID");
System.out.println("strPid:"+strPid);
strCropID = dt.getItemForName(i,"Cropid");
System.out.println("strCropID:"+strCropID);
//strName = dt.getItemForName(i,"name");
strName = dt.getItemForName(i,"MachName");
System.out.println("strName:"+strName);
strUrl = dt.getItemForName(i,"url");
System.out.println("strUrl:"+strUrl);
strTarget = dt.getItemForName(i,"target");
System.out.println("strTarget:"+strTarget);
if(strCropID.equals("0")==false && strPid.equals("0")==true){
%>
d.add(<%=strID%>,<%=strCropID%>,'<%=strName%>','<%=strUrl%>','<%=strName%>','<%=strTarget%>');
<%
}
else{
%>
d.add(<%=strID%>,<%=strPid%>,'<%=strName%>','<%=strUrl%>','<%=strName%>','<%=strTarget%>');
<%
}
}
}
}
}
catch(Exception ex){
out.println(ex.toString());
}
%>
document.write(d);
//-->
</script>
</body>
</html>
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者