Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
68f6a6e7
提交
68f6a6e7
authored
11月 30, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(权限): 统一授权数据集tree
上级
6f50a9ca
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
54 行删除
+49
-54
ExtVAuthModelMapper.java
...java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java
+1
-1
ExtVAuthModelMapper.xml
.../java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml
+11
-7
DatasetGroupSelectorTree.vue
...end/src/views/dataset/common/DatasetGroupSelectorTree.vue
+37
-46
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java
浏览文件 @
68f6a6e7
...
@@ -8,6 +8,6 @@ import java.util.List;
...
@@ -8,6 +8,6 @@ import java.util.List;
public
interface
ExtVAuthModelMapper
{
public
interface
ExtVAuthModelMapper
{
List
<
VAuthModelDTO
>
queryAuthModel
(
@Param
(
"record"
)
VAuthModelRequest
re
quest
);
List
<
VAuthModelDTO
>
queryAuthModel
(
@Param
(
"record"
)
VAuthModelRequest
re
cord
);
}
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml
浏览文件 @
68f6a6e7
...
@@ -19,9 +19,10 @@
...
@@ -19,9 +19,10 @@
v_auth_model.create_by,
v_auth_model.create_by,
v_auth_model.level,
v_auth_model.level,
v_auth_model.mode,
v_auth_model.mode,
v_auth_model.data_source_id,
authInfo.PRIVILEGES AS `privileges`
authInfo.PRIVILEGES AS `privileges`
FROM
FROM
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{re
quest.userId}, #{request
.modelType} ) cids ) t,
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{re
cord.userId}, #{record
.modelType} ) cids ) t,
v_auth_model
v_auth_model
LEFT JOIN (
LEFT JOIN (
SELECT
SELECT
...
@@ -35,19 +36,19 @@
...
@@ -35,19 +36,19 @@
)))
)))
WHERE
WHERE
sys_auth_detail.privilege_value = 1
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = #{re
quest
.modelType}
AND sys_auth.auth_source_type = #{re
cord
.modelType}
AND (
AND (
(
(
sys_auth.auth_target_type = 'dept'
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{re
quest
.userId} )
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{re
cord
.userId} )
)
)
OR (
OR (
sys_auth.auth_target_type = 'user'
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{re
quest
.userId}
AND sys_auth.auth_target = #{re
cord
.userId}
)
)
OR (
OR (
sys_auth.auth_target_type = 'role'
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{re
quest
.userId} )
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{re
cord
.userId} )
)
)
)
)
GROUP BY
GROUP BY
...
@@ -92,11 +93,14 @@
...
@@ -92,11 +93,14 @@
and v_auth_model.`label` = #{record.label,jdbcType=LONGVARCHAR}
and v_auth_model.`label` = #{record.label,jdbcType=LONGVARCHAR}
</if>
</if>
<if
test=
"record.modelInnerTypeArray != null and record.modelInnerTypeArray.size() > 0"
>
<if
test=
"record.modelInnerTypeArray != null and record.modelInnerTypeArray.size() > 0"
>
v_auth_model.model_inner_type in
and
v_auth_model.model_inner_type in
<foreach
collection=
"modelInnerTypeArray"
item=
"item"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"
record.
modelInnerTypeArray"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
<if
test=
'record.modelType != null and record.modelType == "dataset"'
>
or (v_auth_model.`model_inner_type` = 'group' and v_auth_model.model_type = 'dataset')
</if>
ORDER BY v_auth_model.node_type desc, CONVERT(v_auth_model.label using gbk) asc
ORDER BY v_auth_model.node_type desc, CONVERT(v_auth_model.label using gbk) asc
</select>
</select>
...
...
frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue
浏览文件 @
68f6a6e7
...
@@ -78,10 +78,7 @@
...
@@ -78,10 +78,7 @@
<
script
>
<
script
>
import
{
isKettleRunning
,
post
}
from
'@/api/dataset/dataset'
import
{
isKettleRunning
,
post
}
from
'@/api/dataset/dataset'
import
{
hasDataPermission
}
from
'@/utils/permission'
import
{
queryAuthModel
}
from
'@/api/authModel/authModel'
import
{
queryAuthModel
}
from
'@/api/authModel/authModel'
export
default
{
export
default
{
name
:
'DatasetGroupSelectorTree'
,
name
:
'DatasetGroupSelectorTree'
,
props
:
{
props
:
{
...
@@ -134,7 +131,7 @@ export default {
...
@@ -134,7 +131,7 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
required
:
false
,
required
:
false
,
default
:
false
default
:
false
}
,
}
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -198,7 +195,7 @@ export default {
...
@@ -198,7 +195,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
treeNode
(
true
)
this
.
treeNode
()
},
},
created
()
{
created
()
{
this
.
kettleState
()
this
.
kettleState
()
...
@@ -220,7 +217,6 @@ export default {
...
@@ -220,7 +217,6 @@ export default {
sort
:
'type desc,name asc'
sort
:
'type desc,name asc'
}
}
},
},
closeTable
()
{
closeTable
()
{
this
.
editTable
=
false
this
.
editTable
=
false
this
.
tableForm
=
{
this
.
tableForm
=
{
...
@@ -233,8 +229,18 @@ export default {
...
@@ -233,8 +229,18 @@ export default {
if
(
userCache
)
{
if
(
userCache
)
{
this
.
data
=
JSON
.
parse
(
modelInfo
)
this
.
data
=
JSON
.
parse
(
modelInfo
)
}
}
queryAuthModel
({
modelType
:
'dataset'
,
privileges
:
this
.
privileges
,
datasetMode
:
this
.
mode
,
clearEmptyDir
:
this
.
clearEmptyDir
},
!
userCache
).
then
(
res
=>
{
this
.
customType
?
this
.
customType
.
push
(
'group'
)
:
null
queryAuthModel
({
modelType
:
'dataset'
,
privileges
:
this
.
privileges
,
datasetMode
:
this
.
mode
,
clearEmptyDir
:
this
.
clearEmptyDir
,
mode
:
this
.
mode
<
0
?
null
:
this
.
mode
,
modelInnerTypeArray
:
this
.
customType
},
!
userCache
).
then
(
res
=>
{
if
(
cache
)
{
localStorage
.
setItem
(
'dataset-tree'
,
JSON
.
stringify
(
res
.
data
))
localStorage
.
setItem
(
'dataset-tree'
,
JSON
.
stringify
(
res
.
data
))
}
if
(
!
userCache
)
{
if
(
!
userCache
)
{
this
.
data
=
res
.
data
this
.
data
=
res
.
data
}
}
...
@@ -253,11 +259,9 @@ export default {
...
@@ -253,11 +259,9 @@ export default {
}
}
}
}
},
},
back
()
{
back
()
{
this
.
sceneMode
=
false
this
.
sceneMode
=
false
},
},
sceneClick
(
data
,
node
)
{
sceneClick
(
data
,
node
)
{
if
(
data
.
disabled
)
{
if
(
data
.
disabled
)
{
this
.
$message
({
this
.
$message
({
...
@@ -287,7 +291,6 @@ export default {
...
@@ -287,7 +291,6 @@ export default {
this
.
$emit
(
'getTable'
,
data
)
this
.
$emit
(
'getTable'
,
data
)
}
}
},
},
unionDataChange
()
{
unionDataChange
()
{
if
(
!
this
.
sceneMode
)
{
if
(
!
this
.
sceneMode
)
{
return
return
...
@@ -311,7 +314,6 @@ export default {
...
@@ -311,7 +314,6 @@ export default {
})
})
unionList
.
push
(
this
.
checkedList
[
0
].
tableId
)
unionList
.
push
(
this
.
checkedList
[
0
].
tableId
)
const
notUnionList
=
tableList
.
concat
(
unionList
).
filter
(
v
=>
tableList
.
includes
(
v
)
&&
!
unionList
.
includes
(
v
))
const
notUnionList
=
tableList
.
concat
(
unionList
).
filter
(
v
=>
tableList
.
includes
(
v
)
&&
!
unionList
.
includes
(
v
))
notUnionList
.
forEach
(
ele
=>
{
notUnionList
.
forEach
(
ele
=>
{
const
span
=
document
.
getElementById
(
ele
).
parentNode
const
span
=
document
.
getElementById
(
ele
).
parentNode
const
div1
=
span
.
parentNode
const
div1
=
span
.
parentNode
...
@@ -321,7 +323,6 @@ export default {
...
@@ -321,7 +323,6 @@ export default {
div2
.
style
.
setProperty
(
'pointer-events'
,
'none'
)
div2
.
style
.
setProperty
(
'pointer-events'
,
'none'
)
})
})
},
},
nodeExpand
(
data
)
{
nodeExpand
(
data
)
{
if
(
data
.
id
)
{
if
(
data
.
id
)
{
this
.
expandedArray
.
push
(
data
.
id
)
this
.
expandedArray
.
push
(
data
.
id
)
...
@@ -353,76 +354,66 @@ export default {
...
@@ -353,76 +354,66 @@ export default {
searchTypeClick
(
searchTypeInfo
)
{
searchTypeClick
(
searchTypeInfo
)
{
this
.
searchType
=
searchTypeInfo
this
.
searchType
=
searchTypeInfo
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.el-divider--horizontal
{
.el-divider--horizontal
{
margin
:
12px
0
margin
:
12px
0
}
}
.search-input
{
.search-input
{
padding
:
12px
0
;
padding
:
12px
0
;
}
}
.tree-list
>>>
.el-tree-node__expand-icon.is-leaf
{
.tree-list
>>>
.el-tree-node__expand-icon.is-leaf
{
display
:
none
;
display
:
none
;
}
}
.custom-tree-node
{
.custom-tree-node
{
flex
:
1
;
flex
:
1
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
font-size
:
14px
;
font-size
:
14px
;
padding-right
:
8px
;
padding-right
:
8px
;
}
}
.custom-tree-node-list
{
.custom-tree-node-list
{
flex
:
1
;
flex
:
1
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
font-size
:
14px
;
font-size
:
14px
;
padding
:
0
8px
;
padding
:
0
8px
;
}
}
.custom-position
{
.custom-position
{
flex
:
1
;
flex
:
1
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
font-size
:
14px
;
font-size
:
14px
;
flex-flow
:
row
nowrap
;
flex-flow
:
row
nowrap
;
}
}
.form-item
{
.form-item
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
.title-css
{
.title-css
{
height
:
26px
;
height
:
26px
;
}
}
.title-text
{
.title-text
{
line-height
:
26px
;
line-height
:
26px
;
}
}
.scene-title
{
.scene-title
{
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
}
}
.scene-title-name
{
.scene-title-name
{
width
:
100%
;
width
:
100%
;
overflow
:
hidden
;
overflow
:
hidden
;
display
:
inline-block
;
display
:
inline-block
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
.tree-style
{
.tree-style
{
padding
:
10px
;
padding
:
10px
;
height
:
100%
;
height
:
100%
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论