?? rightsmanage.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高級銷售管理平臺--系統(tǒng)權(quán)限管理</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'>權(quán)限名稱已經(jīng)存在</font>";
document.getElementById(manipulateType + "RightsName").value="";
}else{
document.getElementById(manipulateType + "msg").innerHTML = "<font color='blue'>權(quán)限名稱可用</font>";
}
}
/*驗證FORM信息*/
function checkForm(aForm){
var rightsName = document.getElementById(manipulateType + "RightsName").value;
if(rightsName == ""){
rightsName == ""
document.getElementById(manipulateType + "msg").innerHTML = "<font color='red'>權(quán)限名稱不能為空!</font>";
return false;
}else{
if(confirm("確認添加此權(quán)限?")){
return true;
}else{
return false;
}
}
}
function checkIsParentNode(rightsId){
RightsMgrImpl.isParentNode(rightsId, callback2);
}
function callback2(result){
isDelete = result;
var flag = true;
if(isDelete){
if(confirm("該權(quán)限下還有子權(quán)限,確認全部刪除?")){
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("確認刪除此權(quán)限?")){
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>系統(tǒng)權(quán)限管理</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" >
權(quán)限名稱:[ ${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');">
<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="關(guān)閉" onclick="window.close();">
</td>
</tr>
<tr>
<td height="60" class="dtree" colspan="2" align="center">
<div id="add" style="display: none">
新建子權(quán)限名稱:<input type="text" name="addRightsName" maxlength="20" size="30" onfocus="clearMsg();"
onblur="isExistByRightsName(this.value);"> 
<font color="red">*</font>
<div id="addmsg"></div>
</div>
<div id="edit" style="display: none">
修改權(quán)限名稱:<input type="text" name="editRightsName" maxlength="60" size="30" onfocus="clearMsg();"
onblur="isExistByRightsName(this.value);"> 
<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="確 定" >
<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">
</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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -