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

📄 purviewlist.jsp

📁 JSP移动商品管理平台源代码.........
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java" import="java.util.Hashtable,java.util.ArrayList,java.util.Iterator,java.net.*" %>
<%@ page errorPage="../error/error.jsp" %>
<jsp:useBean id="MenuTree" class="bean.TreeCom.TreeBean" />
<jsp:useBean id="Roles" class="bean.roles.RolesBean" />

<html>
<head>
  <title>权限列表</title> 
  <link href="css/TreeCom.css" rel="stylesheet" type="text/css">  
  <script src="js/CheckTreeCom.js" type="text/javascript"></script> 
</head>
<script language="javascript">
function OpenRoleDlg(s1,s2,s3,s4,s5,s6){
       	ask=confirm("你确定将修改该记录权限吗?\n\n点“确定”继续,点“取消”返回"); 
  	if (ask){
			sPurview 	= 	s3;
			temp  		= 	"a"+s5+"a";
			sPurview	=	sPurview.replace(temp,"a");
        		if (s2 == "0"){
        			
        			if(sPurview.substr(sPurview.length-1,1)=='a')sPurview = sPurview.substr(0,sPurview.length-1);
        			sPurview = sPurview + temp;
        		}
        		else{
        		    //sPurview=sPurview.substr(0,sPurview.indexOf(temp)-1)+"a"+sPurview.substr(sPurview.indexOf(temp)+temp.length,sPurview.length-(sPurview.indexOf(temp)+temp.length)+1);
        		    //sPurview	=	sPurview.replace(temp,"a");
        		    if (sPurview.length == 1) sPurview = "";
        		}
        		sHref="Role_Operate1.jsp?TRoleID="+s1
        			     +"&TRoleName="+s6
        		     	     +"&TPurview="+sPurview
        		     	     +"&TRemark=-1"
        		     	     +"&TAction="+s4;       
      			window.open(sHref,"_blank","left=0,top=0,width=2, height=2, status=no, menubar=no, location=no, resizable=no, alwaysRaised=yes, z-look=yes, depended=yes");      			
      	}
}
function submitRole(){
       	ask=confirm("你确定将修改该记录权限吗?\n\n点“确定”继续,点“取消”返回"); 
  	if (ask){
        	sHref	=	"Role_Operate1.jsp?TRoleID="+document.all("TRoleID").value
         			+"&TRoleName="+document.all("TRoleName").value
        			+"&TPurview="+document.all("TPurview").value
        			+"&TRemark="+document.all("TRemark").value
        			+"&TAction="+document.all("TAction").value;       
      		window.open(sHref,"_blank","left=0,top=0,width=2, height=2, status=no, menubar=no, location=no, resizable=no, alwaysRaised=yes, z-look=yes, depended=yes");
      	}
}	
function ChangePurview(MenuID,CheckBoxName){
	sPurview 	= 	document.all("TPurview").value;
	temp  		= 	"a"+MenuID+"a";
	sPurview	=	sPurview.replace(temp,"a");
        if ( (document.all(CheckBoxName)) && (document.all(CheckBoxName).checked) ){
        			
        	if(sPurview.substr(sPurview.length-1,1)=='a')	sPurview = sPurview.substr(0,sPurview.length-1);
        	sPurview = sPurview + temp;
        }
        else{
        	if (sPurview.length == 1) sPurview = "";
        }
	document.all("TPurview").value  =  sPurview;	
}
</script>
<body topmargin="0" leftmargin="0" scrolling="auto" background="images/bg_main.png"> 
<form name="FormPurview" action="Role_Operate1.jsp" >
<% 

    
   byte temp [];
   String sRoleID   =   request.getParameter("TRoleID");
   temp=sRoleID.getBytes("iso-8859-1");   
   sRoleID=new String(temp);   
   
   String sRoleName =   ""; 
   String sPurview  =   ""; 
   String sAction   =   request.getParameter("TAction");
   temp=sRoleID.getBytes("iso-8859-1");   
   sRoleID=new String(temp);  

   if (sRoleID.equals("无")){
   	sRoleID = "";
   }
   else{
   	int    RoleID    =     Integer.parseInt(sRoleID);
   	ArrayList Rolelist = Roles.getRoles(RoleID);
   	Iterator Roleitr   = Rolelist.iterator();
   	if (Roleitr.hasNext()) {
			Hashtable Roleht = (Hashtable) Roleitr.next();   
   	
  			sRoleName    =  Roleht.get("RoleName").toString();
   	         	sPurview     =  Roleht.get("Purview").toString();
   	}   
   }
   int i=0;
   String sValue=null;
   String menu_id=null;
   String sup_menu_id=null;
   String menu_name=null;
   String menu_herf=null;
   String open_ico	=	null;
   String close_ico	=	null;    
   ArrayList list = MenuTree.getMenuTree();
   Iterator itr = list.iterator();
   while (itr.hasNext()) {
		Hashtable ht = (Hashtable) itr.next();   
  
            	menu_id      =  ht.get("menu_id").toString();
            	sup_menu_id  =  ht.get("sup_menu_id").toString(); 
            	menu_name    =  ht.get("menu_name").toString();
            	menu_herf    =  ht.get("menu_herf").toString();
            	open_ico     =  ht.get("open_ico").toString();
            	close_ico    =  ht.get("close_ico").toString();             	
            	
		sValue=menu_id+"|"+sup_menu_id+"|"+menu_name+"|"+menu_herf+"|"+close_ico+"|"+open_ico; 
%>
       		<input type="hidden" name="<%=i%>"  value=<%=sValue%>>               
<%
		i=i+1;
	}
%>
		<input type="hidden" name="ilength"  value=<%= i %>> 
		<input type="hidden" name="TRoleID"  value=<%= sRoleID %>>	
		<input type="hidden" name="TRoleName"  value=<%= sRoleName %>>
		<input type="hidden" name="TPurview"  value=<%= sPurview %>>
		<input type="hidden" name="TRemark"  value="">				
		<input type="hidden" name="TAction"  value=<%= sAction %>> 
</form>
<table align="center" background="images/bg_main2.png"  width="760" border="0" cellspacing="0" cellpadding="0" height="20">
   <tr>
  	  <td align="left" height="20" style="font-family: Arial; style; font-size: 12px; color: #000000; letter-spacing:0px"> 	  
  	  	角色&nbsp;&nbsp;<font color="blue"><%=sRoleName%></font>&nbsp;&nbsp;权限信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  	  	<a href="javascript:submitRole();"><font color="blue">[提交]</font></a>&nbsp;&nbsp;<a href="javascript:window.close();"><font color="blue">[关闭]</font></a>
  	  </td>
   </tr>
</table>						
<table width="760" id=control border="0" cellspacing="0" cellpadding="0" class="navbar" align="center" onLoad="initialize();">
<div align="justify">
	<table border=0 class="navbar"  align="left">
  		<tr>
    			<td align="left" valign="top" width="50%" rowspan="8">
    			<script language="javascript">
    				objTree	= new treemenu("","菜单列表","images/close.gif");
	    			iNum=document.FormPurview.ilength.value;
				for (pos=0;pos<iNum;pos++){
					sName=pos.toString();			
				        sValue=document.all(sName).value;
					SplitValue=sValue.split("|");	
					sRoleID=document.all("TRoleID").value;
					sRoleName=document.all("TRoleName").value;
					sPurview=document.all("TPurview").value;
					sAction=document.all("TAction").value;
					
					temp="a"+SplitValue[0]+"a";
					
					if (sPurview.indexOf(temp) == -1){
						//sAct="javascript:OpenRoleDlg('"+sRoleID+"','0','"+sPurview+"','"+sAction+"','"+SplitValue[0]+"','"+sRoleName+"')";	
						sAct="javascript:ChangePurview('"+SplitValue[0]+"','ck"+SplitValue[0]+"')";
					     		//      0 id          1 父id        2  名称          3 关闭图标   4 打开图标    5 地址  6 指向窗口 7 状态 8 动作						
						add_item(SplitValue[0],SplitValue[1],SplitValue[2],SplitValue[4],SplitValue[5], "", "", "0", sAct);								
					}
					else{
						//sAct="javascript:OpenRoleDlg('"+sRoleID+"','1','"+sPurview+"','"+sAction+"','"+SplitValue[0]+"','"+sRoleName+"')";	
						sAct="javascript:ChangePurview('"+SplitValue[0]+"','ck"+SplitValue[0]+"')";
					     		//      0 id          1 父id        2  名称          3 关闭图标   4 打开图标    5 地址  6 指向窗口 7 状态 8 动作						
						add_item(SplitValue[0],SplitValue[1],SplitValue[2],SplitValue[4],SplitValue[5], "", "", "1", sAct);								
					
					}
					sName=null;
				}
				document.write(menu(0));
			</script>
    			</td>
  		</tr>
	</table>
</div>
</table>
</body>
</html>

⌨️ 快捷键说明

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