修改角色
This commit is contained in:
parent
654ce056e4
commit
18e65eda0a
|
@ -102,6 +102,7 @@ public class SysRoleController extends BaseController
|
||||||
}
|
}
|
||||||
role.setCreateBy(ShiroUtils.getLoginName());
|
role.setCreateBy(ShiroUtils.getLoginName());
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
|
role.setParentId(0L);
|
||||||
return toAjax(roleService.insertRole(role));
|
return toAjax(roleService.insertRole(role));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,16 +8,6 @@
|
||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-role-edit" th:object="${role}">
|
<form class="form-horizontal m" id="form-role-edit" th:object="${role}">
|
||||||
<input id="roleId" name="roleId" type="hidden" th:field="*{roleId}"/>
|
<input id="roleId" name="roleId" type="hidden" th:field="*{roleId}"/>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">父角色名称:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<div class="input-group">
|
|
||||||
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
|
|
||||||
<input class="form-control" type="text" onclick="selectRoleTree()" id="treeName" readonly="true" th:field="*{roleName}" required>
|
|
||||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">角色名称:</label>
|
<label class="col-sm-3 control-label is-required">角色名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
|
@ -127,23 +117,6 @@
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
/*角色信息-新增-选择父部门树*/
|
|
||||||
function selectRoleTree() {
|
|
||||||
var options = {
|
|
||||||
title: '角色信息选择',
|
|
||||||
width: "380",
|
|
||||||
url: ctx + "system/role/selectRoleTree/" + $("#treeId").val(),
|
|
||||||
callBack: doSubmit
|
|
||||||
};
|
|
||||||
$.modal.openOptions(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
function doSubmit(index, layero){
|
|
||||||
var body = layer.getChildFrame('body', index);
|
|
||||||
$("#treeId").val(body.find('#treeId').val());
|
|
||||||
$("#treeName").val(body.find('#treeName').val());
|
|
||||||
layer.close(index);
|
|
||||||
}
|
|
||||||
function edit() {
|
function edit() {
|
||||||
var parentId = $("input[name='parentId']").val();
|
var parentId = $("input[name='parentId']").val();
|
||||||
var roleId = $("input[name='roleId']").val();
|
var roleId = $("input[name='roleId']").val();
|
||||||
|
@ -158,7 +131,7 @@
|
||||||
type : "POST",
|
type : "POST",
|
||||||
url : ctx + "system/role/edit",
|
url : ctx + "system/role/edit",
|
||||||
data : {
|
data : {
|
||||||
"parentId": parentId,
|
"parentId": 0,
|
||||||
"roleId": roleId,
|
"roleId": roleId,
|
||||||
"roleName": roleName,
|
"roleName": roleName,
|
||||||
"roleKey": roleKey,
|
"roleKey": roleKey,
|
||||||
|
|
|
@ -41,18 +41,9 @@
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:role:add">
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:role:add">
|
||||||
<i class="fa fa-plus"></i> 新增
|
<i class="fa fa-plus"></i> 新增
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:role:edit">
|
|
||||||
<i class="fa fa-edit"></i> 修改
|
|
||||||
</a>
|
|
||||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:role:remove">
|
|
||||||
<i class="fa fa-remove"></i> 删除
|
|
||||||
</a>
|
|
||||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export">
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export">
|
||||||
<i class="fa fa-download"></i> 导出
|
<i class="fa fa-download"></i> 导出
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-info" id="expandAllBtn">
|
|
||||||
<i class="fa fa-exchange"></i> 展开/折叠
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-12 select-table table-striped">
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
|
Loading…
Reference in New Issue