Commit 2b59d83d authored by 刘丹's avatar 刘丹

角色管理

parent e00b61e4
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<h4>角色管理</h4> <!--角色管理页面-->
<a href="/index/roleedit">添加角色</a>
<input type="hidden" class="page-load" id="auth" /> <input type="hidden" class="page-load" id="auth" />
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
<div class="col-lg-10 col-lg-offset-0"> <div class="row">
<table class="table table-striped table-bordered table-hover table-condensed"> <div class="col-lg-10 col-lg-offset-0">
<thead> <div class="panel panel-default">
<tr> <div class="panel-heading breadcrumb">
<th class="text-center">ID</th> <li><a href="#">角色管理</a></li>
<th class="text-center">角色名</th> <li class="active">添加角色</li>
<th class="text-center">描述</th> <div class="pull-right">
<th class="text-center">状态</th> <ul class="bread_btn">
<th class="text-center">操作</th> <li>
</tr> <a href="/index/roleedit" data-toggle="modal" class="btn btn-default"><i class="icon-plus"></i>
</thead> 添加角色</a>
<tbody id="auth_list"> </li>
</tbody> </ul>
</table> </div>
</div> </div>
<!-- /#page-content-wrapper -->
<div class="text-right pageinfo" id="pagediv">
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">ID</th>
<th class="text-center">角色名</th>
<th class="text-center">描述</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody id="auth_list">
</tbody>
</table>
</div>
<!-- /#page-content-wrapper//分页 -->
<div class="text-right pageinfo" id="pagediv">
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
<!--编辑-->
<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 class="form-control btn6" data-rule-buga="false" data-rule-required="true" name="title" placeholder="创建的角色名称" type="text" value="" id="title">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<textarea id="description" name="description" class="form-control btn6" length="120" rows="5"></textarea>
</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_follow2" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!--权限分配-->
<div class="modal fade" id="modal-power" 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">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_follow2" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
...@@ -84,7 +84,7 @@ Route::group('index', [ ...@@ -84,7 +84,7 @@ Route::group('index', [
'roleedit' => ['index/auth/roleEdit', ['method' => 'get']], //--编辑角色页面 'roleedit' => ['index/auth/roleEdit', ['method' => 'get']], //--编辑角色页面
'access' => ['index/auth/access', ['method' => 'get']], //--权限分配角色页面 'access' => ['index/auth/access', ['method' => 'get']], //--权限分配角色页面
'updateAccess' => ['index/auth/updateAccess', ['method' => 'post']], //--编辑角色权限【接口】 'updateAccess' => ['index/auth/updateAccess', ['method' => 'post']], //--编辑角色权限【接口】
'addAuth' => ['index/auth/addAuth', ['method' => ' get|post']], //--添加角色【接口】 'addAuth' => ['index/auth/addAuth', ['method' => 'get|post']], //--添加角色【接口】
'accessLook'=>['index/auth/accessLook', ['method' => 'post']], //--查看编辑角色权限【接口】 'accessLook'=>['index/auth/accessLook', ['method' => 'post']], //--查看编辑角色权限【接口】
'setStatus'=>['index/auth/setStatus', ['method' => 'post']], //--设置角色的状态【接口】 'setStatus'=>['index/auth/setStatus', ['method' => 'post']], //--设置角色的状态【接口】
......
...@@ -9,7 +9,30 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina ...@@ -9,7 +9,30 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
auth.event (); auth.event ();
}, },
event: function () { event: function () {
$ (document).delegate (".anch", "click", function () {//点击编辑
auth.house_id = $ (this).attr ("data-id");
auth.Edit();
});
},
Edit:function(){
var caozuo_table="";
$.ajax({
'type': 'GET',
'url' : '/index/addAuth/group_id/',//获取编辑数据
data: {"id":auth.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$("input[name = id]").val(data.data.id);
$("input[name = title]").val(data.data.title);
$("#description").val(data.data.description);
}
} else {
alert('获取失败!');
}
}
});
}, },
getList: function (pageNo) { getList: function (pageNo) {
auth.pageNo = pageNo; auth.pageNo = pageNo;
......
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
</td> </td>
<td>[%= it[item]["status"] %]</td> <td>[%= it[item]["status"] %]</td>
<td> <td>
<a title="编辑" class="btn btn-success btn-xs" href="/admin.php/index/roleedit?id=[%= it[item]['id']%]" style="margin-right:6px;">编辑</a> <a class="btn1 btn-success " href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
<a title="权限分配" class="btn btn-info btn-xs" href="/admin.php/index/access?id=[%= it[item]['id']%]" style="margin-right:6px;">权限分配</a> <a class="btn btn-info btn-xs" href="/admin.php/index/access?id=[%= it[item]['id']%]" data-toggle="modal" data-id='[%= it[item]["id"] %]'>权限分配</a>
<a title="成员授权" class="btn btn-primary btn-xs" href="/admin.php/index/accessUser?id=[%= it[item]['id']%]" style="margin-right:6px;">成员授权</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
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