Authored by qinchao

用户权限

... ... @@ -124,6 +124,8 @@ public class HttpUriContants {
public static final String USER_OPERATE = "/user/operate";
public static final String USER_LDAP_FLAG = "/user/getLdapFlag";
public static final String USER_BY_AUTH_GROUP = "/user/getUsersByAuthGroup";
public static final String APP_ADD_SEESION = "/user/appAddSession";
public static final String APP_GET_SEESION = "/user/appGetSession";
public static final String APP_REMOVE_SEESION = "/user/appRemoveSession";
... ...
... ... @@ -66,6 +66,17 @@ public class ManagerCtrl {
return response;
}
@RequestMapping("/getUsersByAuthGroup")
@ResponseBody
public BaseResponse getUsersByAuthGroup(String id) {
if(id==null){
id="";
}
BaseResponse response = httpRestClient.defaultPost(HttpUriContants.USER_BY_AUTH_GROUP+"?id="+id, null
, BaseResponse.class);
return response;
}
@RequestMapping("/saveAuthGroup")
@ResponseBody
public BaseResponse saveAuthGroup(@RequestBody AuthGroup authGroup) {
... ...
... ... @@ -134,6 +134,27 @@
<!-- /.modal -->
</div>
<!-- 权限组下的用列表 -->
<div class="modal fade" id="myUserModal" tabindex="-1" role="dialog" aria-labelledby="myUserModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width:800px">
<div class="modal-content" style="width: 140%">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myUserModalLabel"></h4>
</div>
<div class="modal-body">
<div id="userTable"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
<script>
$("#li_manager").addClass("active open");
... ... @@ -182,6 +203,32 @@
}
});
//加载表格
$("#userTable").table({
columnAutoWidth: false,
url: contextPath + "/manage/getUsersByAuthGroup",
striped: true,
//title: "用户信息列表",
pagination: false,
pageSize: 10,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [{
title: "用户名",
field: "name",
width: "30%"
},{
title: "中文名",
field: "cname",
width: "50%"
},{
title: "职责",
field: "role",
width: "20%"
}]
});
});
function refreshAuthgroup(){
... ... @@ -210,9 +257,11 @@
width: "40%"
},{
title: "操作",
width: "10%",
width: "15%",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
$("<button onclick=\"showUserInAuthGroup(\'" + rowData.id + "\',\'" + rowData.name +"\')\">").addClass("btn btn-xs btn-info").html("人员").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"editAuthGroup(\'" + rowData.id + "\',\'" + rowData.name + "\',\'" + rowData.modules+"\')\">").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"deleteAuthGroup(\'" + rowData.id + "\')\">").addClass("btn btn-xs btn-danger").html("删除").appendTo(div);
... ... @@ -222,6 +271,13 @@
});
}
function showUserInAuthGroup(id, name) {
$("#userTable").table("loadLoaclData",[]);
$("#userTable").table("load",{
id:id
});
$("#myUserModal").modal('show');
}
//打开新增或修改页面
function editAuthGroup(id, name,modules) {
$("#hostGroupForm #messageAlert").hide();
... ...
... ... @@ -286,11 +286,11 @@
title: "模块组",
field: "moduleGroups",
width: "15%"
}*/,{
}*//*,{
title: "模块",
field: "modules",
width: "20%"
},{
}*/,{
title: "邮箱",
field: "email",
width: "15%"
... ...