新增系统管理员管理默认角色不能取消提示
This commit is contained in:
@@ -63,6 +63,7 @@ public class CorpAdminController extends BaseController {
|
||||
user.setCorpCode(null);
|
||||
user.setCorpName(null);
|
||||
model.addAttribute("user", user);
|
||||
model.addAttribute("useCorpModel", Global.getConfigToBoolean("user.useCorpModel", "false"));
|
||||
return "modules/sys/user/corpAdminList";
|
||||
}
|
||||
|
||||
@@ -93,10 +94,14 @@ public class CorpAdminController extends BaseController {
|
||||
// 获取当前用户所拥有的角色
|
||||
Role role = new Role();
|
||||
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: 编辑
|
||||
model.addAttribute("op", op);
|
||||
model.addAttribute("user", user);
|
||||
model.addAttribute("useCorpModel", Global.getConfigToBoolean("user.useCorpModel", "false"));
|
||||
return "modules/sys/user/corpAdminForm";
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<#form:hidden path="userCode"/>
|
||||
<div class="box-body">
|
||||
<div class="form-unit">${text('基本信息')}</div>
|
||||
<div class="row ${@Global.getConfigToBoolean('user.useCorpModel', 'false')?'':'hide'}">
|
||||
<div class="row ${useCorpModel?'':'hide'}">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" title="">
|
||||
@@ -188,6 +188,18 @@ var roleGrid = $("#roleGrid").dataGrid({
|
||||
autoGridWidth: function(){
|
||||
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(){
|
||||
<% for (role in roleList!){ %>
|
||||
roleGrid.dataGrid('setSelectRow', '${role.roleCode}');
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||
<% if(hasPermi('sys:corpAdmin:edit')){ %>
|
||||
<% if(@Global.getConfigToBoolean('user.useCorpModel', 'false')){ %>
|
||||
<% if(useCorpModel){ %>
|
||||
<a href="${ctx}/sys/corpAdmin/form?op=addCorp" class="btn btn-default btnTool" title=" ${text('新增租户管理员')}"><i class="fa fa-plus"></i> ${text('新增租户管理员')}</a>
|
||||
<% }else{ %>
|
||||
<a href="${ctx}/sys/corpAdmin/form?corpCode_=${user.currentUser.corpCode_}&corpName_=${user.currentUser.corpName_}&op=addAdmin" class="btn btn-default btnTool" title="${text('新增管理员')}"><i class="fa fa-plus"></i> ${text('新增管理员')}</a>
|
||||
@@ -32,13 +32,13 @@
|
||||
<#form:input path="userName" maxlength="100" class="form-control width-90"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group ${@Global.getConfigToBoolean('user.useCorpModel', 'false')?'':'hide'}">
|
||||
<div class="form-group ${useCorpModel?'':'hide'}">
|
||||
<label class="control-label">${text('租户代码')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="corpCode_" maxlength="100" class="form-control width-90"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group ${@Global.getConfigToBoolean('user.useCorpModel', 'false')?'':'hide'}">
|
||||
<div class="form-group ${useCorpModel?'':'hide'}">
|
||||
<label class="control-label">${text('租户名称')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="corpName_" maxlength="100" class="form-control width-90"/>
|
||||
@@ -70,7 +70,7 @@ $('#dataGrid').dataGrid({
|
||||
return '<a href="${ctx}/sys/corpAdmin/form?userCode='+row.userCode+'&op=edit" class="btnList" data-title="${text("编辑用户")}">'+(val||row.id)+'</a>';
|
||||
}},
|
||||
{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:200, align:"center"},
|
||||
<% if(@Global.getConfigToBoolean('user.useCorpModel', 'false')){ %>
|
||||
<% if(useCorpModel){ %>
|
||||
{header:'${text("租户代码")}', name:'corpCode_', index:'a.corp_code', width:200, align:"center", formatter: function(val, obj, row, act){
|
||||
return '<a href="javascript:" onclick="$(\'#corpCode_\').val(\''+val+'\');$(\'#searchForm\').submit()">'+val+'</a>';
|
||||
}},
|
||||
@@ -93,7 +93,7 @@ $('#dataGrid').dataGrid({
|
||||
actions.push('<a href="${ctx}/sys/corpAdmin/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
actions.push('<a href="${ctx}/sys/corpAdmin/delete?userCode='+row.userCode+'" class="btnList" title="${text("删除用户")}" data-confirm="${text("确认要删除该用户吗?")}"><i class="fa fa-trash-o"></i></a> ');
|
||||
<% if(@Global.getConfigToBoolean('user.useCorpModel', 'false')){ %>
|
||||
<% if(useCorpModel){ %>
|
||||
actions.push('<a href="${ctx}/sys/corpAdmin/form?corpCode_='+row.corpCode_+'&corpName_='+row.corpName_+'&op=addAdmin" class="btnList" title="${text("新增管理员")}"><i class="fa fa-plus-square"></i></a> ');
|
||||
<% } %>
|
||||
actions.push('<a href="javascript:" class="btnMore" title="${text("更多操作")}"><i class="fa fa-chevron-circle-right"></i></a> ');
|
||||
|
||||
Reference in New Issue
Block a user