Commit 94a5defb authored by 刘丹's avatar 刘丹

用户列表

parent d513eda6
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<!--关联js元素--> <!--关联js元素-->
<input type="hidden" class="page-load" id="auth_rule_index" /> <input type="hidden" class="page-load" id="auth_rule_index" />
<!--关联js元素--> <div id="page-content-wrapper">
<style> <div class="container">
.ids{position: absolute; top: -20%; left: -20%; display: block;
width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%;
border: 0px none; opacity: 0;}
ins{position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%;
margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;}
</style>
<div id="pjax-container" class="content-wrapper" style="min-height: 1426px; width: 1035px; float: left; margin-left: 20px;">
<section class="content-header">
<!-- 面包屑导航 -->
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> </a><a href="/admin.php/admin/dashboard/index.html">首页</a></li>
<li class="active">规则管理</li>
</ol>
</section>
<!--内容-->
<section class="content">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">规则管理</h3>
<div class="box-tools pull-right">
<button onclick="javascript:location.reload();" class="btn btn-box-tool f16" type="button"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="box-body">
<div class="builder listbuilder-box">
<div class="builder-toolbar mt-10 mb-20">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 button-list clearfix"> <div class="col-lg-10 col-lg-offset-0">
<!-- 工具栏按钮 --> <div class="panel panel-default">
<!--<div class="form-group">--> <div class="panel-heading breadcrumb">
<a href="/index/authRuleBox.html" class="btn btn-primary btn-sm" title="新增">新增</a>&nbsp; <li><a href="#">规则管理</a></li>
<!--<a href="/setstatus/status/resume/model/auth_rule.html" model="auth_rule" class="btn btn-success ajax-post confirm btn-sm" target-form="ids" title="启用">启用</a>&nbsp;--> <li class="active">新增</li>
<!--<a href="/setstatus/status/forbid/model/auth_rule.html" model="auth_rule" class="btn btn-warning ajax-post confirm btn-sm" target-form="ids" title="禁用">禁用</a>&nbsp;--> <div class="pull-right">
<!--<a href="/status/delete/model/auth_rule.html" model="auth_rule" class="btn btn-danger ajax-post confirm btn-sm" target-form="ids" title="删除">删除</a>&nbsp;--> <ul class="bread_btn">
<!--<a onclick="move_menuparent()" title="&lt;i class=&quot;fa fa-exchange&quot;&gt;&lt;/i&gt; 移动位置" class="btn btn-info btn-sm" target-form="ids"><i class="fa fa-exchange"></i> 移动位置</a>&nbsp;--> <li>
<!--<a model="auth_rule" href="/admin.php/admin/auth/rule_sort/pid/0.html" class="btn btn-info btn-sm" name="排序" title="&lt;i class=&quot;fa fa-sort&quot;&gt;&lt;/i&gt; 排序"><i class="fa fa-sort"></i> 排序</a>&nbsp;--> <a href="#modal-edit" data-toggle="modal" class="btn btn-default edit_add"><i class="icon-plus"></i>
<!--&lt;!&ndash; </div>&ndash;&gt;--> 新增</a>
</li>
</ul>
</div> </div>
</div><!--row-->
</div> </div>
<!-- 数据列表 --> <div class="panel-body">
<div class="builder-container"> <div class="table-responsive">
<div class="row"> <table class="table table-striped table-bordered table-hover table-condensed">
<div class="builder-table col-sm-12">
<table class="table table-responsive table-bordered table-hover dataTable">
<thead> <thead>
<tr> <tr>
<th width="50" class="checkbox-toggle"><div class="icheckbox_minimal-blue" style="position: relative;" aria-checked="false" aria-disabled="false"><input type="checkbox" class="check-all" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div><!-- <span class="checkbox-toggle" style="color:#ddd;font-size:23px;cursor:pointer;"><i class="fa fa-square-o"></i></span> --></th> <th width="50" class="checkbox-toggle"><div class="icheckbox_minimal-blue" style="position: relative;" aria-checked="false" aria-disabled="false"><input type="checkbox" class="check-all" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div><!-- <span class="checkbox-toggle" style="color:#ddd;font-size:23px;cursor:pointer;"><i class="fa fa-square-o"></i></span> --></th>
...@@ -68,23 +39,81 @@ ...@@ -68,23 +39,81 @@
</tbody> </tbody>
</table> </table>
<!-- 列表底部按钮 -->
<!--<div class="form-group">-->
<!-- </div>-->
<div class="paginations" id="pagediv">
</div> </div>
<!-- /#page-content-wrapper//分页 -->
<div class="text-right pageinfo" id="pagediv">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
<!--编辑-->
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
编辑信息
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<input type="text" value="" name="title" class="form-control btn6" placeholder="用于后台显示的配置标题">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">上级菜单:</label>
<select class="form-control btn6" name="pid" id="pid">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">链接:</label>
<input type="text" value="" name="name" class="form-control btn6">
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">后台菜单:</label>
<div class="col-md-8">
<div class="oh mb-10 pl-5">
<div class="radio radio-primary fl mr-10">
<label class="radio-label1" for="is_menu1">
<div class="iradio_minimal-blue checked" style="position: relative;" aria-checked="false" aria-disabled="false">
<input type="radio" value="1" id="is_menu1" name="is_menu" style="">
</div></label>
</div> </div>
</section>
<div class="radio radio-primary fl mr-10">
<label class="radio-label2" >
<div class="iradio_minimal-blue" style="position: relative;" aria-checked="false" aria-disabled="false">
<input type="radio" value="0" id="is_menu2" name="is_menu" style="">
</div></label>
</div>
</div>
<div class="help-block "><i class="fa fa-info-circle color-info1"></i> 是否标记为后台菜单</div> </div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<input type="number" value="1" name="sort" class="form-control btn6">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_edit" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div> </div>
...@@ -9,8 +9,75 @@ authRule={ ...@@ -9,8 +9,75 @@ authRule={
authRule.event(); authRule.event();
}, },
event:function () { event:function () {
$ (document).delegate (".edit", "click", function () {//点击编辑
authRule.house_id = $ (this).attr ("data-id");
authRule.Edid_add();
authRule.Edit();
});
$ (document).delegate (".submit_edit", "click", function () {//提交编辑
authRule.Submit_edit();
authRule.getList();
});
$ (document).delegate (".edit_add", "click", function () {//新增
authRule.Edid_add();
});
}, },
Edid_add:function(){
$.ajax({
url: '/index/classList/type/1',//获取后台菜单
type: 'GET',
async: true,
dataType: 'json',
success: function (data) {
var temp=document.getElementById('auth_class_tpl').innerHTML;
var doTempl=doT.template(temp);
$("#pid").html(doTempl(data.data));//赋值
}
});
},
Edit:function(){//获取
$.ajax({
'type': 'GET',
'url' : '/index/updateAuthRule/group_id/',//获取编辑数据
data: {"id":authRule.house_id},
dataType: "json",
success: function (data) {
$("input[name = id]").val(data.data.id);
$("input[name = title]").val(data.data.title);
$("input[name = name]").val(data.data.name);
$("input[name = sort]").val(data.data.sort);
$("#pid").val(data.data.pid);
if(data.data.is_menu==0){
$("#is_menu2").attr('checked',true);
}else{
$("#is_menu1").attr('checked',true);
}
}
});
},
Submit_edit:function(){//提交编辑的信息
var par={}
par.id= authRule.house_id;
par.title= $("input[name = title]").val();
par.name= $("input[name = name]").val();
par.sort= $("input[name = sort]").val();
par.pid=$("#pid").val();
par.is_menu=$("input[name =is_menu]:checked").val();
$.ajax({
'type': 'POST',
'url' : '/index/updateAuthRule',
data:par,
dataType: "json",
success: function(data){
if(data.code==200){
}else{
alert(data.msg);
}
}
});
},
getList:function(pageNo){ getList:function(pageNo){
authRule.pageNo =pageNo; authRule.pageNo =pageNo;
var params ={}; var params ={};
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<td>[%= it[item]["status"] %]</td> <td>[%= it[item]["status"] %]</td>
<!--<td><span class="fa fa-check text-success"></span></td>--> <!--<td><span class="fa fa-check text-success"></span></td>-->
<td> <td>
<a style="margin-right:6px;" href="/index/authRuleBox.html?id=[%= it[item]['id'] %]" class="btn btn-primary btn-xs" title="编辑">编辑</a> <a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
<a style="margin-right:6px;" href="" class="btn btn-warning btn-xs ajax-get confirm" title="禁用">禁用</a> <a style="margin-right:6px;" href="" class="btn btn-warning btn-xs ajax-get confirm" title="禁用">禁用</a>
</td> </td>
</tr> </tr>
...@@ -26,3 +26,18 @@ ...@@ -26,3 +26,18 @@
</tr> </tr>
[% } %] [% } %]
</script> </script>
<!--权限管理模板-->
<script id="auth_class_tpl" type="text/template">
<option selected="" value="0">顶级菜单</option>
[% if(it) { %]
[% for(var item in it){ %]
[% if(it[item]['pid']!=0){ %]
<option value="[%= it[item]['id'] %]">[%= it[item]["title_show"] %]</option>
[% }else{ %]
<option value="[%= it[item]['id'] %]">[%= it[item]["title_show"] %]</option>
[% } %]
[% } %]
[% } %]
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment