提交 acd03eba 编写于 作者: laizhilong's avatar laizhilong

角色权限关系自定义视图

上级 9af176a3
.sys-role-permissioncustom-view{
.sys-permissionmpickup-view{
position: relative; position: relative;
.tree-right-menu {
.ivu-divider-horizontal {
width: calc(100% - 32px);
min-width: calc(100% - 32px);
margin: 0 auto;
}
.ivu-dropdown-item {
position: relative;
padding-left: 32px;
> i {
position: absolute;
left: 16px;
top: 10px;
}
.ivu-icon-ios-arrow-forward {
left: initial;
right: 4px;
}
}
.ivu-dropdown {
.ivu-select-dropdown {
margin: 0;
}
}
}
.text{
font-weight: 700;color: #303133;font-size: 15px;margin-left:10px;margin-top:20px;
}
.col{
display: inline-block;
width: 400px;
}
.search{
width:200px;margin-left:20px;margin-top:30px;margin-bottom:20px;
}
.save{
margin-top:30px;margin-bottom:20px;margin-left:40px;
}
.roll{
height:calc(100vh - 445px) ;overflow:hidden;overflow-x: hidden;overflow-y: auto;
}
.tre{
margin-left:20px;
}
} }
.pickup-view {
>.translate-contant {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
.translate-buttons {
width: 80px;
display: flex;
align-items: center;
text-align: center;
button {
margin-bottom: 5px;
}
}
.left, .right {
width: 300px;
}
.right {
border: 1px solid #e9e9e9;
.mpicker-select {
font-family: helvetica, sans-serif;
font-size: 16px;
text-align: justify;
word-spacing: -3.8pt;
line-height: 1.6;
font-weight: bold;
word-spacing: 10px;
//height: 100%;
overflow: auto;
}
.mpicker-select > div {
padding: 3px 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
font-weight: initial;
cursor: pointer;
min-height: 28px;
border: 1px solid #e9e9e9;
margin: 4px 4px;
transition: all .3s;
}
.mpicker-select > div:hover {
background: #ecf6fd;
}
.mpicker-select > .select{
color: #108ee9;
background: #ecf6fd;
}
}
.center{
width: calc(100% - 380px);
.pickupviewpanel {
width: 100%;
//height: 100%;
}
}
}
>.footer {
height: 64px;
}
}
// this is less
package cn.ibizlab.core.extensions.service; package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.uaa.domain.SYS_ROLE_PERMISSION;
import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService; import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService;
import cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService; import cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService;
import cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService; import cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService;
...@@ -647,5 +648,22 @@ public class UAACoreService { ...@@ -647,5 +648,22 @@ public class UAACoreService {
isys_role_permissionService.removeByRoleid(roleid); isys_role_permissionService.removeByRoleid(roleid);
} }
/**
* 根据角色id保存选中的权限信息
* @param roleid
* @param checkedNodes
*/
public void saveRolePermissionByRoleid(String roleid, JSONArray checkedNodes) {
for (int i = 0; i < checkedNodes.size(); i++) {
JSONObject obj = checkedNodes.getJSONObject(i);
SYS_ROLE_PERMISSION rolePermission = new SYS_ROLE_PERMISSION();
rolePermission.setRoleid(roleid);
rolePermission.setPermissionid(obj.getString("sys_permissionid"));
isys_role_permissionService.save(rolePermission);
}
}
} }
...@@ -56,4 +56,28 @@ public class UAACoreResource { ...@@ -56,4 +56,28 @@ public class UAACoreResource {
return ResponseEntity.ok(resObj); return ResponseEntity.ok(resObj);
} }
/**
* 保存选中的权限信息
* @param param
* @return
*/
@PostMapping(value = "/sys_permissions/saveRolePermissionByRoleid")
public ResponseEntity<JSONObject> saveRolePermissionByRoleid(@RequestBody JSONObject param) {
JSONObject resObj = new JSONObject();
// 角色id
String roleid = param.getString("roleid");
if (StringUtils.isEmpty(roleid))
new BadRequestAlertException("操作失败,未获取到当前角色标识!","","");
// 选中的权限信息
JSONArray checkedNodes = param.getJSONArray("checkedNodes");
if (checkedNodes.size() > 0) {
// save操作
uaaCoreService.saveRolePermissionByRoleid(roleid, checkedNodes);
} else {
new BadRequestAlertException("操作失败,未获取到选中数据!","","");
}
return ResponseEntity.ok(resObj);
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册