<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8" />
|
<title>角色权限</title>
|
|
[#include "/business/pages/include/static.html" /]
|
|
<style>
|
/* 清除浮动 */
|
.clearfix:before, .clearfix:after {
|
content: "\0020";
|
display: block;
|
height: 0;
|
overflow: hidden;
|
}
|
.clearfix:after { clear: both; }
|
.clearfix { zoom: 1; }
|
.personwrap{margin:10px;}
|
.personcont {
|
width: 100%;
|
font: 12px "宋体";
|
min-width: 800px;
|
}
|
.personalist {
|
border-bottom: dotted 1px #d1d1d1;
|
line-height: 30px;
|
padding: 8px 0;
|
overflow: hidden;
|
zoom: 1;
|
}
|
.personalistl {
|
width: 18%;
|
float: left;
|
}
|
.personalist span {
|
color: #434343;
|
font-weight: bold;
|
}
|
.personalistTit{margin-top:5px;}
|
.personalistTit span{
|
color:#1076e5;
|
font-size:16px;
|
}
|
.personalist_chk {
|
margin: 9px 8px 10px 16px;
|
float:left;
|
}
|
.personalist_chkbox {
|
margin:8px 8px 11px 20%;
|
float:left;
|
}
|
.personalistr {
|
float: left;
|
width: 82%;
|
}
|
.personalistr li {
|
width: 20%;
|
float: left;
|
color: #666;
|
list-style: none;
|
margin-bottom: 0px;
|
}
|
.personalistr li.li {
|
color: #333;
|
}
|
.personalistr li.li a {
|
color: #666;
|
text-decoration:none;
|
cursor:pointer;
|
}
|
.personalistr li.li a:hover {
|
color: #00f;
|
}
|
</style>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
|
$.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
|
document.getElementById("myform").target = window.top.openDialog("1","操作",
|
{},
|
{"width":30,"height":30,"noclose":true},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
|
return true;
|
}});
|
|
|
//点击一级功能菜单
|
$("input[name='yjgn']").bind("click",function() {
|
var isChecked = $(this).is(":checked");
|
$(this).parents("div[class='panel']").find(":checkbox").attr("checked",isChecked);
|
});
|
|
//点击二级功能菜单
|
$("input[name='ejgn']").bind("click",function() {
|
var isChecked = $(this).is(":checked");
|
var $pan = $(this).parent().next("div.sj");
|
if(isChecked) {
|
$pan.find(":checkbox").attr("checked",true);
|
//选中上级
|
$(this).parents(".panel").find(":checkbox[name='yjgn']").attr("checked",true);
|
} else {
|
//下级取消选中
|
$pan.find(":checkbox").attr("checked",false);
|
//判断同等级的二级是否都没有选中,如果都没有选中,则取消选中一级
|
var $panel = $(this).parents(".panel");
|
var checkedLen = $panel.find(":checkbox[name='ejgn']:checked").length;
|
if(checkedLen == 0) {
|
$panel.find(":checkbox[name='yjgn']").attr("checked",false);
|
}
|
}
|
});
|
|
|
|
//点击三级功能菜单
|
$("input[name='sjgn']").bind("click",function() {
|
var isChecked = $(this).is(":checked");
|
var $panel = $(this).parents(".panel");
|
|
var $sjPanel = $(this).parents("tr.sjPanel");
|
if(isChecked) {
|
|
//选中一级
|
$panel.find(":checkbox[name='yjgn']").attr("checked",true);
|
//选中当前三级所在的二级
|
$(this).parents("div.ejpanel").find(":checkbox[name='ejgn']").attr("checked",true);
|
|
} else {
|
//判断当前跟我同级的三级是否有选中,若没有,则取消选中我所在的二级
|
var checkedSjLen = $(this).parents("div.ejpanel").find(":checkbox[name='sjgn']:checked").length;
|
if(checkedSjLen==0) {
|
//取消选中二级
|
$(this).parents("div.ejpanel").find(":checkbox[name='ejgn']").attr("checked",false);
|
|
//判断当前是否有选中的二级,如果没有选中的二级,则取消一级选中
|
var checkedEjLen = $panel.find(":checkbox[name='ejgn']:checked").length;
|
if(checkedEjLen == 0) {
|
$panel.find(":checkbox[name='yjgn']").attr("checked",false);
|
}
|
}
|
}
|
});
|
|
|
})
|
|
|
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
if(!window.top.openConfirm('确定要重新分配权限吗?')) return false;
|
$("#myform").submit();
|
}
|
}
|
|
</script>
|
|
</head>
|
<body class="personwrap">
|
<form action="qxInRoleSubmit.html" method="post" id="myform">
|
<input type="hidden" value="${RequestParameters.id}" name="roleid" />
|
<div class="personcont">
|
[#list menuList as yjgn ]
|
<div class="panel">
|
<div class="personalist clearfix personalistTit">
|
<div class="personalistl">
|
<input class="personalist_chk" type="checkbox" name="yjgn" value="${yjgn.ID}" [#if yjgn.CHECKED??]checked="checked"[/#if]>
|
<span>${yjgn.GNMC}:</span></div>
|
</div>
|
|
[#list yjgn.GNLIST as ejgn]
|
<div class="personalist clearfix personalistnon ejpanel">
|
<div class="personalistl">
|
<input class="personalist_chk personalist_chkbox" name="ejgn" value="${ejgn.ID}" [#if ejgn.CHECKED??]checked="checked"[/#if] type="checkbox" >
|
<span>${ejgn.GNMC}:</span> </div>
|
<div class="personalistr sj">
|
[#list ejgn.GNLIST as sjgn]
|
<li class="li">
|
<input class="personalist_chk" name="sjgn" value="${sjgn.ID}" [#if sjgn.CHECKED??]checked="checked"[/#if] type="checkbox">
|
<a href="#">${sjgn.GNMC}</a>
|
</li>
|
[/#list]
|
</div>
|
</div>
|
[/#list]
|
</div>
|
[/#list]
|
</div>
|
</form>
|
</body>
|
</html>
|