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

📄 rightsmanage.jsp

📁 基于Sturts+Spring+Hibernate的一个高级销售管理系统。内容丰富
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yuanchung.sales.service.admin.SetupTreeView;"%>
<html>    
	<head>
		<title>Y6高级销售管理平台--系统权限管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">			
		<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/RightsMgrImpl.js'></script>
		<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'> </script>
		<link rel="StyleSheet" href="${pageContext.request.contextPath}/css/global.css" type="text/css" />
		<script>
			var isDelete = false;
			var rightsId = "";
			var manipulateType = '';
			function addRights(type){
				manipulateType = type;
				document.getElementById(manipulateType).style.display = "block";
				document.getElementById("btn").style.display = "block";
				document.getElementById('edit').style.display = "none";
				document.getElementById('type').value = type;
				document.getElementById("message").innerText = "";
			}
			
			function editRights(type,rightsName){
				manipulateType = type;
				document.getElementById(manipulateType).style.display = "block";
				document.getElementById(manipulateType + "RightsName").value = rightsName;
				document.getElementById("btn").style.display = "block";
				document.getElementById('add').style.display = "none";
				document.getElementById('type').value = type;
				document.getElementById("message").innerText = "";
			}
			
			function clearMsg(){
				document.getElementById(manipulateType + "msg").innerText = "";
			}
			
			function isExistByRightsName(rightsName){ 
				if(rightsName != ""){
					RightsMgrImpl.isExistByRightsName(rightsName, callback);
				}
			}
			
			function callback(result){
				if(result){
					document.getElementById(manipulateType + "msg").innerHTML = "<font color='red'>权限名称已经存在</font>";
					document.getElementById(manipulateType + "RightsName").value="";
				}else{
					document.getElementById(manipulateType + "msg").innerHTML = "<font color='blue'>权限名称可用</font>";
				}
			}
			
			/*验证FORM信息*/
			function checkForm(aForm){
				var rightsName = document.getElementById(manipulateType + "RightsName").value;
				if(rightsName == ""){
				rightsName == ""
					document.getElementById(manipulateType + "msg").innerHTML = "<font color='red'>权限名称不能为空!</font>";
					return false;
				}else{
					if(confirm("确认添加此权限?")){
						return true;
					}else{
						return false;
					}
				}
			}
			
			
			function checkIsParentNode(rightsId){
				RightsMgrImpl.isParentNode(rightsId, callback2);
			}
			
			function callback2(result){
				isDelete = result;
				var flag = true;
				if(isDelete){
					if(confirm("该权限下还有子权限,确认全部删除?")){
						flag = true;
					}else{
						flag = false;
					}
				}
				if(flag){
					location.href = "${pageContext.request.contextPath}/rights.do?dispatch=deleteRights&rightsId=" + rightsId;
				}

			}
			
			function delRights(id){ 
				rightsId = id;
				if(confirm("确认删除此权限?")){
					isDelete = true;
					checkIsParentNode(rightsId);
				}
			}
			
		</script>	
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="init();">
	<%
		String info = (String)request.getAttribute("info"); 
		if(info != null){
			out.print("<script>");
			out.print("window.opener.location.reload();");
			out.print("document.getElementById('message').innerHTML ='<font color=red>"+ info +"</font>'");
			out.print("</script>");
		}	
	%>
					
		<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center>        
        <tr>
          <td height="30" background="${pageContext.request.contextPath}/images/t_25.gif">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align=center>系统权限管理</td>
              </tr>              
            </table>
          </td>
        </tr>
	</table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0" background="${pageContext.request.contextPath}/images/tiao.gif" align="center">
            <tr >
            	<td align="center"  height="27" >
					权限名称:[ ${rights.rightsName } ]
				</td>
   	 		</tr>
       </table>
        <form action="${pageContext.request.contextPath}/rights.do" onsubmit="return checkForm(this);">
						<input type="hidden" name="dispatch" value="manipulateRights"/>
						<input type="hidden" name="rightsId" value="${rights.id }"/>
						<input type="hidden" name="type" value=""/>
          <table width="98%" border="0" cellspacing="0" cellpadding="0"
			align="center">
			<tr>
				<td bgcolor="#CCCCCC" width="2" height="2"></td>
				<td height="2" bgcolor="#F3F7FA">
					<br>
      <div id="myContacts" style="text-align: center;">          
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="205">
		<tr>
			<td height="60" class="dtree" colspan="2" align="center">
				<input type="button" class="userButton" value="新建" onclick="addRights('add');">&nbsp;
				<input type="button" class="userButton" value="编辑" onclick="editRights('edit','${rights.rightsName }');">
				<input type="button" class="userButton" value="删除" onclick="delRights('${rights.id }');">
				<input type="button" class="userButton" value="关闭" onclick="window.close();">
			</td>
		</tr>
		<tr>
			<td height="60" class="dtree" colspan="2" align="center">
				<div id="add" style="display: none">
				新建子权限名称:<input type="text" name="addRightsName" maxlength="20" size="30" onfocus="clearMsg();"
							onblur="isExistByRightsName(this.value);">&nbsp
				<font color="red">*</font>
				<div id="addmsg"></div>
				</div>
				<div id="edit" style="display: none">
				修改权限名称:<input type="text" name="editRightsName" maxlength="60" size="30" onfocus="clearMsg();"
							onblur="isExistByRightsName(this.value);">&nbsp
				<font color="red">*</font>
				<div id="editmsg"></div>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2" height="60" align="center">
			<div id="btn" style="display: none">
				<input type="submit" class="userButton" value="确 定" >&nbsp;
				<input type="button" class="userButton" value="取 消" onclick="window.close();">
			</div>
			</td>
		</tr>
		<tr>
			<td colspan="2" id="message">
				
			</td>
		</tr>
	</table>
      </div>      
				</td>
				<td bgcolor="#CCCCCC" width="2" height="2"></td>
			</tr>
		</table>
		<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
			<tr>
				<td width="8" height="5" valign="top">
					<img src="${pageContext.request.contextPath}/images/left.gif" width="8" height="11">
				</td>
				<td background="${pageContext.request.contextPath}/images/ht.gif" height="11">
					&nbsp;
				</td>
				<td width="8" height="5" valign="top">
					<img src="${pageContext.request.contextPath}/images/rg.gif" width="8" height="11">
				</td>
			</tr>
		</table>
	</form>	
	</body>
</html>

⌨️ 快捷键说明

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