|
|
@@ -17,13 +17,13 @@
|
|
|
<div class="col-sm-8">
|
|
|
<div class="ibox float-e-margins">
|
|
|
<div class="ibox-title">
|
|
|
- <h5>添加权限组</h5>
|
|
|
+ <h5>添加角色</h5>
|
|
|
</div>
|
|
|
<div class="ibox-content">
|
|
|
<form class="form-horizontal m-t" id="commentForm" method="post" action="{:url('admins/addPower')}">
|
|
|
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">权限组名称:</label>
|
|
|
+ <label class="col-sm-3 control-label">角色名称:</label>
|
|
|
<div class="input-group col-sm-4">
|
|
|
<input id="group_name" type="text" class="form-control" name="group_name" required="" aria-required="true">
|
|
|
</div>
|
|
|
@@ -78,6 +78,34 @@
|
|
|
<script src="__JS__/plugins/layer/layer.min.js"></script>
|
|
|
<script src="__JS__/layui/layui.js"></script>
|
|
|
<script src="__JS__/jquery.form.js"></script>
|
|
|
+<script>
|
|
|
+ $(function(){
|
|
|
+ $('[level=1]').click(function(){
|
|
|
+ if(this.checked){
|
|
|
+ $(this).parent().find('input').prop('checked','checked');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $(this).parent().find('input').removeAttr('checked');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('[level=2]').click(function(){
|
|
|
+ var n = 0;
|
|
|
+ if (this.checked) {
|
|
|
+ $(this).parent().parent().find('[level=1]').prop('checked','checked');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ for(var i=0;i<$(this).parent().find('[level=2]').length;i++){
|
|
|
+ if($(this).parent().find('[level=2]')[i].checked){
|
|
|
+ n = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(n == 0){
|
|
|
+ $(this).parent().parent().find('[level=1]').removeAttr('checked');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
layui.use(['form', 'upload'], function(){
|