From 68f6a6e749bddfc8bc95792d38fc66e99172096a Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 30 Nov 2021 13:34:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9D=83=E9=99=90):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=95=B0=E6=8D=AE=E9=9B=86tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtVAuthModelMapper.java | 2 +- .../base/mapper/ext/ExtVAuthModelMapper.xml | 18 ++- .../common/DatasetGroupSelectorTree.vue | 151 ++++++++---------- 3 files changed, 83 insertions(+), 88 deletions(-) diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java index 51a88d6385..d74b1044e4 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.java @@ -8,6 +8,6 @@ import java.util.List; public interface ExtVAuthModelMapper { - List queryAuthModel (@Param("record") VAuthModelRequest request); + List queryAuthModel (@Param("record") VAuthModelRequest record); } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml index 257c88e035..e512f2a051 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml @@ -19,9 +19,10 @@ v_auth_model.create_by, v_auth_model.level, v_auth_model.mode, + v_auth_model.data_source_id, authInfo.PRIVILEGES AS `privileges` FROM - ( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{request.userId}, #{request.modelType} ) cids ) t, + ( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{record.userId}, #{record.modelType} ) cids ) t, v_auth_model LEFT JOIN ( SELECT @@ -35,19 +36,19 @@ ))) WHERE sys_auth_detail.privilege_value = 1 - AND sys_auth.auth_source_type = #{request.modelType} + AND sys_auth.auth_source_type = #{record.modelType} AND ( ( sys_auth.auth_target_type = 'dept' - AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{request.userId} ) + AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{record.userId} ) ) OR ( sys_auth.auth_target_type = 'user' - AND sys_auth.auth_target = #{request.userId} + AND sys_auth.auth_target = #{record.userId} ) OR ( sys_auth.auth_target_type = 'role' - AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{request.userId} ) + AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{record.userId} ) ) ) GROUP BY @@ -92,11 +93,14 @@ and v_auth_model.`label` = #{record.label,jdbcType=LONGVARCHAR} - v_auth_model.model_inner_type in - + and v_auth_model.model_inner_type in + #{item} + + or (v_auth_model.`model_inner_type` = 'group' and v_auth_model.model_type = 'dataset') + ORDER BY v_auth_model.node_type desc, CONVERT(v_auth_model.label using gbk) asc diff --git a/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue b/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue index 0d2e8276e7..a566005fbc 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue @@ -78,10 +78,7 @@