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

📄 userrights.jsp

📁 基于Sturts+Spring+Hibernate的一个高级销售管理系统。内容丰富
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="${pageContext.request.contextPath}/css/authorization.css"
			type="text/css" rel="stylesheet" />
		<link href="${pageContext.request.contextPath}/css/user_userinfo.css"
			type="text/css" rel="stylesheet" />
		<link href="${pageContext.request.contextPath}/css/input.css"
			rel="stylesheet" type="text/css" />
		<link href="${pageContext.request.contextPath}/css/fillet_common.css"
			type="text/css" rel="stylesheet" />
		<link
			href="${pageContext.request.contextPath}/css/fillet_common_authorization.css"
			type="text/css" rel="stylesheet" />
		<link
			href="${pageContext.request.contextPath}/css/common_1.css"
			type="text/css" rel="stylesheet" />
		<link
			href="${pageContext.request.contextPath}/css/authorization_common.css"
			type="text/css" rel="stylesheet" />
		<script language="JavaScript"
			src="${pageContext.request.contextPath}/js/changeRightsCheckbox.js"></script>
		<script type='text/javascript'
			src='${pageContext.request.contextPath}/dwr/interface/dataAreaSchemeMgrImpl.js'></script>
		<script type='text/javascript'
			src='${pageContext.request.contextPath}/dwr/engine.js'> </script>
		<script language="JavaScript"
			src="${pageContext.request.contextPath}/js/jquery-1.2.6.pack.js"></script>
		<script language="JavaScript"
			src="${pageContext.request.contextPath}/js/userhome.js"></script>
		<script>
 			function clearMsg(){
 				document.getElementById("schemeMsg").innerText = "";
 			}
 		
 			function initSchemeOption(){ 
				dataAreaSchemeMgrImpl.findAllScheme(callback);
			}
			
			function callback(schemes){
				var schemeIds = schemes[0];
				var schemeNames = schemes[1];
				var schemeObj = document.getElementById("scheme");
				//删除下拉框中除第一项外的所有项,全部删除=0
				schemeObj.length=1;
				//添加新获取的数据
				for(var i=0; i<schemeIds.length; i++){
					var opt = new Option();   
  					opt.value = schemeIds[i];  
  					opt.text = schemeNames[i];      
  					schemeObj.add(opt);
				}
			}
			
 			//提交表单
 			function submitForm(){
 				var flag = true;
 				var flag2 = false;
 				if(document.getElementById("objId").value == ""){
 					alert("请先在左侧选择授权对象!");
 					flag = false;
 				}
 				var rights = document.getElementsByName("right");
 				for(var i=0; i<rights.length; i++){
 					if(rights[i].checked){
 						flag2 = true;
 						break;
 					}
 				}
 				if(flag && !flag2){
 					alert("请选择功能权限!");
 				}
 				if(flag && flag2){
 					if(confirm("确定授权?")){ 
 						document.forms[0].submit();
 					}
 				}
 			}
 			
 			//删除数据范围方案
 			function delScheme(){
 				var schemeId =  document.getElementsByName("scheme")[0].value;
 				if(schemeId != null && schemeId != ""){
 					if(confirm("确定删除所选方案?")){ 
 						dataAreaSchemeMgrImpl.delSchemeById(schemeId, callbackInfo);
 					}
 				}else{
 					document.getElementById("schemeMsg").innerHTML = "<font color='red'>您还没选择方案</font>";
 				}
			}
			
			function callbackInfo(message){
				initSchemeOption();
				document.getElementById("schemeMsg").innerHTML = "<font color='red'>"+ message +"</font>";
			}
			
 			//新建数据范围方案
 			function toNewScheme(){
 				clearMsg();
 				var path = "${pageContext.request.contextPath}/admin/authorization/addScheme.jsp";
 				winopen(500,500,path);
			}
			
			//弹出窗口
			function winopen(width, height, path){ 
    			var left = (screen.width/2) - width/2;
				var top = (screen.height/2) - height/2;
				var styleStr = 'toolbar=no,location=no,directories=auto,status=no,menubar=no,scrollbars=yes resizable=no,z-lock=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
				window.open(path,'',styleStr);    
   			}
   			function controlDisabled(){
				var useScheme = document.getElementById("useScheme");
				var flag = useScheme.checked;
				document.getElementById("scheme").disabled = !flag;
				document.getElementById("newButton").disabled = !flag;
				document.getElementById("delButton").disabled = !flag;
				control(flag);//控制所有复选框,方法在rightTree.js里面
				initSchemeOption();//初始化授权方案下拉列表
				clearMsg();//清空消息
			}
			function combined(input1,input2){
				var input2_value = document.getElementById(input2).value;
				var input1_value = document.getElementById(input1).value;
				document.getElementById(input1).value = dellSameDataRightsArea(input1_value + input2_value);
			}
			
			function dellSameDataRightsArea(area){
				var areaSrc = "";
				var areas = area.split(",")
				for(var i = 0 ; i < areas.length ; i ++){
					for(var j = i+1; j < areas.length;j++){
						if(areas[i] == areas[j]){
							areas[j] = null;
						}
					}
				}
				for(var i = 0 ; i < areas.length ; i ++){
					if(areas[i] != null && areas[i] != ""){
						areaSrc = areaSrc + "," + areas[i];
					}
				}
				return areaSrc;
			}
	 </script>
		<title>用户授权</title>
	</head>

	<body>
		<form
			action="${pageContext.request.contextPath}/position.do?dispatch=authorizationUserRights"
			method="post">
	
		<div class="title">
			<ul>
				<li class="content">
					授予${user.userName}权限
					<c:choose>
						<c:when test="${rightsFlag == 1}">
							<a href="javascript:void(0);" onclick="javascript:openWindowOfUserRights('0','${user.id}','_area','${rightsFlag }');">[数据权限]<input type="hidden" name="_area" value=""/><input type="hidden" name="_selected" value="n"/></a>
						</c:when>
						<c:otherwise>
							<a href="javascript:void(0);" onclick="javascript:openWindowOfUserRights('0','${treeview.id}','_area','${rightsFlag }');">[数据权限]<input type="hidden" name="_area" value=""/><input type="hidden" name="_selected" value="n"/></a>
						</c:otherwise>
					</c:choose>
				</li>
			</ul>
		</div>
			<input type="hidden" name="userId" value="${user.id}"/>
			<c:if test="${rightsFlag == 2}">
				<input type="hidden" name="positionId" value="${treeview.id}"/>
			</c:if>
			<input type="hidden" name="rightsFlag" value="${rightsFlag}"/>
			<span style="OVERFLOW: hidden; LINE-HEIGHT: 20px; HEIGHT: 20px;"><span
				class="float_Right"><a
					onClick="showAll(this,'EFF_OS_TEX','EFF_OS_CON')"
					href="javascript:void(0)">[全部收缩]</a> </span> </span>
			<c:forEach items="${webRightsViews}" var="webRightsView">
				<table class="table_a marginb0">
					<tbody>
						<tr>
							<th align="left">
								<span class="float_Right_1"><a class="EFF_OS_TEX"
									onclick="showDetail(this,'dgxx${webRightsView.key }')"
									href="javascript:void(0)">[收缩]</a> </span><strong class="color_white">${webRightsView.value.moduleName} &nbsp;&nbsp;
									<c:if test="${webRightsView.key != 8 && webRightsView.key != 9 && webRightsView.key != 5}">
									<c:choose>
										<c:when test="${rightsFlag == 1}">
											<a href="javascript:void(0);" onclick="javascript:combined('${webRightsView.value.moduleId }_area','_area');openWindowOfUserRights('${webRightsView.value.moduleId }','${user.id }','${webRightsView.value.moduleId }_area','${rightsFlag }');">[数据权限]</a>
										</c:when>
										<c:otherwise>
											<a href="javascript:void(0);" onclick="javascript:combined('${webRightsView.value.moduleId }_area','_area');openWindowOfUserRights('${webRightsView.value.moduleId }','${treeview.id }','${webRightsView.value.moduleId }_area','${rightsFlag }');">[数据权限]</a>
										</c:otherwise>
									</c:choose>
									&nbsp;&nbsp;
									</c:if>
									<a
									href="javascript:void(0);"
									onclick="selectedDetail(this,'rights${webRightsView.key }','aclass${webRightsView.key }');">[全选]</a>
								</strong>
								<input type="hidden" name="${webRightsView.value.moduleId }_area" value=""/>
								<input type="hidden" name="${webRightsView.value.moduleId  }_selected" value="n"/>
							</th>
						</tr>
						<tr class="EFF_OS_CON" id="dgxx${webRightsView.key }">
							<td
								style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">
								<table class="Table" bordercolor="#e4e4e4" width="100%"
									border="1" frame="void">
									<tbody>
										<tr>
											<td class="table_wrap"
												style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px">
												<table class="Table" bordercolor="#e4e4e4" width="100%"
													border="1" frame="void">
													<tbody>
														<tr>
															<c:set value="0" var="n"></c:set>
															<c:set value="0" var="total"></c:set>
															<c:forEach items="${webRightsView.value.rightsMap}"
																var="rights">
																<c:set var="n" value="${n+1}"></c:set>
																<c:set value="${total + 1}" var="total"></c:set>
																<td align="left" width="20%">
																	<input type="checkbox" name="right" id="right"
																		class="rights${webRightsView.key }"
																		value="${rights.value.id }"
																		${rights.value.checked } <c:if test="${webRightsView.key != 8 && webRightsView.key != 9 && webRightsView.key != 5}">onclick="javascript:controlDataRightsLink(this,'a${rights.key }');" </c:if>/>
																	${rights.value.rightsName }
																	<span>&nbsp;&nbsp;
																	<c:if test="${webRightsView.key != 8 && webRightsView.key != 9 && webRightsView.key != 5}">
																	<c:choose>
																		<c:when test="${rightsFlag == 1}">
																			<a href="javascript:void(0);" onclick="javascript:combined('${webRightsView.value.moduleId }_area','_area');combined('${rights.value.id }_area','${webRightsView.value.moduleId }_area');openWindowOfUserRights('${rights.value.id }','${user.id }','${rights.value.id }_area','${rightsFlag }');" id="a${rights.key }" class="aclass${webRightsView.key }">${(rights.value.checked)=='checked'?'[数据权限]':'' }</a>
																		</c:when>
																		<c:otherwise>
																			<a href="javascript:void(0);" onclick="javascript:combined('${webRightsView.value.moduleId }_area','_area');combined('${rights.value.id }_area','${webRightsView.value.moduleId }_area');openWindowOfUserRights('${rights.value.id }','${treeview.id }','${rights.value.id }_area','${rightsFlag }');" id="a${rights.key }" class="aclass${webRightsView.key }">${(rights.value.checked)=='checked'?'[数据权限]':'' }</a>
																		</c:otherwise>
																	</c:choose>
																	</c:if>
																	</span>
																	<input type="hidden" name="${rights.value.id }_area" value=""/>
																	<input type="hidden" name="${rights.value.id }_pid" value = "${webRightsView.value.moduleId }"/>
																	<input type="hidden" name="${rights.value.id }_selected" value="n"/>
																</td>
																<c:if test="${n == 5}">
																	<c:set value="0" var="n"></c:set>
																	</tr>
																	<tr>
																</c:if>
															</c:forEach>
															<c:set value="${total  % 5}" var="m"></c:set>
															<c:if test="${m > 0}">
																<c:forEach begin="${m + 1}" end="5" step="1">
																	<td align="left" width="20%"></td>
																</c:forEach>
															</c:if>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
					</tbody>
				</table>
				<div class="fillet">
					<b class="rb"> <b class="rb5"></b> <b class="rb4"></b> <b class="rb3"></b> <b class="rb2"></b> <b class="rb1"></b> </b>
				</div>
			</c:forEach>
			<ul class="setRights">
			<li class = "optionRights">
			<input type="submit" class="userButton" value="授  权" />&nbsp;
			</li>
			<li class = "optionRights">
			<input type="button" class="userButton" value="返  回" onclick="javascript:window.history.go(-1);"/>
			</li>
			</ul>
			
		</form>
	</body>
</html>

⌨️ 快捷键说明

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