From e9968c0f7201c8e2ad7e3d6c3ad06802e032c73b Mon Sep 17 00:00:00 2001 From: maninhill <41712985+maninhill@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:41:54 +0800 Subject: [PATCH 1/7] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 39f54301c8..ebe11424e2 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@ Stars

-|说明| -|------------------| -|此分支为 DataEase v2 版本的开发分支。DataEase v2 正在快速迭代中,如是在生产环境部署 DataEase,建议使用 v1.18.* 的最新稳定版本。| -
- ## 什么是 DataEase? DataEase 是开源的数据可视化分析工具,帮助用户快速分析数据并洞察业务趋势,从而实现业务的改进与优化。DataEase 支持丰富的数据源连接,能够通过拖拉拽方式快速制作图表,并可以方便的与他人分享。 From 8714dca004874bebb679db400c4cd658eb4cdf1d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 7 Dec 2023 15:51:58 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E5=99=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3flyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V2.0__core_ddl.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql index 3a85e80f3e..021667c64c 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql @@ -3748,7 +3748,7 @@ CREATE TABLE QRTZ_JOB_DETAILS JOB_DATA BLOB NULL, PRIMARY KEY (SCHED_NAME, JOB_NAME, JOB_GROUP) ); - +SET FOREIGN_KEY_CHECKS = 0; CREATE TABLE QRTZ_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, @@ -3827,9 +3827,7 @@ CREATE TABLE QRTZ_BLOB_TRIGGERS PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; +); CREATE TABLE QRTZ_CALENDARS ( @@ -4182,7 +4180,7 @@ CREATE TABLE `visualization_linkage_field` DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -SET FOREIGN_KEY_CHECKS = 1; + ALTER TABLE `core_datasource` ADD COLUMN `update_by` bigint NULL COMMENT '变更人' AFTER `update_time`; From 3616e2b6ddecf62155fb13d8b26d1f01cb0a1730 Mon Sep 17 00:00:00 2001 From: fit2cloudrd Date: Thu, 7 Dec 2023 16:16:33 +0800 Subject: [PATCH 3/7] Update V2.0__core_ddl.sql --- .../resources/db/migration/V2.0__core_ddl.sql | 88 ++++--------------- 1 file changed, 19 insertions(+), 69 deletions(-) diff --git a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql index 021667c64c..a8f665b915 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql @@ -3894,9 +3894,7 @@ CREATE TABLE `visualization_background` `base_url` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; +); INSERT INTO `visualization_background` (`id`, `name`, `classification`, `content`, `remark`, `sort`, `upload_time`, `base_url`, `url`) @@ -3945,11 +3943,7 @@ CREATE TABLE `visualization_background_image` `base_url` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; - - +); -- ---------------------------- -- Table structure for visualization_subject @@ -3957,7 +3951,7 @@ CREATE TABLE `visualization_background_image` DROP TABLE IF EXISTS `visualization_subject`; CREATE TABLE `visualization_subject` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `id` varchar(50) NOT NULL, `name` varchar(255) DEFAULT NULL COMMENT '主题名称', `type` varchar(255) DEFAULT NULL COMMENT '主题类型 system 系统主题,self 自定义主题', `details` longtext COMMENT '主题内容', @@ -3971,11 +3965,7 @@ CREATE TABLE `visualization_subject` `delete_time` bigint DEFAULT NULL COMMENT '删除时间', `delete_by` bigint DEFAULT NULL COMMENT '删除人', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; - - +); commit; DROP TABLE IF EXISTS `core_dataset_table_sql_log`; @@ -3989,9 +3979,7 @@ CREATE TABLE `core_dataset_table_sql_log` `sql` longtext NOT NULL COMMENT '详细信息', `status` varchar(45) DEFAULT NULL COMMENT '状态', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE utf8mb4_0900_ai_ci; +); INSERT INTO `visualization_subject` (`id`, `name`, `type`, `details`, `delete_flag`, `cover_url`, `create_num`, @@ -4022,9 +4010,7 @@ CREATE TABLE `core_store` `resource_type` int NOT NULL COMMENT '资源类型', `time` bigint NOT NULL COMMENT '收藏时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for xpack_share @@ -4042,9 +4028,7 @@ CREATE TABLE `xpack_share` `oid` bigint NOT NULL COMMENT '组织ID', `type` int NOT NULL COMMENT '业务类型', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for xpack_setting_authentication @@ -4059,25 +4043,8 @@ CREATE TABLE `xpack_setting_authentication` `sync_time` bigint NOT NULL COMMENT '同步时间', `relational_ids` varchar(255) DEFAULT NULL COMMENT '相关的ID', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -/* - Navicat Premium Data Transfer - - Source Server : de2-qa-123.56.90.236 - Source Server Type : MySQL - Source Server Version : 80100 - Source Host : 123.56.90.236:3306 - Source Schema : dataease - - Target Server Type : MySQL - Target Server Version : 80100 - File Encoding : 65001 - - Date: 22/09/2023 00:30:08 -*/ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; @@ -4091,14 +4058,12 @@ CREATE TABLE `visualization_link_jump` `id` bigint NOT NULL, `source_dv_id` bigint DEFAULT NULL COMMENT '源仪表板ID', `source_view_id` bigint DEFAULT NULL COMMENT '源视图ID', - `link_jump_info` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '跳转信息', + `link_jump_info` varchar(4000) DEFAULT NULL COMMENT '跳转信息', `checked` tinyint(1) DEFAULT NULL COMMENT '是否启用', `copy_from` bigint DEFAULT NULL, `copy_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for visualization_link_jump_info @@ -4108,19 +4073,17 @@ CREATE TABLE `visualization_link_jump_info` ( `id` bigint NOT NULL, `link_jump_id` bigint DEFAULT NULL COMMENT 'link jump ID', - `link_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关联类型 inner 内部仪表板,outer 外部链接', - `jump_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '跳转类型 _blank 新开页面 _self 当前窗口', + `link_type` varchar(255) DEFAULT NULL COMMENT '关联类型 inner 内部仪表板,outer 外部链接', + `jump_type` varchar(255) DEFAULT NULL COMMENT '跳转类型 _blank 新开页面 _self 当前窗口', `target_dv_id` bigint DEFAULT NULL COMMENT '关联仪表板ID', `source_field_id` bigint DEFAULT NULL COMMENT '字段ID', - `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容 linkType = outer时使用', + `content` varchar(4000) DEFAULT NULL COMMENT '内容 linkType = outer时使用', `checked` tinyint(1) DEFAULT NULL COMMENT '是否可用', `attach_params` tinyint(1) DEFAULT NULL COMMENT '是否附加点击参数', `copy_from` bigint DEFAULT NULL, `copy_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for visualization_link_jump_target_view_info @@ -4136,9 +4099,7 @@ CREATE TABLE `visualization_link_jump_target_view_info` `copy_from` bigint DEFAULT NULL, `copy_id` bigint DEFAULT NULL, PRIMARY KEY (`target_id`) USING BTREE -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for visualization_linkage @@ -4158,9 +4119,7 @@ CREATE TABLE `visualization_linkage` `copy_from` bigint DEFAULT NULL, `copy_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; +); -- ---------------------------- -- Table structure for visualization_linkage_field @@ -4176,16 +4135,11 @@ CREATE TABLE `visualization_linkage_field` `copy_from` bigint DEFAULT NULL, `copy_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; - - +); ALTER TABLE `core_datasource` ADD COLUMN `update_by` bigint NULL COMMENT '变更人' AFTER `update_time`; - DROP TABLE IF EXISTS `core_ds_finish_page`; CREATE TABLE `core_ds_finish_page` ( @@ -4203,9 +4157,7 @@ CREATE TABLE `core_opt_recent` `opt_type` int DEFAULT NULL COMMENT '1 新建 2 修改', `time` bigint NOT NULL COMMENT '收藏时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); -- ---------------------------- -- Table structure for core_sys_setting @@ -4219,6 +4171,4 @@ CREATE TABLE `core_sys_setting` `type` varchar(255) NOT NULL COMMENT '类型', `sort` int NOT NULL DEFAULT '0' COMMENT '顺序', PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci; +); From 9a0ba8c2a4ed7afe394c0b99826484e628a3a228 Mon Sep 17 00:00:00 2001 From: fit2cloudrd Date: Thu, 7 Dec 2023 16:21:21 +0800 Subject: [PATCH 4/7] Update V2.1__ddl.sql --- .../src/main/resources/db/migration/V2.1__ddl.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/core-backend/src/main/resources/db/migration/V2.1__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.1__ddl.sql index b749961120..172a67c56c 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.1__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.1__ddl.sql @@ -14,7 +14,7 @@ CREATE TABLE `visualization_template` ( `template_data` longtext COMMENT 'template 数据', `dynamic_data` longtext COMMENT '预存数据', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板表'; +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_category @@ -32,7 +32,7 @@ CREATE TABLE `visualization_template_category` ( `snapshot` longtext COMMENT '缩略图', `template_type` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板表'; +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_category_map @@ -43,7 +43,7 @@ CREATE TABLE `visualization_template_category_map` ( `category_id` varchar(255) DEFAULT NULL COMMENT '名称', `template_id` varchar(255) DEFAULT NULL COMMENT '父级id', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板表'; +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_extend_data @@ -57,7 +57,7 @@ CREATE TABLE `visualization_template_extend_data` ( `copy_from` varchar(255) DEFAULT NULL, `copy_id` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +); BEGIN; INSERT INTO `core_menu` From 6c5b3561e570cf5454a7c1b1d796b2183ee4b4a9 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 7 Dec 2023 16:50:04 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8C=85=E5=90=AB=E5=88=97=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E5=92=8C=E7=A6=81=E7=94=A8=E7=9A=84=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/manage/DatasetGroupManage.java | 22 +++++++++++++++++++ .../manage/DatasetTableFieldManage.java | 21 +++++++++++++++--- .../dataset/server/DatasetFieldServer.java | 5 +++++ .../dataset/server/DatasetTreeServer.java | 6 +++++ core/core-frontend/src/api/dataset.ts | 9 ++++++++ .../v-query/QueryConditionConfiguration.vue | 14 +++++------- .../dataease/api/dataset/DatasetTableApi.java | 4 ++++ .../dataease/api/dataset/DatasetTreeApi.java | 3 +++ 8 files changed, 72 insertions(+), 12 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java index eb8906f0aa..beae6d17b6 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetGroupManage.java @@ -498,4 +498,26 @@ public class DatasetGroupManage { geFullName(parent.getPid(), fullName); } } + + public List getDetailWithPerm(List ids) { + var result = new ArrayList(); + if (CollectionUtil.isNotEmpty(ids)) { + var dsList = coreDatasetGroupMapper.selectBatchIds(ids); + if (CollectionUtil.isNotEmpty(dsList)) { + dsList.forEach(ds -> { + DatasetTableDTO dto = new DatasetTableDTO(); + BeanUtils.copyBean(dto, ds); + var fields = datasetTableFieldManage.listFieldsWithPermissions(ds.getId()); + List dimensionList = fields.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "d")).toList(); + List quotaList = fields.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "q")).toList(); + Map> map = new LinkedHashMap<>(); + map.put("dimensionList", dimensionList); + map.put("quotaList", quotaList); + dto.setFields(map); + result.add(dto); + }); + } + } + return result; + } } diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java index 2531acc95d..4525e2fa15 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java @@ -1,6 +1,9 @@ package io.dataease.dataset.manage; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.dataease.api.chart.dto.ColumnPermissionItem; +import io.dataease.auth.bo.TokenUserBO; import io.dataease.dataset.dao.auto.entity.CoreDatasetTableField; import io.dataease.dataset.dao.auto.mapper.CoreDatasetGroupMapper; import io.dataease.dataset.dao.auto.mapper.CoreDatasetTableFieldMapper; @@ -9,6 +12,7 @@ import io.dataease.datasource.provider.CalciteProvider; import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.dataease.exception.DEException; import io.dataease.i18n.Translator; +import io.dataease.utils.AuthUtils; import io.dataease.utils.BeanUtils; import io.dataease.utils.IDUtils; import jakarta.annotation.Resource; @@ -18,9 +22,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -187,6 +189,19 @@ public class DatasetTableFieldManage { return map; } + public List listFieldsWithPermissions(Long id) { + List fields = selectByDatasetGroupId(id); + Map desensitizationList = new HashMap<>(); + Long userId = AuthUtils.getUser() == null ? null : AuthUtils.getUser().getUserId(); + return permissionManage + .filterColumnPermissions(fields, desensitizationList, id, userId) + .stream() + .filter(o -> !desensitizationList.containsKey(o.getDataeaseName())) + .sorted(Comparator.comparing(DatasetTableFieldDTO::getGroupType)) + .toList(); + } + + public List transDTO(List list) { return list.stream().map(ele -> { DatasetTableFieldDTO dto = new DatasetTableFieldDTO(); diff --git a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetFieldServer.java b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetFieldServer.java index 874451e7d2..652014ce82 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetFieldServer.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetFieldServer.java @@ -53,6 +53,11 @@ public class DatasetFieldServer implements DatasetTableApi { return datasetTableFieldManage.listByDQ(id); } + @Override + public List listFieldsWithPermissions(Long id) { + return datasetTableFieldManage.listFieldsWithPermissions(id); + } + @Override public List multFieldValuesForPermissions(@RequestBody MultFieldValuesRequest multFieldValuesRequest) throws Exception { return datasetDataManage.getFieldEnum(multFieldValuesRequest.getFieldIds()); diff --git a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java index a5eed1544e..de5c71fe4a 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java @@ -77,4 +77,10 @@ public class DatasetTreeServer implements DatasetTreeApi { public List getSqlParams(List ids) throws Exception { return datasetGroupManage.getSqlParams(ids); } + + @Override + public List detailWithPerm(List ids) throws Exception { + return datasetGroupManage.getDetailWithPerm(ids); + } + } diff --git a/core/core-frontend/src/api/dataset.ts b/core/core-frontend/src/api/dataset.ts index 616ad68a78..27f6b3060b 100644 --- a/core/core-frontend/src/api/dataset.ts +++ b/core/core-frontend/src/api/dataset.ts @@ -154,6 +154,11 @@ export const getDsDetails = async (data): Promise => { return res?.data }) } +export const getDsDetailsWithPerm = async (data): Promise => { + return request.post({ url: '/datasetTree/detailWithPerm', data }).then(res => { + return res?.data + }) +} export const getSqlParams = async (data): Promise => { return request.post({ url: '/datasetTree/getSqlParams', data }).then(res => { return res?.data @@ -175,6 +180,10 @@ export const multFieldValuesForPermissions = (data = {}) => { return request.post({ url: '/datasetField/multFieldValuesForPermissions', data }) } +export const listFieldsWithPermissions = (datasetId: number) => { + return request.get({ url: '/datasetField/listWithPermissions/' + datasetId }) +} + export const saveRowPermission = (data = {}) => { return request.post({ url: '/dataset/rowPermissions/save', data }) } diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index f1755b4c90..94a84ca605 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -7,7 +7,7 @@ import { useI18n } from '@/hooks/web/useI18n' import { fieldType } from '@/utils/attr' import { ElMessage } from 'element-plus-secondary' import type { DatasetDetail } from '@/api/dataset' -import { getDsDetails, getSqlParams } from '@/api/dataset' +import { getDsDetailsWithPerm, getSqlParams, listFieldsWithPermissions } from '@/api/dataset' import EmptyBackground from '@/components/empty-background/src/EmptyBackground.vue' import { cloneDeep } from 'lodash-es' import Select from './Select.vue' @@ -391,7 +391,7 @@ const init = (queryId: string) => { } const params = [...new Set(datasetFieldList.value.map(ele => ele.tableId).filter(ele => !!ele))] if (!params.length) return - getDsDetails(params) + getDsDetailsWithPerm(params) .then(res => { res .filter(ele => !!ele) @@ -438,7 +438,7 @@ const handleCondition = item => { curComponent.value = conditions.value.find(ele => ele.id === item.id) multiple.value = curComponent.value.multiple - if (!curComponent.value.dataset.fields.length) { + if (!curComponent.value.dataset.fields.length && curComponent.value.dataset.id) { getOptions(curComponent.value.dataset.id, curComponent.value) } datasetFieldList.value.forEach(ele => { @@ -468,12 +468,8 @@ const handleCondition = item => { } const getOptions = (id, component) => { - getDsDetails([id]).then(res => { - res.forEach(ele => { - if (!ele) return - const { dimensionList, quotaList } = ele.fields - component.dataset.fields = [...dimensionList, ...quotaList] - }) + listFieldsWithPermissions(id).then(res => { + component.dataset.fields = res.data }) } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTableApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTableApi.java index d484428c8b..940834e8ca 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTableApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTableApi.java @@ -3,6 +3,7 @@ package io.dataease.api.dataset; import io.dataease.api.dataset.dto.MultFieldValuesRequest; import io.dataease.api.dataset.engine.SQLFunctionDTO; import io.dataease.dto.dataset.DatasetTableFieldDTO; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -37,6 +38,9 @@ public interface DatasetTableApi { @PostMapping("listByDQ/{id}") Map> listByDQ(@PathVariable Long id); + @GetMapping ("listWithPermissions/{id}") + List listFieldsWithPermissions(@PathVariable Long id); + @PostMapping("multFieldValuesForPermissions") List multFieldValuesForPermissions(@RequestBody MultFieldValuesRequest multFieldValuesRequest) throws Exception; diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTreeApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTreeApi.java index 1c85ceef2a..083f0f4081 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTreeApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetTreeApi.java @@ -72,4 +72,7 @@ public interface DatasetTreeApi { @PostMapping("getSqlParams") List getSqlParams(@RequestBody List ids) throws Exception; + + @PostMapping("detailWithPerm") + List detailWithPerm(@RequestBody List ids) throws Exception; } From fc17707b4e546af01fce444c59b52b9c858bc942 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 7 Dec 2023 17:40:12 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=9C=AA=E4=BF=9D=E5=AD=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=9D=83=E9=99=90=E7=BB=B4=E5=BA=A6=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index e584ed4e9f..391d9aa251 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit e584ed4e9f88eac8de7bd31c74eb32e91eb9279b +Subproject commit 391d9aa251594c2b310cdb81847aa9cd9a808e41 From 58f02b5eecde704ea1d3da649a498e1a6f42a690 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 7 Dec 2023 17:57:08 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E8=84=B1=E6=95=8F=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=94=B9=E4=B8=BA=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/manage/DatasetTableFieldManage.java | 5 +++-- core/core-frontend/src/api/chart.ts | 1 + .../v-query/QueryConditionConfiguration.vue | 12 ++++++++++-- .../dataease/dto/dataset/DatasetTableFieldDTO.java | 7 ++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java index 4525e2fa15..08bf01ada9 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetTableFieldManage.java @@ -193,12 +193,13 @@ public class DatasetTableFieldManage { List fields = selectByDatasetGroupId(id); Map desensitizationList = new HashMap<>(); Long userId = AuthUtils.getUser() == null ? null : AuthUtils.getUser().getUserId(); - return permissionManage + List tmp = permissionManage .filterColumnPermissions(fields, desensitizationList, id, userId) .stream() - .filter(o -> !desensitizationList.containsKey(o.getDataeaseName())) .sorted(Comparator.comparing(DatasetTableFieldDTO::getGroupType)) .toList(); + tmp.forEach(ele -> ele.setDesensitized(desensitizationList.containsKey(ele.getDataeaseName()))); + return tmp; } diff --git a/core/core-frontend/src/api/chart.ts b/core/core-frontend/src/api/chart.ts index 36f130619b..4e9916e221 100644 --- a/core/core-frontend/src/api/chart.ts +++ b/core/core-frontend/src/api/chart.ts @@ -15,6 +15,7 @@ export interface Field { extField: number checked: boolean fieldShortName: string + desensitized: boolean } export interface ComponentInfo { diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index 94a84ca605..ea1af84f5e 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -836,8 +836,12 @@ defineExpose({ :key="ele.id" :label="ele.name" :value="ele.id" + :disabled="ele.desensitized" > -
+
-
+