Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
0b56ae1b
提交
0b56ae1b
authored
6月 04, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(fix): 1.权限查询效率优化 2.替换权限开启图标,3.授权对象类型切换 授权资源权限依旧保留问题,4.开放普通用户 组织对菜单的授权
上级
03f43fde
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
41 行增加
和
17 行删除
+41
-17
ExtVAuthModelMapper.xml
.../java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml
+21
-10
lock_closed.svg
frontend/src/icons/svg/lock_closed.svg
+2
-2
lock_open.svg
frontend/src/icons/svg/lock_open.svg
+2
-2
authConfig.vue
frontend/src/views/system/authority/authConfig.vue
+3
-1
LazyTree.vue
frontend/src/views/system/authority/components/LazyTree.vue
+13
-2
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml
浏览文件 @
0b56ae1b
...
...
@@ -8,18 +8,30 @@
<result
column=
"leaf"
property=
"leaf"
/>
</resultMap>
<!-- 函数嵌套会导致循环调用函数 导致查询速度变慢 所有预先经需要嵌套查询的函数分解查询-->
<select
id=
"searchTree"
resultMap=
"BaseResultMapDTO"
>
SELECT
auth.*,
authCount.children_count AS children_count,
IF
(( authCount.children_count > 0 ), 0, 1 ) AS leaf
FROM (select get_grant_auths (#{modelType},#{createBy}) cids1) t1,
( SELECT * FROM (select get_grant_auths (#{modelType},#{createBy}) cids2) t2 ,v_auth_model
FROM (select get_grant_auths (#{modelType},#{createBy}) c_auth_ids) t1,
( SELECT * FROM (select GET_V_AUTH_MODEL_WITH_PARENT(get_grant_auths (#{modelType},#{createBy}),#{modelType}) c_auth_parent_ids) t2,
<if
test=
"withExtend == 'parent' and id != null"
>
(select GET_V_AUTH_MODEL_WITH_PARENT(#{id},#{modelType}) c_model_parent_ids) tmp,
</if>
<if
test=
"withExtend == 'children' and id != null"
>
(select GET_V_AUTH_MODEL_WITH_CHILDREN(#{id},#{modelType}) c_model_children_ids) tmc,
</if>
<if
test=
"name != null and name !='' and withExtend == 'parent'"
>
(select GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from
v_auth_model where model_type = #{modelType} and `name` like CONCAT('%', #{name},'%')) ,#{modelType}) c_model_parent_seartch_ids) tmsc,
</if>
v_auth_model
<where>
model_type = #{modelType}
<if
test=
"1== withAuth"
>
and FIND_IN_SET(v_auth_model.id,
GET_V_AUTH_MODEL_WITH_PARENT ( cids2 ,#{modelType})
)
and FIND_IN_SET(v_auth_model.id,
c_auth_parent_ids
)
</if>
<if
test=
"pid !=null"
>
and v_auth_model.pid = #{pid}
...
...
@@ -29,15 +41,14 @@
and v_auth_model.id = #{id}
</if>
<if
test=
"withExtend == 'parent' and id != null"
>
and FIND_IN_SET(v_auth_model.id,
GET_V_AUTH_MODEL_WITH_PARENT(#{id},#{modelType})
)
and FIND_IN_SET(v_auth_model.id,
c_model_parent_ids
)
</if>
<if
test=
"withExtend == 'children' and id != null"
>
and FIND_IN_SET(v_auth_model.id,
GET_V_AUTH_MODEL_WITH_CHILDREN(#{id},#{modelType})
)
and FIND_IN_SET(v_auth_model.id,
c_model_children_ids
)
</if>
<if
test=
"name != null and name !='' and withExtend == 'parent'"
>
and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from
v_auth_model where model_type = #{modelType} and `name` like CONCAT('%', #{name},'%')) ,#{modelType}))
and FIND_IN_SET(v_auth_model.id,c_model_parent_seartch_ids)
</if>
<if
test=
"name != null and name =='' and withExtend == 'parent'"
>
...
...
@@ -51,11 +62,11 @@
count( 1 ) AS `children_count`,
`authTemp`.`pid` AS `pid`
FROM
( SELECT * FROM (select
get_grant_auths (#{modelType},#{createBy
}) cids3) t3,v_auth_model
( SELECT * FROM (select
GET_V_AUTH_MODEL_WITH_PARENT(get_grant_auths (#{modelType},#{createBy}),#{modelType
}) cids3) t3,v_auth_model
<where>
model_type = #{modelType}
<if
test=
"1== withAuth"
>
and FIND_IN_SET(v_auth_model.id,
GET_V_AUTH_MODEL_WITH_PARENT ( cids3 ,#{modelType})
)
and FIND_IN_SET(v_auth_model.id,
cids3
)
</if>
</where>
) authTemp
...
...
@@ -65,7 +76,7 @@
auth.id = authCount.pid
<where>
<if
test=
"1== withAuth"
>
(authCount.children_count>0 or FIND_IN_SET(auth.id,c
ids1
) )
(authCount.children_count>0 or FIND_IN_SET(auth.id,c
_auth_ids
) )
</if>
</where>
...
...
frontend/src/icons/svg/lock_closed.svg
浏览文件 @
0b56ae1b
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1622003025732"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"7043"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M810.666667 213.333333l0 597.333333L213.333333 810.666667 213.333333 213.333333 810.666667 213.333333M810.666667 128 213.333333 128C166.4 128 128 166.4 128 213.333333l0 597.333333c0 46.933333 38.4 85.333333 85.333333 85.333333l597.333333 0c46.933333 0 85.333333-38.4 85.333333-85.333333L896 213.333333C896 166.4 857.6 128 810.666667 128L810.666667 128z"
p-id=
"7044"
fill=
"#bfbfbf"
></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1622801178544"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1323"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M2 512c0-141 114-255 255-255h510c141 0 255 114 255 255S908 767 767 767H257C116 767 2 653 2 512z m255 208.8c115.5 0 208.8-93.2 208.8-208.8S372.5 303.2 257 303.2c-115.5 0-208.8 93.2-208.8 208.8S141.5 720.8 257 720.8z"
fill=
"#DCDFE6"
p-id=
"1324"
></path></svg>
\ No newline at end of file
frontend/src/icons/svg/lock_open.svg
浏览文件 @
0b56ae1b
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1622002928181"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"6752"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M810.666667 128H213.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v597.333334c0 46.933333 38.4 85.333333 85.333333 85.333333h597.333334c46.933333 0 85.333333-38.4 85.333333-85.333333V213.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z m-384 597.333333l-213.333334-213.333333 59.733334-59.733333 153.6 153.6 324.266666-324.266667L810.666667 341.333333l-384 384z"
p-id=
"6753"
fill=
"#0a7be0"
></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1622801110786"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"17204"
data-spm-anchor-id=
"a313x.7781069.0.i2"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M2 512c0-141 114-255 255-255h510c141 0 255 114 255 255S908 767 767 767H257C116 767 2 653 2 512z m765 208.8c115.5 0 208.8-93.2 208.8-208.8S882.5 303.2 767 303.2c-115.5 0-208.8 93.2-208.8 208.8S651.5 720.8 767 720.8z"
fill=
"#0a7be0"
p-id=
"17205"
></path></svg>
\ No newline at end of file
frontend/src/views/system/authority/authConfig.vue
浏览文件 @
0b56ae1b
...
...
@@ -10,6 +10,7 @@
<el-tabs
v-model=
"targetActiveName"
:class=
"
{'de-search-header': showTargetSearchInput}" @tab-click="handleClick">
<el-tab-pane
v-for=
"(targetInfo, index) in targetInfoArray"
:key=
"index"
:lazy=
"true"
:label=
"targetInfo.tabName"
:name=
"targetInfo.authType"
>
<lazy-tree
v-if=
"targetActiveName===targetInfo.authType"
:active-name=
"targetActiveName"
:filter-text=
"targetFilterText"
:data-info=
"targetInfo"
...
...
@@ -35,6 +36,7 @@
:data-info=
"sourceInfo"
show-extent
:auth-condition=
"authCondition"
:attach-active-name=
"targetActiveName"
/>
</el-tab-pane>
</el-tabs>
...
...
@@ -115,7 +117,7 @@ export default {
head
:
this
.
$t
(
'auth.menuAuthHead'
),
direction
:
'source'
,
authType
:
'menu'
,
authTargets
:
'
role
'
authTargets
:
'
dept,role,user
'
}
],
targetActiveName
:
null
,
...
...
frontend/src/views/system/authority/components/LazyTree.vue
浏览文件 @
0b56ae1b
<
template
xmlns:el-col=
"http://www.w3.org/1999/html"
>
<el-col
class=
"tree-main"
>
<el-col
v-loading=
"loading"
class=
"tree-main"
>
<el-row
v-if=
"showExtent"
class=
"tree-head"
>
<span
style=
"float: left;padding-left: 10px"
>
{{
dataInfo
.
head
}}
</span>
<span
v-for=
"auth in defaultAuthDetails"
:key=
"auth.privilegeName"
class=
"auth-span"
>
...
...
@@ -67,6 +67,7 @@ export default {
type
:
String
,
required
:
true
},
attachActiveName
:
String
,
defaultProps
:
{
type
:
Object
,
required
:
false
,
...
...
@@ -85,6 +86,7 @@ export default {
},
data
()
{
return
{
loading
:
false
,
treeData
:
[],
changeIndex
:
0
,
timeMachine
:
null
,
...
...
@@ -119,6 +121,12 @@ export default {
this
.
loadAuth
()
},
deep
:
true
},
attachActiveName
:
{
handler
(
newVal
,
oldVla
)
{
this
.
authDetails
=
{}
},
deep
:
true
}
},
created
()
{
...
...
@@ -138,7 +146,8 @@ export default {
// 当前为授权数据 获取当前authTarget 的授权信息 authSource
authQueryCondition
=
{
authTarget
:
this
.
authCondition
.
id
,
authTargetType
:
this
.
authCondition
.
type
authTargetType
:
this
.
authCondition
.
type
,
authSourceType
:
this
.
dataInfo
.
authType
}
}
else
{
authQueryCondition
=
{
...
...
@@ -248,9 +257,11 @@ export default {
authDetail
:
auth
}
}
this
.
loading
=
true
authChange
(
authChangeCondition
).
then
(
res
=>
{
// 重新加载权限
this
.
loadAuth
()
this
.
loading
=
false
})
},
// 高亮显示搜索内容
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论