<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp" %>
<title>新增权限</title>
<script type="text/javascript" src="${staticPath}js/system/permission.js"></script>
</head>
<body>
<div class="open-content open-pad">
	<form id="addPermissionForm">
	<ul class="ulFrm">
		<li>
			<span class="label labelW80 labelRight">权限类型：</span>
			<div class="select selectW120 {onchange:change, width:'120'}">
				<select name="type" id="type">
					<option value="menu">父权限</option>
					<option value="submenu">子权限</option>
					<option value="func">功能权限</option>
				</select>
			</div>
		</li>
		<li style="display:none;" id="parentId">
			<span class="label labelW80 labelRight">父权限名称：</span>
			<div class="select selectW120 {width:'120'}">
				<select name="pid" id="pid">
					<option value="">请选择</option>
					<c:forEach var="item" items="${permissionList}">
						<option value="${item.permissionId}">${item.name}</option>
					</c:forEach>
				</select>
			</div>
		</li>
		
		<li>
			<span class="label labelW80 labelRight">权限名称：</span>
			<input type="text" class="text" name="name" id="name" size="20" value="" />
			<span class="label labelW80 labelRight">权限编码：</span>
			<input type="text" class="text" name="code" id="code" size="20" value="" />
		</li>
		
		<li>
			<span class="label labelW80 labelRight">权限链接：</span>
			<input type="text" class="text" name="url" id="url" size="20" value="" />
			<span class="label labelW80 labelRight">权限优先级：</span>
			<input type="text" class="text" name="rank" id="rank" size="20" value="" />
		</li>
		
		<li>
			<span class="label labelW80 labelRight">权限图标：</span>
			<input type="text" class="text" name="logo" id="logo" size="20" value="" />
		</li>
	</ul>
	</form>
	<div class="open-fixed-buttons">
		<a onclick="javascript:checkPermissionAdd();" class="btn-radius">提交</a>
		<a href="javascript:top.$.closeWindow();" class="btn-radius cancel">取消</a>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$.resetText();
	$(".select").uiSelect();
});
function change(o){
	var type=$('#type').val();
	if(type=='submenu'){
		$('#parentId').removeAttr("style");
	}else{
		$('#pid').val('');
		$('#parentId').css("display","none");
	}
	var value= $('#type option:selected').val();
	var da = $('#pid').val();
	$('#pid').disabled= true;
}
</script>
</body>
</html>