Commit 39f4b30d authored by 刘丹's avatar 刘丹

权限管理

parent 993c8a5f
......@@ -7,7 +7,7 @@
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">规则管理</a></li>
<li><a href="#">权限管理</a></li>
<li class="active">新增</li>
<div class="pull-right">
<ul class="bread_btn">
......@@ -50,7 +50,6 @@
<th>URL</th>
<th>排序</th>
<th>菜单</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
......
......@@ -24,7 +24,41 @@ authRule={
$ (document).delegate (".edit_add", "click", function () {//新增
authRule.Edid_add();
});
$ (document).delegate (".is_show", "click", function () {//点击禁用
if (!confirm('是否继续?')) {
return ;
}
authRule.id = $ (this).attr ("data-id");
var params ={
};
params.id = $ (this).attr ("data-id");
var str = $.trim($(this).html());
if (str === "正常") {
params.type = 1;
$(this).html('冻结');
} else if (str === "冻结"){
params.type = 0;
$(this).html('正常');
}else{
params.type = 2;
}
$.ajax({//禁用
'type': 'POST',
'url' : '/index/updateRoleStatus',
data: {"ids":authRule.id,"status":params.type},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
}
} else {
alert("禁用失败!")
}
}
});
});
},
Edid_add:function(){
$.ajax({
......@@ -67,6 +101,7 @@ authRule={
par.sort= $("input[name = sort]").val();
par.pid=$("#pid").val();
par.is_menu=$("input[name =is_menu]:checked").val();
params.search = $("input[name='search']").val();
$.ajax({
'type': 'POST',
'url' : '/index/updateAuthRule',
......
......@@ -12,11 +12,16 @@
<td>[%= it[item]["name"] %]</td>
<td>[%= it[item]["sort"] %]</td>
<td>[%= it[item]["is_menu"] %]</td>
<td>[%= it[item]["status"] %]</td>
<!--<td><span class="fa fa-check text-success"></span></td>-->
<td>
<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>
[% if(it[item]["status"] == 0) { %]
<a class="btn1 btn-info is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>正常</a>
[% }else if(it[item]["status"] == 1) { %]
<a class="btn1 btn-info is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>冻结</a>
[% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %]
</td>
</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