Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
26d429c7
提交
26d429c7
编写于
5月 15, 2020
作者:
laizhilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
菜单分配及权限分配树多选,一起生成角色权限关系
上级
d358d064
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
60 行增加
和
32 行删除
+60
-32
sys-permissionmpickup-view.less
...ys-permissionmpickup-view/sys-permissionmpickup-view.less
+3
-3
sys-permissionmpickup-view.vue
...sys-permissionmpickup-view/sys-permissionmpickup-view.vue
+37
-19
UAACoreService.java
...va/cn/ibizlab/core/extensions/service/UAACoreService.java
+20
-10
未找到文件。
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.less
浏览文件 @
26d429c7
...
...
@@ -32,7 +32,7 @@
line-height: 1.6;
font-weight: bold;
word-spacing: 10px;
height: 100%;
//
height: 100%;
overflow: auto;
}
.mpicker-select > div {
...
...
@@ -58,7 +58,7 @@
width: calc(100% - 380px);
.pickupviewpanel {
width: 100%;
height: 100%;
//
height: 100%;
}
}
}
...
...
@@ -106,7 +106,7 @@
margin-top:30px;margin-bottom:20px;margin-left:40px;
}
.roll{
height:
68
0px;overflow:hidden;overflow-x: hidden;overflow-y: auto;
height:
59
0px;overflow:hidden;overflow-x: hidden;overflow-y: auto;
}
.tre{
margin-left:20px;
...
...
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.vue
浏览文件 @
26d429c7
...
...
@@ -4,7 +4,7 @@
<div
class=
"content-container pickup-view"
>
<div
class=
"translate-contant"
>
<!--菜单分配-->
<div
class=
"center"
:style=
"
{width : '50%' }">
<div
class=
"center"
:style=
"
{width : '50%'
,border:'0px solid red'
}">
<context-menu-container
class=
'design-tree-container'
>
<div
>
<div
class=
"text"
>
菜单分配
</div>
...
...
@@ -26,7 +26,7 @@
</context-menu-container>
</div>
<!--权限分配-->
<div
class=
"center"
:style=
"
{width : '50%' }">
<div
class=
"center"
:style=
"
{width : '50%'
,border:'0px solid red'
}">
<context-menu-container
class=
'design-tree-container'
>
<div
>
<div
class=
"text"
>
权限分配
</div>
...
...
@@ -48,14 +48,16 @@
</context-menu-container>
</div>
</div>
<!--操作按钮-->
<card
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<row
:style=
"
{ textAlign: 'right' }">
<i-button
type=
"primary"
:disabled=
"this.selectData.length > 0 ? false : true"
@
click=
"onClickOk"
>
{{
this
.
containerModel
.
view_okbtn
.
text
}}
</i-button>
<i-button
@
click=
"onClickCancel"
>
{{
this
.
containerModel
.
view_cancelbtn
.
text
}}
</i-button>
</row>
</card>
<div>
<!--操作按钮-->
<card
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<row
:style=
"
{ textAlign: 'right',border:'0px solid red' }">
<i-button
type=
"primary"
:disabled=
"this.selectData.length > 0 ? false : true"
@
click=
"onClickOk"
>
{{
this
.
containerModel
.
view_okbtn
.
text
}}
</i-button>
<i-button
@
click=
"onClickCancel"
>
{{
this
.
containerModel
.
view_cancelbtn
.
text
}}
</i-button>
</row>
</card>
</div>
</div>
</card>
</div>
...
...
@@ -127,7 +129,7 @@
}
if
(
_this
.
parentData
&&
_this
.
parentData
.
srfparentkey
){
_this
.
srfparentkey
=
_this
.
parentData
.
srfparentkey
;
console
.
log
(
"父主键:"
+
_this
.
srfparentkey
);
//
console.log("父主键:" + _this.srfparentkey);
}
}
...
...
@@ -153,15 +155,20 @@
// 给树赋值,数据结构在后台已经按照eltree格式化
_this
.
CDdata
=
response
.
data
[
0
];
_this
.
QXdata
=
response
.
data
[
1
];
console
.
log
(
this
.
CDdata
)
// 树视图默认展开一级节点
if
(
_this
.
CDdata
&&
_this
.
CDdata
.
length
>
0
){
_this
.
CDdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
_this
.
CDdataexpandedKeys
.
push
(
item
[
index
].
id
);
if
(
item
[
index
].
id
){
_this
.
CDdataexpandedKeys
.
push
(
item
[
index
].
id
);
}
})
}
if
(
_this
.
QXdata
&&
_this
.
QXdata
.
length
>
0
){
_this
.
QXdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
_this
.
QXdataexpandedKeys
.
push
(
item
[
index
]);
if
(
item
[
index
].
id
){
_this
.
QXdataexpandedKeys
.
push
(
item
[
index
]);
}
})
}
}
...
...
@@ -180,8 +187,8 @@
const
QXtree
:
any
=
this
.
$refs
.
QXtree
;
// 获取选中状态的节点
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
());
// console.group("选中的node:" + arr);
this
.
selectData
=
arr
;
console
.
log
(
"选中的node:"
+
arr
);
}
/**
...
...
@@ -201,15 +208,26 @@
this
.
selectData
.
forEach
((
item
:
any
)
=>
{
let
_itemTemp
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
let
_item
:
any
=
{};
if
(
!
_itemTemp
.
children
){
// 是末节点则为库中存在的权限数据,添加到viewSelections
_item
.
srfdataaccaction
=
_itemTemp
.
i
d
;
_item
.
srfkey
=
_itemTemp
.
i
d
;
_item
.
sys_permission
=
_itemTemp
.
i
d
;
_item
.
sys_permissionid
=
_itemTemp
.
i
d
;
if
(
_itemTemp
.
sys_permissionId
)
{
// 一级菜单
_item
.
srfdataaccaction
=
_itemTemp
.
sys_permissionI
d
;
_item
.
srfkey
=
_itemTemp
.
sys_permissionI
d
;
_item
.
sys_permission
=
_itemTemp
.
sys_permissionI
d
;
_item
.
sys_permissionid
=
_itemTemp
.
sys_permissionI
d
;
_item
.
srfmajortext
=
_itemTemp
.
label
;
_item
.
sys_permissionname
=
_itemTemp
.
label
;
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
}
else
{
if
(
!
_itemTemp
.
children
){
// 是末节点则为库中存在的权限数据,添加到viewSelections
_item
.
srfdataaccaction
=
_itemTemp
.
id
;
_item
.
srfkey
=
_itemTemp
.
id
;
_item
.
sys_permission
=
_itemTemp
.
id
;
_item
.
sys_permissionid
=
_itemTemp
.
id
;
_item
.
srfmajortext
=
_itemTemp
.
label
;
_item
.
sys_permissionname
=
_itemTemp
.
label
;
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
}
}
});
}
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/extensions/service/UAACoreService.java
浏览文件 @
26d429c7
...
...
@@ -2,6 +2,7 @@ package cn.ibizlab.core.extensions.service;
import
cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService
;
import
cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -20,7 +21,8 @@ import java.util.Set;
public
class
UAACoreService
{
@Autowired
private
ISYS_PERMISSIONService
isys_permissionService
;
@Autowired
private
ISYS_PSAPPMENUITEMService
isys_psappmenuitemService
;
/**
* 获取用户菜单
*
...
...
@@ -35,8 +37,10 @@ public class UAACoreService {
nPermissionSQL
.
append
(
"SELECT "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid, "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname, "
);
nPermissionSQL
.
append
(
" t1.PERMISSIONID as permissionid, "
);
nPermissionSQL
.
append
(
" t1.P_PERMISSIONID as p_permissionid, "
);
// nPermissionSQL.append(" t1.PERMISSIONID as permissionid, ");
nPermissionSQL
.
append
(
" t1.PSAPPMENUITEMID as permissionid, "
);
// nPermissionSQL.append(" t1.P_PERMISSIONID as p_permissionid, ");
nPermissionSQL
.
append
(
" t1.PSAPPPMENUITEMID as p_permissionid, "
);
nPermissionSQL
.
append
(
" t1.PSAPPID as psappid, "
);
nPermissionSQL
.
append
(
" t1.PSAPPNAME as psappname, "
);
nPermissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid, "
);
...
...
@@ -49,8 +53,10 @@ public class UAACoreService {
permissionSQL
.
append
(
"SELECT "
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid,"
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname,"
);
permissionSQL
.
append
(
" t1.PERMISSIONID as permissionid,"
);
permissionSQL
.
append
(
" t1.P_PERMISSIONID as p_permissionid,"
);
// permissionSQL.append(" t1.PERMISSIONID as permissionid, ");
permissionSQL
.
append
(
" t1.PSAPPMENUITEMID as psappmenuitemid, "
);
// permissionSQL.append(" t1.P_PERMISSIONID as p_permissionid, ");
permissionSQL
.
append
(
" t1.PSAPPPMENUITEMID as psapppmenuitemid, "
);
permissionSQL
.
append
(
" t1.PSAPPID as psappid,"
);
permissionSQL
.
append
(
" t1.PSAPPNAME as psappname,"
);
permissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid,"
);
...
...
@@ -62,9 +68,9 @@ public class UAACoreService {
List
<
JSONObject
>
permissions
;
if
(
StringUtils
.
isEmpty
(
systemid
))
{
permissions
=
isys_p
ermission
Service
.
select
(
nPermissionSQL
.
toString
(),
null
);
permissions
=
isys_p
sappmenuitem
Service
.
select
(
nPermissionSQL
.
toString
(),
null
);
}
else
{
permissions
=
isys_p
ermission
Service
.
select
(
permissionSQL
.
toString
(),
null
);
permissions
=
isys_p
sappmenuitem
Service
.
select
(
permissionSQL
.
toString
(),
null
);
}
JSONArray
treeNode
=
new
JSONArray
();
...
...
@@ -105,11 +111,14 @@ public class UAACoreService {
String
str_appMenuName
=
String
.
format
(
"%s"
,
obj
.
get
(
"psappmenuname"
));
String
systemId
=
String
.
format
(
"%s"
,
obj
.
get
(
"systemid"
));
String
sys_permissionId
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%s%s"
,
systemId
,
obj
.
get
(
"permissionid"
)).
getBytes
());
// String sys_permissionId = DigestUtils.md5DigestAsHex(String.format("%s%s", systemId, obj.get("permissionid")).getBytes());
String
permissionId
=
String
.
format
(
"%s"
,
obj
.
get
(
"permissionid"
));
String
sys_permissionId
=
String
.
format
(
"%s"
,
obj
.
get
(
"sys_permissionid"
));
String
p_sys_permissionId
=
""
;
if
(!
StringUtils
.
isEmpty
(
obj
.
get
(
"p_permissionid"
)))
{
p_sys_permissionId
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%s%s"
,
systemId
,
obj
.
get
(
"p_permissionid"
)).
getBytes
());
// p_sys_permissionId = DigestUtils.md5DigestAsHex(String.format("%s%s", systemId, obj.get("p_permissionid")).getBytes());
p_sys_permissionId
=
String
.
format
(
"%s"
,
obj
.
get
(
"p_permissionid"
));
}
JSONObject
cur_app
=
new
JSONObject
();
...
...
@@ -122,7 +131,8 @@ public class UAACoreService {
cur_app_menu
=
cur_app
.
getJSONArray
(
str_appMenu
);
JSONObject
permission
=
new
JSONObject
();
permission
.
put
(
"id"
,
sys_permissionId
);
permission
.
put
(
"id"
,
permissionId
);
permission
.
put
(
"sys_permissionId"
,
sys_permissionId
);
permission
.
put
(
"pid"
,
p_sys_permissionId
);
permission
.
put
(
"label"
,
obj
.
get
(
"sys_permissionname"
));
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录