新增系统管理员管理默认角色不能取消提示
This commit is contained in:
@@ -93,7 +93,10 @@ public class CorpAdminController extends BaseController {
|
|||||||
// 获取当前用户所拥有的角色
|
// 获取当前用户所拥有的角色
|
||||||
Role role = new Role();
|
Role role = new Role();
|
||||||
role.setUserCode(user.getUserCode());
|
role.setUserCode(user.getUserCode());
|
||||||
model.addAttribute("roleList", roleService.findListByUserCode(role));
|
List<Role> roleList = roleService.findListByUserCode(role);
|
||||||
|
roleList.add(new Role(Role.CORP_ADMIN_ROLE_CODE));
|
||||||
|
model.addAttribute("roleList", roleList);
|
||||||
|
model.addAttribute("corpAdminRoleCode", Role.CORP_ADMIN_ROLE_CODE);
|
||||||
// 操作类型:addCorp: 添加租户; addAdmin: 添加管理员; edit: 编辑
|
// 操作类型:addCorp: 添加租户; addAdmin: 添加管理员; edit: 编辑
|
||||||
model.addAttribute("op", op);
|
model.addAttribute("op", op);
|
||||||
model.addAttribute("user", user);
|
model.addAttribute("user", user);
|
||||||
|
|||||||
@@ -190,6 +190,18 @@ var roleGrid = $("#roleGrid").dataGrid({
|
|||||||
autoGridWidth: function(){
|
autoGridWidth: function(){
|
||||||
return $('#inputForm .box-body').width()-20;
|
return $('#inputForm .box-body').width()-20;
|
||||||
},
|
},
|
||||||
|
onSelectRow: function(id, isSelect, event){
|
||||||
|
if (!isSelect && id == '${corpAdminRoleCode}') {
|
||||||
|
js.showMessage('${text("该角色为管理员默认,不能取消。")}');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSelectAll: function(ids, isSelect){
|
||||||
|
for (var i=0; i<ids.length; i++){
|
||||||
|
if (!isSelect && ids[i] == '${corpAdminRoleCode}') {
|
||||||
|
js.showMessage('${text("该角色为管理员默认,不能取消。")}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
ajaxSuccess: function(){
|
ajaxSuccess: function(){
|
||||||
<% for (role in roleList!){ %>
|
<% for (role in roleList!){ %>
|
||||||
roleGrid.dataGrid('setSelectRow', '${role.roleCode}');
|
roleGrid.dataGrid('setSelectRow', '${role.roleCode}');
|
||||||
|
|||||||
Reference in New Issue
Block a user