?? viewmodule_bak.jsp
字號:
<!--function:查看權限頁面
author:bao
-->
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ page import="com.stframe.form.DataForm"%>
<%@ taglib prefix="by" uri="/WEB-INF/tlds/frametag.tld"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List list = (List)request.getAttribute("allfunlist");
Map funmap = (HashMap)request.getAttribute("funmap");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>權限樹</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<STYLE>
body,td{
font-size: 12px;
font-family: Tahoma, Arial;
margin: 0px;
padding: 0px;
margin-bottom: 10px;
color:#000000;
}
</STYLE>
<script type="text/javascript">
function setDisplay(obj){
if(obj.style.display==""){
obj.style.display="none";
}else{
obj.style.display="";
}
}
//選中孩子
function selectChild(o){
//獲得本菜單的div
var otr = o.parentElement;
//獲得子菜單的div
var otrmenu = otr.nextSibling;
//遍歷子菜單的checkbox
for(var i=0;i<otrmenu.all.length;i++) {
if(otrmenu.all[i].type=="checkbox"){
otrmenu.all[i].checked = o.checked;
}
}
}
//選中父類(適用二級)
function selectParent(o){
//t=true默認找到
var t= false;
//獲得本菜單的tr
var otr = o.parentElement;
//獲得父菜單的tr
var otrmenu = otr.previousSibling;
//遍歷子菜單的checkbox,驗證是有選
for(var i=0;i<otr.all.length;i++) {
if(otr.all[i].type=="checkbox" && otr.all[i].checked){
t = true;
break;
}
}
//設置父類的checkbox狀態
if(t){
for(var i=0;i<otrmenu.all.length;i++) {
if(otrmenu.all[i].type=="checkbox"){
otrmenu.all[i].checked = "checked";
//selectRoot(otrmenu.all[i]);
break;
}
}
}else{
for(var i=0;i<otrmenu.all.length;i++) {
if(otrmenu.all[i].type=="checkbox"){
otrmenu.all[i].checked = "";
//selectRoot(otrmenu.all[i]);
break;
}
}
}
}
//菜單的顯示與隱藏
function hide(o,img){
if(o.style.display==""){
img.src="<%=path%>/IMAGES/extag.gif";
o.style.display="none";
}else{
img.src="<%=path%>/IMAGES/sstag.gif";
o.style.display="";
}
}
function loadFunValue()
{
<%
Set allfunset = funmap.entrySet();
Iterator it = allfunset.iterator();
while(it.hasNext())
{
Map.Entry me = (Map.Entry)it.next();
%>
var userfun = document.getElementsByTagName("input");
for(var j =0;j<userfun.length;j++)
{
if(userfun[j].value=='<%=me.getKey()%>')
{
userfun[j].checked = "checked";
}
}
<%
}%>
}
</script>
</head>
<body onLoad="loadFunValue();">
<%
for(int i=0;i<list.size();i++){
List sublist = (List)list.get(i);
DataForm bigData = (DataForm)sublist.get(0);
out.println("<div>");
out.println("<img name='img"+bigData.get("ID")+"'");
out.println(" onclick='hide(m"+bigData.get("ID")+"1,img"+bigData.get("ID")+");'");
out.println("src=\""+request.getContextPath()+"/IMAGES/extag.gif\"/>");
out.println("<input type='checkbox' name='m"+bigData.get("ID")+"' onclick='selectChild(this);' value='"+bigData.get("ID")+"' disabled/>");
out.println("<span onclick='hide(m"+bigData.get("ID")+"1,img"+bigData.get("ID")+");'>"+bigData.get("NAME")+"</span>");
out.println("</div>");
out.println("<div id='m"+bigData.get("ID")+"1' name='m"+bigData.get("ID")+"1' style='display:none'>");
for(int j=1;j<sublist.size();j++){
DataForm smallData = (DataForm)sublist.get(j);
out.println(" <img src=\""+request.getContextPath()+"/IMAGES/sstag.gif\"/>");
out.println("<input type='checkbox' name='n"+smallData.get("ID")+"' onclick='selectParent(this);' value='"+smallData.get("ID")+"' disabled/>"+smallData.get("NAME")+"<br>");
}
out.println("</div>");
}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -