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 @@
...
@@ -32,7 +32,7 @@
line-height: 1.6;
line-height: 1.6;
font-weight: bold;
font-weight: bold;
word-spacing: 10px;
word-spacing: 10px;
height: 100%;
//
height: 100%;
overflow: auto;
overflow: auto;
}
}
.mpicker-select > div {
.mpicker-select > div {
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
width: calc(100% - 380px);
width: calc(100% - 380px);
.pickupviewpanel {
.pickupviewpanel {
width: 100%;
width: 100%;
height: 100%;
//
height: 100%;
}
}
}
}
}
}
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
margin-top:30px;margin-bottom:20px;margin-left:40px;
margin-top:30px;margin-bottom:20px;margin-left:40px;
}
}
.roll{
.roll{
height:
68
0px;overflow:hidden;overflow-x: hidden;overflow-y: auto;
height:
59
0px;overflow:hidden;overflow-x: hidden;overflow-y: auto;
}
}
.tre{
.tre{
margin-left:20px;
margin-left:20px;
...
...
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.vue
浏览文件 @
26d429c7
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"content-container pickup-view"
>
<div
class=
"content-container pickup-view"
>
<div
class=
"translate-contant"
>
<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'
>
<context-menu-container
class=
'design-tree-container'
>
<div
>
<div
>
<div
class=
"text"
>
菜单分配
</div>
<div
class=
"text"
>
菜单分配
</div>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</context-menu-container>
</context-menu-container>
</div>
</div>
<!--权限分配-->
<!--权限分配-->
<div
class=
"center"
:style=
"
{width : '50%' }">
<div
class=
"center"
:style=
"
{width : '50%'
,border:'0px solid red'
}">
<context-menu-container
class=
'design-tree-container'
>
<context-menu-container
class=
'design-tree-container'
>
<div
>
<div
>
<div
class=
"text"
>
权限分配
</div>
<div
class=
"text"
>
权限分配
</div>
...
@@ -48,15 +48,17 @@
...
@@ -48,15 +48,17 @@
</context-menu-container>
</context-menu-container>
</div>
</div>
</div>
</div>
<div>
<!--操作按钮-->
<!--操作按钮-->
<card
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<card
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<row
:style=
"
{ textAlign: 'right
' }">
<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
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>
<i-button
@
click=
"onClickCancel"
>
{{
this
.
containerModel
.
view_cancelbtn
.
text
}}
</i-button>
</row>
</row>
</card>
</card>
</div>
</div>
</div>
</card>
</card>
</div>
</div>
</
template
>
</
template
>
...
@@ -127,7 +129,7 @@
...
@@ -127,7 +129,7 @@
}
}
if
(
_this
.
parentData
&&
_this
.
parentData
.
srfparentkey
){
if
(
_this
.
parentData
&&
_this
.
parentData
.
srfparentkey
){
_this
.
srfparentkey
=
_this
.
parentData
.
srfparentkey
;
_this
.
srfparentkey
=
_this
.
parentData
.
srfparentkey
;
console
.
log
(
"父主键:"
+
_this
.
srfparentkey
);
//
console.log("父主键:" + _this.srfparentkey);
}
}
}
}
...
@@ -153,15 +155,20 @@
...
@@ -153,15 +155,20 @@
// 给树赋值,数据结构在后台已经按照eltree格式化
// 给树赋值,数据结构在后台已经按照eltree格式化
_this
.
CDdata
=
response
.
data
[
0
];
_this
.
CDdata
=
response
.
data
[
0
];
_this
.
QXdata
=
response
.
data
[
1
];
_this
.
QXdata
=
response
.
data
[
1
];
console
.
log
(
this
.
CDdata
)
// 树视图默认展开一级节点
// 树视图默认展开一级节点
if
(
_this
.
CDdata
&&
_this
.
CDdata
.
length
>
0
){
if
(
_this
.
CDdata
&&
_this
.
CDdata
.
length
>
0
){
_this
.
CDdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
_this
.
CDdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
if
(
item
[
index
].
id
){
_this
.
CDdataexpandedKeys
.
push
(
item
[
index
].
id
);
_this
.
CDdataexpandedKeys
.
push
(
item
[
index
].
id
);
}
})
})
}
}
if
(
_this
.
QXdata
&&
_this
.
QXdata
.
length
>
0
){
if
(
_this
.
QXdata
&&
_this
.
QXdata
.
length
>
0
){
_this
.
QXdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
_this
.
QXdata
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
if
(
item
[
index
].
id
){
_this
.
QXdataexpandedKeys
.
push
(
item
[
index
]);
_this
.
QXdataexpandedKeys
.
push
(
item
[
index
]);
}
})
})
}
}
}
}
...
@@ -180,8 +187,8 @@
...
@@ -180,8 +187,8 @@
const
QXtree
:
any
=
this
.
$refs
.
QXtree
;
const
QXtree
:
any
=
this
.
$refs
.
QXtree
;
// 获取选中状态的节点
// 获取选中状态的节点
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
());
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
());
// console.group("选中的node:" + arr);
this
.
selectData
=
arr
;
this
.
selectData
=
arr
;
console
.
log
(
"选中的node:"
+
arr
);
}
}
/**
/**
...
@@ -201,6 +208,16 @@
...
@@ -201,6 +208,16 @@
this
.
selectData
.
forEach
((
item
:
any
)
=>
{
this
.
selectData
.
forEach
((
item
:
any
)
=>
{
let
_itemTemp
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
let
_itemTemp
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
let
_item
:
any
=
{};
let
_item
:
any
=
{};
if
(
_itemTemp
.
sys_permissionId
)
{
// 一级菜单
_item
.
srfdataaccaction
=
_itemTemp
.
sys_permissionId
;
_item
.
srfkey
=
_itemTemp
.
sys_permissionId
;
_item
.
sys_permission
=
_itemTemp
.
sys_permissionId
;
_item
.
sys_permissionid
=
_itemTemp
.
sys_permissionId
;
_item
.
srfmajortext
=
_itemTemp
.
label
;
_item
.
sys_permissionname
=
_itemTemp
.
label
;
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
}
else
{
if
(
!
_itemTemp
.
children
){
// 是末节点则为库中存在的权限数据,添加到viewSelections
if
(
!
_itemTemp
.
children
){
// 是末节点则为库中存在的权限数据,添加到viewSelections
_item
.
srfdataaccaction
=
_itemTemp
.
id
;
_item
.
srfdataaccaction
=
_itemTemp
.
id
;
_item
.
srfkey
=
_itemTemp
.
id
;
_item
.
srfkey
=
_itemTemp
.
id
;
...
@@ -211,6 +228,7 @@
...
@@ -211,6 +228,7 @@
Object
.
assign
(
_item
,
{
_select
:
false
})
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
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;
...
@@ -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_PERMISSIONService
;
import
cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -20,7 +21,8 @@ import java.util.Set;
...
@@ -20,7 +21,8 @@ import java.util.Set;
public
class
UAACoreService
{
public
class
UAACoreService
{
@Autowired
@Autowired
private
ISYS_PERMISSIONService
isys_permissionService
;
private
ISYS_PERMISSIONService
isys_permissionService
;
@Autowired
private
ISYS_PSAPPMENUITEMService
isys_psappmenuitemService
;
/**
/**
* 获取用户菜单
* 获取用户菜单
*
*
...
@@ -35,8 +37,10 @@ public class UAACoreService {
...
@@ -35,8 +37,10 @@ public class UAACoreService {
nPermissionSQL
.
append
(
"SELECT "
);
nPermissionSQL
.
append
(
"SELECT "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid, "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid, "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname, "
);
nPermissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname, "
);
nPermissionSQL
.
append
(
" t1.PERMISSIONID as permissionid, "
);
// nPermissionSQL.append(" t1.PERMISSIONID as permissionid, ");
nPermissionSQL
.
append
(
" t1.P_PERMISSIONID as p_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.PSAPPID as psappid, "
);
nPermissionSQL
.
append
(
" t1.PSAPPNAME as psappname, "
);
nPermissionSQL
.
append
(
" t1.PSAPPNAME as psappname, "
);
nPermissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid, "
);
nPermissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid, "
);
...
@@ -49,8 +53,10 @@ public class UAACoreService {
...
@@ -49,8 +53,10 @@ public class UAACoreService {
permissionSQL
.
append
(
"SELECT "
);
permissionSQL
.
append
(
"SELECT "
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid,"
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid,"
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname,"
);
permissionSQL
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname,"
);
permissionSQL
.
append
(
" t1.PERMISSIONID as permissionid,"
);
// permissionSQL.append(" t1.PERMISSIONID as permissionid, ");
permissionSQL
.
append
(
" t1.P_PERMISSIONID as p_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.PSAPPID as psappid,"
);
permissionSQL
.
append
(
" t1.PSAPPNAME as psappname,"
);
permissionSQL
.
append
(
" t1.PSAPPNAME as psappname,"
);
permissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid,"
);
permissionSQL
.
append
(
" t1.PSAPPMENUID as psappmenuid,"
);
...
@@ -62,9 +68,9 @@ public class UAACoreService {
...
@@ -62,9 +68,9 @@ public class UAACoreService {
List
<
JSONObject
>
permissions
;
List
<
JSONObject
>
permissions
;
if
(
StringUtils
.
isEmpty
(
systemid
))
{
if
(
StringUtils
.
isEmpty
(
systemid
))
{
permissions
=
isys_p
ermission
Service
.
select
(
nPermissionSQL
.
toString
(),
null
);
permissions
=
isys_p
sappmenuitem
Service
.
select
(
nPermissionSQL
.
toString
(),
null
);
}
else
{
}
else
{
permissions
=
isys_p
ermission
Service
.
select
(
permissionSQL
.
toString
(),
null
);
permissions
=
isys_p
sappmenuitem
Service
.
select
(
permissionSQL
.
toString
(),
null
);
}
}
JSONArray
treeNode
=
new
JSONArray
();
JSONArray
treeNode
=
new
JSONArray
();
...
@@ -105,11 +111,14 @@ public class UAACoreService {
...
@@ -105,11 +111,14 @@ public class UAACoreService {
String
str_appMenuName
=
String
.
format
(
"%s"
,
obj
.
get
(
"psappmenuname"
));
String
str_appMenuName
=
String
.
format
(
"%s"
,
obj
.
get
(
"psappmenuname"
));
String
systemId
=
String
.
format
(
"%s"
,
obj
.
get
(
"systemid"
));
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
=
""
;
String
p_sys_permissionId
=
""
;
if
(!
StringUtils
.
isEmpty
(
obj
.
get
(
"p_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
();
JSONObject
cur_app
=
new
JSONObject
();
...
@@ -122,7 +131,8 @@ public class UAACoreService {
...
@@ -122,7 +131,8 @@ public class UAACoreService {
cur_app_menu
=
cur_app
.
getJSONArray
(
str_appMenu
);
cur_app_menu
=
cur_app
.
getJSONArray
(
str_appMenu
);
JSONObject
permission
=
new
JSONObject
();
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
(
"pid"
,
p_sys_permissionId
);
permission
.
put
(
"label"
,
obj
.
get
(
"sys_permissionname"
));
permission
.
put
(
"label"
,
obj
.
get
(
"sys_permissionname"
));
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录