?? menuchild.jsp
字號(hào):
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,oa.main.DealString,javax.swing.tree.DefaultMutableTreeNode,java.util.Hashtable"%>
<%@page import="oa.main.DealString"%>
<%
oa.bean.MenuChildBean myBean = null;
oa.bean.MenuBean parentBean = null;
try{
myBean = new oa.bean.MenuChildBean();
parentBean = new oa.bean.MenuBean();
DealString ds = new DealString();
//取得菜單類別
String strType = ds.toString((String)request.getParameter("txt_type"));
if(strType.equals(""))strType = "1";
//編號(hào)
String strID1 = ds.toString((String)request.getParameter("txt_id"));
//權(quán)限控制
String uid = (String)session.getAttribute("zgbh");
oa.bean.RightBean rightbean = new oa.bean.RightBean();
rightbean.setUID(uid);
Vector mkqx = (Vector)rightbean.getRightMode();
String strmkqx = rightbean.getExist(mkqx,"站務(wù)交流");
rightbean.closeConn();
oa.bean.SysConfBean mybean = new oa.bean.SysConfBean();
String userType = (String)mybean.isWho(uid);
if(userType.equals("bmadmin"))
{
strmkqx = "增刪改";
}
mybean.closeConn();
//增刪改類型
String strEdit = ds.toString((String)request.getParameter("txt_edit"));
parentBean.setID(Integer.parseInt(strID1));
Hashtable ht1 = (Hashtable)parentBean.getOneData();
%>
<input type=hidden name=strID1 value="<%=strID1%>">
<table border="1" cellpadding="2" style="border-collapse: collapse; color:#FFFFFF" bordercolor="D0E7FF" width="95%" height="18" bgcolor="#007EAE">
<tr>
<td align="left" width="10%"> <b>上級(jí)版面</b></td>
<td align="left" width="90%"> <b>子版面</b></td>
</tr>
</table>
<table border="1" cellpadding="2" style="border-collapse: collapse; color:#FFFFFF" bordercolor="D0E7FF" width="95%" height="18" >
<tr>
<td><q class="MOUT" <%if(strmkqx.equals("增刪改")){%>
oncontextmenu="onclickshow('<%=strID1%>','1')" style="cursor:hand;"<%}%>> <font color="blue"><b><%=(String)ht1.get("MENU3")%></b></font></q></td>
</tr>
</table>
<%
int sub = 1;
int nItem = 0;
String outPrint = "";
String strID = "";
myBean.setParentID(Integer.parseInt(strID1));
Vector myTree = myBean.buildTree();
DefaultMutableTreeNode root, currentNode, lastNode;
for(int j=0;j<myTree.size();j++){
root = (DefaultMutableTreeNode)myTree.get(j);
outPrint = (String) ((Hashtable) root.getUserObject()).get("MENUCHILD");
strID = (String) ((Hashtable) root.getUserObject()).get("ID");
%>
<!-- 處理根節(jié)點(diǎn)------------------------------------------------------------------- -->
<table border="1" cellpadding="2" style="border-collapse: collapse; color:#FFFFFF" bordercolor="D0E7FF" width="95%" height="18" >
<tr>
<td><q class="MOUT" <%if(strmkqx.equals("增刪改")){%>
oncontextmenu="onclickshow('<%=strID%>','2')" style="cursor:hand;"<%}%>> <font color="blue"><b>  <%=outPrint%></b></font></q></td>
</tr>
</table>
<!------------------------------------------------------------------------------->
<%
if (root.getChildCount()!=0){
currentNode = (DefaultMutableTreeNode) root.getFirstChild();
sub++;
//out.println(tHead1+nItem+tHead2);
while ((currentNode != null) && (currentNode != root)) {
outPrint = (String) ((Hashtable) currentNode.getUserObject()).get("MENUCHILD");
strID = (String) ((Hashtable) currentNode.getUserObject()).get("ID");
%>
<table border="1" cellpadding="2" style="border-collapse: collapse; color:#FFFFFF" bordercolor="D0E7FF" width="95%" height="18"><tr><td>
<%
//控制
for (int i = 0; i < sub; i++)
out.print(" ");
%>
<q class="MOUT" <%if(strmkqx.equals("增刪改")){%>
oncontextmenu="onclickshow('<%=strID%>','2')" style="cursor:hand;"<%}%>>
<font color="blue"><b><%=outPrint%></b></font>
</q>
</td>
</tr></table>
<%
if ((currentNode.getChildCount()) == 0) {
if ((currentNode.getNextSibling() == null)) {
//當(dāng)前節(jié)點(diǎn)即沒有子節(jié)點(diǎn)又沒有兄弟節(jié)點(diǎn),則返回父節(jié)點(diǎn)
currentNode =
(DefaultMutableTreeNode) currentNode.getParent();
sub--;
//out.println(tEnd);
if (currentNode == null)
continue;
}
} else {
//當(dāng)前節(jié)點(diǎn)有子節(jié)點(diǎn)
currentNode =
(DefaultMutableTreeNode) currentNode.getFirstChild();
sub++;
continue;
}
lastNode = currentNode.getNextSibling();
if (lastNode != null) {
currentNode = lastNode;
} else {
while ((currentNode.getNextSibling() == null)&&(currentNode!=root)) {
currentNode =
(DefaultMutableTreeNode) currentNode.getParent();
sub--;
}
currentNode = currentNode.getNextSibling();
}
}
}
}
%>
</q>
<%}
finally{
if(myBean!=null)myBean.closeConn();
if(parentBean !=null)parentBean.closeConn();
}%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -