diff --git a/README.md b/README.md index 39f54301c8..066cdd9342 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@ Stars

-|说明| -|------------------| -|此分支为 DataEase v2 版本的开发分支。DataEase v2 正在快速迭代中,如是在生产环境部署 DataEase,建议使用 v1.18.* 的最新稳定版本。| -
- ## 什么是 DataEase? DataEase 是开源的数据可视化分析工具,帮助用户快速分析数据并洞察业务趋势,从而实现业务的改进与优化。DataEase 支持丰富的数据源连接,能够通过拖拉拽方式快速制作图表,并可以方便的与他人分享。 @@ -56,6 +51,7 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数 - [在线文档](https://dataease.io/docs/) - [社区论坛](https://bbs.fit2cloud.com/c/de/6) +- [快速入门视频](https://www.bilibili.com/video/BV1Z84y1X7eF/) ## License 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..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 @@ -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,20 @@ 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(); + List tmp = permissionManage + .filterColumnPermissions(fields, desensitizationList, id, userId) + .stream() + .sorted(Comparator.comparing(DatasetTableFieldDTO::getGroupType)) + .toList(); + tmp.forEach(ele -> ele.setDesensitized(desensitizationList.containsKey(ele.getDataeaseName()))); + return tmp; + } + + 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-backend/src/main/java/io/dataease/map/manage/MapManage.java b/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java index 448339da25..b49278b60b 100644 --- a/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java +++ b/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java @@ -1,5 +1,8 @@ package io.dataease.map.manage; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.io.FileUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.dataease.api.map.dto.GeometryNodeCreator; import io.dataease.api.map.vo.AreaNode; import io.dataease.constant.StaticResourceConstants; @@ -29,6 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import java.util.stream.Stream; import static io.dataease.constant.CacheConstant.CommonCacheConstant.WORLD_MAP_CACHE; @@ -107,6 +111,13 @@ public class MapManage { @CacheEvict(cacheNames = WORLD_MAP_CACHE, key = "'world_map'") @Transactional public void saveMapGeo(GeometryNodeCreator request, MultipartFile file) { + if (ObjectUtils.isEmpty(file) || file.isEmpty()) { + DEException.throwException("geometry file is require"); + } + String suffix = FileUtil.getSuffix(file.getOriginalFilename()); + if (!StringUtils.equalsIgnoreCase("json", suffix)) { + DEException.throwException("仅支持json格式文件"); + } List areas = proxy().defaultArea(); String code = getBusiGeoCode(request.getCode()); @@ -147,10 +158,30 @@ public class MapManage { if (!StringUtils.startsWith(code, GEO_PREFIX)) { DEException.throwException("内置Geometry,禁止删除"); } - coreAreaCustomMapper.deleteById(code); - File file = buildGeoFile(code); - if (file.exists()) { - file.delete(); + CoreAreaCustom coreAreaCustom = coreAreaCustomMapper.selectById(code); + if (ObjectUtils.isEmpty(coreAreaCustom)) { + DEException.throwException("Geometry code 不存在!"); + } + List codeResultList = new ArrayList<>(); + codeResultList.add(code); + childTreeIdList(ListUtil.of(code), codeResultList); + coreAreaCustomMapper.deleteBatchIds(codeResultList); + codeResultList.forEach(id -> { + File file = buildGeoFile(id); + if (file.exists()) { + file.delete(); + } + }); + } + + public void childTreeIdList(List pidList, List resultList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("pid", pidList); + List coreAreaCustoms = coreAreaCustomMapper.selectList(queryWrapper); + if (CollectionUtils.isNotEmpty(coreAreaCustoms)) { + List codeList = coreAreaCustoms.stream().map(CoreAreaCustom::getId).toList(); + resultList.addAll(codeList); + childTreeIdList(codeList, resultList); } } diff --git a/core/core-backend/src/main/resources/db/desktop/V2.1__ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.1__ddl.sql index 987569eb3d..d30c931455 100644 --- a/core/core-backend/src/main/resources/db/desktop/V2.1__ddl.sql +++ b/core/core-backend/src/main/resources/db/desktop/V2.1__ddl.sql @@ -1,77 +1,91 @@ DROP TABLE IF EXISTS `visualization_template`; -CREATE TABLE `visualization_template` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `pid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', - `level` int DEFAULT NULL COMMENT '层级', - `dv_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', - `node_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', - `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人', - `create_time` bigint DEFAULT NULL COMMENT '创建时间', - `snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '缩略图', - `template_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ', - `template_style` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'template 样式', - `template_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'template 数据', - `dynamic_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '预存数据', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; +CREATE TABLE `visualization_template` +( + `id` varchar(50) NOT NULL COMMENT '主键', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `pid` varchar(255) DEFAULT NULL COMMENT '父级id', + `level` int DEFAULT NULL COMMENT '层级', + `dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', + `node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', + `create_time` bigint DEFAULT NULL COMMENT '创建时间', + `snapshot` longtext COMMENT '缩略图', + `template_type` varchar(255) DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ', + `template_style` longtext COMMENT 'template 样式', + `template_data` longtext COMMENT 'template 数据', + `dynamic_data` longtext COMMENT '预存数据', + PRIMARY KEY (`id`) +); -- ---------------------------- -- Table structure for visualization_template_category -- ---------------------------- DROP TABLE IF EXISTS `visualization_template_category`; -CREATE TABLE `visualization_template_category` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `pid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', - `level` int DEFAULT NULL COMMENT '层级', - `dv_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', - `node_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', - `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人', - `create_time` bigint DEFAULT NULL COMMENT '创建时间', - `snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '缩略图', - `template_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; +CREATE TABLE `visualization_template_category` +( + `id` varchar(50) NOT NULL COMMENT '主键', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `pid` varchar(255) DEFAULT NULL COMMENT '父级id', + `level` int DEFAULT NULL COMMENT '层级', + `dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', + `node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', + `create_time` bigint DEFAULT NULL COMMENT '创建时间', + `snapshot` longtext COMMENT '缩略图', + `template_type` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +); -- ---------------------------- -- Table structure for visualization_template_category_map -- ---------------------------- DROP TABLE IF EXISTS `visualization_template_category_map`; -CREATE TABLE `visualization_template_category_map` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `category_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `template_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; +CREATE TABLE `visualization_template_category_map` +( + `id` varchar(50) NOT NULL COMMENT '主键', + `category_id` varchar(255) DEFAULT NULL COMMENT '名称', + `template_id` varchar(255) DEFAULT NULL COMMENT '父级id', + PRIMARY KEY (`id`) +); -- ---------------------------- -- Table structure for visualization_template_extend_data -- ---------------------------- DROP TABLE IF EXISTS `visualization_template_extend_data`; -CREATE TABLE `visualization_template_extend_data` ( - `id` bigint NOT NULL, - `dv_id` bigint DEFAULT NULL, - `view_id` bigint DEFAULT NULL, - `view_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, - `copy_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - `copy_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +CREATE TABLE `visualization_template_extend_data` +( + `id` bigint NOT NULL, + `dv_id` bigint DEFAULT NULL, + `view_id` bigint DEFAULT NULL, + `view_details` longtext, + `copy_from` varchar(255) DEFAULT NULL, + `copy_id` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +); -BEGIN; INSERT INTO `core_menu` VALUES (19, 0, 2, 'template-market', 'template-market', 4, NULL, '/template-market', 1, 1, 0); INSERT INTO `core_menu` VALUES (30, 0, 1, 'toolbox', null, 7, 'icon_template', '/toolbox', 1, 1, 0); INSERT INTO `core_menu` VALUES (31, 30, 2, 'template-setting', 'toolbox/template-setting', 1, 'icon_template', '/template-setting', 0, 1, 1); -COMMIT; +ALTER TABLE core_opt_recent ADD `resource_name` varchar(255) NULL COMMENT '资源名称'; -ALTER TABLE `core_opt_recent` - MODIFY COLUMN `resource_id` bigint NULL COMMENT '资源ID' AFTER `id`, - ADD COLUMN `resource_name` varchar(255) NULL COMMENT '资源名称' AFTER `resource_id`; +DROP TABLE IF EXISTS `core_area_custom`; +CREATE TABLE `core_area_custom` +( + `id` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `pid` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +); -INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (7, 'template.url', 'https://templates-de.fit2cloud.com', 'text', 0); -INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (8, 'template.accessKey', 'dataease', 'text', 1); +INSERT INTO `core_sys_setting` +VALUES (1, 'basic.dsIntervalTime', '6', 'text', 2); +INSERT INTO `core_sys_setting` +VALUES (2, 'basic.dsExecuteTime', 'minute', 'text', 3); +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) +VALUES (7, 'template.url', 'https://templates.dataease.cn', 'text', 0); +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) +VALUES (8, 'template.accessKey', 'dataease', 'text', 1); 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..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 @@ -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 ( @@ -3896,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`) @@ -3947,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 @@ -3959,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 '主题内容', @@ -3973,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`; @@ -3991,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`, @@ -4024,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 @@ -4044,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 @@ -4061,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; @@ -4093,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 @@ -4110,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 @@ -4138,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 @@ -4160,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 @@ -4178,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; - -SET FOREIGN_KEY_CHECKS = 1; +); 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` ( @@ -4205,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 @@ -4221,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; +); 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 350529c7bb..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 @@ -1,49 +1,49 @@ DROP TABLE IF EXISTS `visualization_template`; CREATE TABLE `visualization_template` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `pid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', + `id` varchar(50) NOT NULL COMMENT '主键', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `pid` varchar(255) DEFAULT NULL COMMENT '父级id', `level` int DEFAULT NULL COMMENT '层级', - `dv_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', - `node_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', - `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人', + `dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', + `node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', `create_time` bigint DEFAULT NULL COMMENT '创建时间', - `snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '缩略图', - `template_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ', - `template_style` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'template 样式', - `template_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'template 数据', - `dynamic_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '预存数据', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; + `snapshot` longtext COMMENT '缩略图', + `template_type` varchar(255) DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ', + `template_style` longtext COMMENT 'template 样式', + `template_data` longtext COMMENT 'template 数据', + `dynamic_data` longtext COMMENT '预存数据', + PRIMARY KEY (`id`) +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_category -- ---------------------------- DROP TABLE IF EXISTS `visualization_template_category`; CREATE TABLE `visualization_template_category` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `pid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', + `id` varchar(50) NOT NULL COMMENT '主键', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `pid` varchar(255) DEFAULT NULL COMMENT '父级id', `level` int DEFAULT NULL COMMENT '层级', - `dv_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', - `node_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', - `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人', + `dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹', + `node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', `create_time` bigint DEFAULT NULL COMMENT '创建时间', - `snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '缩略图', + `snapshot` longtext COMMENT '缩略图', `template_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; + PRIMARY KEY (`id`) +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_category_map -- ---------------------------- DROP TABLE IF EXISTS `visualization_template_category_map`; CREATE TABLE `visualization_template_category_map` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', - `category_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '名称', - `template_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级id', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板表'; + `id` varchar(50) NOT NULL COMMENT '主键', + `category_id` varchar(255) DEFAULT NULL COMMENT '名称', + `template_id` varchar(255) DEFAULT NULL COMMENT '父级id', + PRIMARY KEY (`id`) +) COMMENT='模板表'; -- ---------------------------- -- Table structure for visualization_template_extend_data @@ -53,11 +53,11 @@ CREATE TABLE `visualization_template_extend_data` ( `id` bigint NOT NULL, `dv_id` bigint DEFAULT NULL, `view_id` bigint DEFAULT NULL, - `view_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, - `copy_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - `copy_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + `view_details` longtext , + `copy_from` varchar(255) DEFAULT NULL, + `copy_id` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +); BEGIN; INSERT INTO `core_menu` @@ -87,6 +87,6 @@ INSERT INTO `core_sys_setting` VALUES (1, 'basic.dsIntervalTime', '6', 'text', 2); INSERT INTO `core_sys_setting` VALUES (2, 'basic.dsExecuteTime', 'minute', 'text', 3); -INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (7, 'template.url', 'https://templates-de.fit2cloud.com', 'text', 0); +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (7, 'template.url', 'https://templates.dataease.cn', 'text', 0); INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (8, 'template.accessKey', 'dataease', 'text', 1); COMMIT; diff --git a/core/core-frontend/config/base.ts b/core/core-frontend/config/base.ts index ddb203e13c..61513f83d1 100644 --- a/core/core-frontend/config/base.ts +++ b/core/core-frontend/config/base.ts @@ -26,6 +26,6 @@ export default { } } }, - sourcemap: true + sourcemap: false } } 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/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/assets/svg/icon_template_colorful.svg b/core/core-frontend/src/assets/svg/icon_template_colorful.svg index a19c0b2869..789b3a02d8 100644 --- a/core/core-frontend/src/assets/svg/icon_template_colorful.svg +++ b/core/core-frontend/src/assets/svg/icon_template_colorful.svg @@ -1,4 +1,4 @@ - + diff --git a/core/core-frontend/src/config/axios/refresh.ts b/core/core-frontend/src/config/axios/refresh.ts index 3067ea4f89..9c685e334d 100644 --- a/core/core-frontend/src/config/axios/refresh.ts +++ b/core/core-frontend/src/config/axios/refresh.ts @@ -35,6 +35,10 @@ const cacheRequest = cb => { } export const configHandler = config => { + const desktop = wsCache.get('app.desktop') + if (desktop) { + return config + } if (wsCache.get('user.token')) { config.headers['X-DE-TOKEN'] = wsCache.get('user.token') const expired = isExpired() diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index 0a6bb6b004..ffbedeff26 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -313,6 +313,7 @@ const calcData = (view: Chart, callback) => { state.totalItems = res?.totalItems const curViewInfo = canvasViewInfo.value[element.value.id] curViewInfo['curFields'] = res.data.fields + dvMainStore.setViewDataDetails(element.value.id, state.data) initCurFields(res) } callback?.() diff --git a/core/core-frontend/src/custom-component/user-view/Component.vue b/core/core-frontend/src/custom-component/user-view/Component.vue index a9b9a17864..277c02415f 100644 --- a/core/core-frontend/src/custom-component/user-view/Component.vue +++ b/core/core-frontend/src/custom-component/user-view/Component.vue @@ -77,6 +77,7 @@ const autoStyle = computed(() => {
{ } 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 }) } @@ -840,8 +836,12 @@ defineExpose({ :key="ele.id" :label="ele.name" :value="ele.id" + :disabled="ele.desensitized" > -
+
-
+
{ + if (infoObj[templateKey] && infoObj[templateKey][templateProp]) { + // 移动端特殊属性值设置 + if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) { + infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp] + } else { + infoObj[templateKey][templateProp] = getScaleValue( + infoObj[templateKey][templateProp], + scale + ) + } + } + }) + } else if (typeof template[templateKey] === 'string') { + // 一级字段为字符串直接赋值 + infoObj[templateKey] = getScaleValue(infoObj[templateKey], scale) + } else { + // 如果是对象 继续进行递归 + if (infoObj[templateKey]) { + recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal) + } + } + } +} + +export function recursionThemTransObj(template, infoObj, color) { + for (const templateKey in template) { + // 如果是数组 进行赋值计算 + if (template[templateKey] instanceof Array) { + template[templateKey].forEach(templateProp => { + if (infoObj[templateKey]) { + infoObj[templateKey][templateProp] = color + } + }) + } else if (typeof template[templateKey] === 'string') { + // 一级字段为字符串直接赋值 + infoObj[templateKey] = color + } else { + // 如果是对象 继续进行递归 + if (infoObj[templateKey]) { + recursionThemTransObj(template[templateKey], infoObj[templateKey], color) + } + } + } +} + +export function componentScalePublic(chartInfo, heightScale, widthScale) { + const scale = Math.min(heightScale, widthScale) + // attr 缩放转换 + recursionTransObj(this.customAttrTrans, chartInfo.customAttr, scale, null) + // style 缩放转换 + recursionTransObj(this.customStyleTrans, chartInfo.customStyle, scale, null) + return chartInfo +} diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index 410f9dbfb6..c17cf91031 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -12,6 +12,7 @@ import { parseJson } from '@/views/chart/components/js/util' import { defaultsDeep, cloneDeep } from 'lodash-es' import ChartError from '@/views/chart/components/views/components/ChartError.vue' import { BASE_VIEW_CONFIG } from '../../editor/util/chart' +import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/utils/canvasStyle' const dvMainStore = dvMainStoreWithOut() const { nowPanelTrackInfo, nowPanelJumpInfo } = storeToRefs(dvMainStore) @@ -29,12 +30,21 @@ const props = defineProps({ type: String, required: false, default: 'canvas' + }, + scale: { + type: Number, + required: false, + default: 100 + }, + terminal: { + type: String, + default: 'pc' } }) const emit = defineEmits(['onChartClick', 'onDrillFilters', 'onJumpClick']) -const { view, showPosition } = toRefs(props) +const { view, showPosition, scale, terminal } = toRefs(props) const isError = ref(false) const errMsg = ref('') @@ -105,6 +115,9 @@ const renderChart = async view => { // 与默认视图对象合并,方便增加配置项 const chart = { ...defaultsDeep(view, cloneDeep(BASE_VIEW_CONFIG)), data: chartData.value } const chartView = chartViewManager.getChartView(view.render, view.type) + console.log('scale=' + scale.value) + recursionTransObj(customAttrTrans, chart.customAttr, scale.value / 100, terminal.value) + recursionTransObj(customStyleTrans, chart.customStyle, scale.value / 100, terminal.value) switch (chartView.library) { case ChartLibraryType.L7_PLOT: renderL7Plot(chart, chartView as L7PlotChartView) diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 26dcfd9da7..c17da00d1f 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -89,6 +89,11 @@ const props = defineProps({ type: Boolean, required: false, default: false + }, + scale: { + type: Number, + required: false, + default: 100 } }) const dynamicAreaId = ref('') @@ -617,6 +622,7 @@ const toolTip = computed(() => { :show-position="showPosition" /> @@ -304,14 +305,19 @@ loadTreeData(true) padding-right: 4px; overflow: hidden; justify-content: space-between; - + .geo-name-span { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } .geo-operate-container { display: none; } &:hover { .geo-operate-container { - display: contents; + display: inline-flex; + padding-left: 4px; } } } diff --git a/core/core-frontend/src/views/system/parameter/map/GeometryEdit.vue b/core/core-frontend/src/views/system/parameter/map/GeometryEdit.vue index aa3239ead8..cb653309bb 100644 --- a/core/core-frontend/src/views/system/parameter/map/GeometryEdit.vue +++ b/core/core-frontend/src/views/system/parameter/map/GeometryEdit.vue @@ -17,12 +17,12 @@ const dialogVisible = ref(false) const loadingInstance = ref(null) const geoForm = ref() const geoFile = ref() -const fileName = ref() const state = reactive({ form: reactive({ pid: null, code: null, - name: null + name: null, + fileName: null }), treeData: [] }) @@ -53,6 +53,13 @@ const rule = reactive({ message: t('common.require'), trigger: 'blur' } + ], + fileName: [ + { + required: true, + message: t('common.require'), + trigger: 'blur' + } ] }) @@ -63,7 +70,7 @@ const edit = (pid?: string) => { state.form.code = null state.form.name = null geoFile.value = null - fileName.value = null + state.form.fileName = null dialogVisible.value = true } @@ -71,7 +78,7 @@ const emits = defineEmits(['saved']) const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) return - await formEl.validate((valid, fields) => { + await formEl.validate(valid => { if (valid) { const param = { ...state.form } const formData = buildFormData(geoFile.value, param) @@ -96,7 +103,6 @@ const submitForm = async (formEl: FormInstance | undefined) => { const resetForm = (formEl: FormInstance | undefined) => { if (!formEl) return geoFile.value = null - fileName.value = null formEl.resetFields() dialogVisible.value = false } @@ -119,7 +125,7 @@ const handleError = () => { } const setFile = (options: UploadRequestOptions) => { geoFile.value = options.file - fileName.value = options.file.name + state.form.fileName = options.file.name } const uploadValidate = file => { const suffix = file.name.substring(file.name.lastIndexOf('.') + 1) @@ -185,7 +191,7 @@ defineExpose({
- + - + diff --git a/core/core-frontend/src/views/system/parameter/map/interface.ts b/core/core-frontend/src/views/system/parameter/map/interface.ts index 1600eae66d..ee49a9f0b9 100644 --- a/core/core-frontend/src/views/system/parameter/map/interface.ts +++ b/core/core-frontend/src/views/system/parameter/map/interface.ts @@ -2,4 +2,5 @@ export interface GeometryFrom { pid?: string code?: string name?: string + fileName?: string } diff --git a/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue index f32c06b02a..108991348e 100644 --- a/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue +++ b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue @@ -18,6 +18,7 @@ :base-url="baseUrl" :width="templateCurWidth" :cur-position="curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" /> @@ -67,6 +68,15 @@ const props = defineProps({ fullTemplateShowList: { type: Array, default: () => [] + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) diff --git a/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue b/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue index 95dbd14d6a..8f34a0c3c8 100644 --- a/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue +++ b/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue @@ -101,12 +101,13 @@ class="main-area" :class="state.asideActive ? 'main-area-active' : ''" > - - {{ state.curTemplate.title }} + + {{ state.curTemplate.title }}
{{ t('visualization.apply_this_template') }} @@ -138,6 +139,15 @@ const props = defineProps({ templateShowList: { type: Array, default: () => [] + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) diff --git a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue index e0d32eeff3..5492535413 100644 --- a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue +++ b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue @@ -4,7 +4,11 @@ {{ template.title }} @@ -44,6 +48,15 @@ const props = defineProps({ }, width: { type: Number + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) @@ -139,4 +152,8 @@ const templateInnerPreview = e => { .create-area { bottom: -38px !important; } + +.fix-bottom { + bottom: -38px !important; +} diff --git a/core/core-frontend/src/views/template-market/index.vue b/core/core-frontend/src/views/template-market/index.vue index 6fcd01358c..312b74a06e 100644 --- a/core/core-frontend/src/views/template-market/index.vue +++ b/core/core-frontend/src/views/template-market/index.vue @@ -8,6 +8,7 @@ @@ -111,6 +112,7 @@ :base-url="state.baseUrl" :template-cur-width="state.templateCurWidth" :cur-position="state.curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -130,6 +132,7 @@ :base-url="state.baseUrl" :template-cur-width="state.templateCurWidth" :cur-position="state.curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -163,9 +166,12 @@ import MarketPreviewV2 from '@/views/template-market/component/MarketPreviewV2.v import { imgUrlTrans } from '@/utils/imgUtils' import { deepCopy } from '@/utils/utils' import CategoryTemplateV2 from '@/views/template-market/component/CategoryTemplateV2.vue' +import { interactiveStoreWithOut } from '@/store/modules/interactive' const { t } = useI18n() const { wsCache } = useCache() +const interactiveStore = interactiveStoreWithOut() + // full 正常展示 marketPreview 模板中心预览 createPreview 创建界面预览 const previewModel = ref('full') const emits = defineEmits(['close']) @@ -264,6 +270,14 @@ const state = reactive({ } }) +const createAuth = computed(() => { + const authMap = interactiveStore.getData + return { + PANEL: authMap['0'].menuAuth && authMap['0'].anyManage, + SCREEN: authMap['1'].menuAuth && authMap['1'].anyManage + } +}) + const categoriesComputed = computed(() => { let result if (state.templateSourceType === 'all') { @@ -341,7 +355,7 @@ const initMarketTemplate = async () => { state.baseUrl = rsp.data.baseUrl state.currentMarketTemplateShowList = rsp.data.contents state.marketTabs = rsp.data.categories - state.marketActiveTab = state.marketTabs[0].label + state.marketActiveTab = state.marketTabs[1].label initStyle() initTemplateShow() }) @@ -414,7 +428,11 @@ const apply = () => { templateData.type === 'dataV' ? '#/dvCanvas?opt=create&createType=template' : '#/dashboard?opt=create&createType=template' - window.open(baseUrl, '_blank') + if (state.pid) { + window.open(baseUrl + `&pid=${state.pid}`, '_blank') + } else { + window.open(baseUrl, '_blank') + } }) .catch(() => { state.loading = false diff --git a/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue b/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue index 897b2690c4..61f1bb498f 100644 --- a/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue +++ b/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue @@ -3,8 +3,10 @@
-
- {{ template.title }} +
+ + {{ template.title }} + {{ t('dataset.preview') }} @@ -30,6 +32,15 @@ const props = defineProps({ return {} } }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } + }, baseUrl: { type: String } @@ -69,7 +80,7 @@ const templateInnerPreview = e => { border-radius: 4px; display: flex; flex-wrap: wrap; - width: 181px; + min-width: 181px; height: 141px; margin-left: 16px; position: relative; @@ -136,4 +147,8 @@ const templateInnerPreview = e => { } } } + +.fix-height { + height: 39px !important; +} diff --git a/core/core-frontend/src/views/workbranch/index.vue b/core/core-frontend/src/views/workbranch/index.vue index 29e4d22a45..d6e840e4f2 100644 --- a/core/core-frontend/src/views/workbranch/index.vue +++ b/core/core-frontend/src/views/workbranch/index.vue @@ -58,6 +58,21 @@ const showTemplate = computed(() => { return state.networkStatus && state.hasResult }) +const createAuth = computed(() => { + return { + PANEL: havePanelAuth.value, + SCREEN: haveScreenAuth.value + } +}) + +const havePanelAuth = computed(() => { + return quickCreationList.value[0]['menuAuth'] && quickCreationList.value[0]['anyManage'] +}) + +const haveScreenAuth = computed(() => { + return quickCreationList.value[1]['menuAuth'] && quickCreationList.value[1]['anyManage'] +}) + const activeTabChange = value => { activeTabBtn.value = value } @@ -289,8 +304,23 @@ initMarketTemplate() {{ t(`auth.${ele.name}`) }}
-
- +
+ +
+ + 使用模板新建 @@ -329,6 +359,7 @@ initMarketTemplate() :key="index" :template="template" :base-url="state.baseUrl" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -536,6 +567,15 @@ initMarketTemplate() height: 52px; margin-left: -16px; } + .empty-tooltip-container-template { + width: 300px; + position: absolute; + height: 52px; + margin-left: -16px; + } + .template-create { + opacity: 0.3; + } } } } @@ -620,6 +660,7 @@ initMarketTemplate() .template-list { display: flex; margin-left: -16px; + overflow-x: auto; } } } diff --git a/de-xpack b/de-xpack index 0352814e63..79da01c6f4 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 0352814e63af722b8811159704d36d9ca2244c0d +Subproject commit 79da01c6f46aec7b0d3e5920213fe866a8a07678 diff --git a/installer/install.sh b/installer/install.sh index 4e38d88a96..35c83a54c7 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -245,4 +245,4 @@ dectl start | tee -a ${CURRENT_DIR}/install.log dectl status 2>&1 | tee -a ${CURRENT_DIR}/install.log echo -e "======================= 安装完成 =======================\n" 2>&1 | tee -a ${CURRENT_DIR}/install.log -echo -e "系统登录信息如下:\n 用户名: admin\n 初始密码: dataease" 2>&1 | tee -a ${CURRENT_DIR}/install.log \ No newline at end of file +echo -e "系统登录信息如下:\n 用户名: admin\n 初始密码: DataEase@123456" 2>&1 | tee -a ${CURRENT_DIR}/install.log \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5ce6a3e8cf..5bf75b0214 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ 17 17 3.5.3.1 - 1.4.199 + 2.2.220 4.1.0 1.35.1 2.6.0 @@ -33,7 +33,7 @@ 3.1.0 5.8.16 3.10.8 - 1.72 + 1.74 4.13.2 4.5.14 4.4.16 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; } diff --git a/sdk/common/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java b/sdk/common/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java index b8ed690f3a..6418d63026 100644 --- a/sdk/common/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java +++ b/sdk/common/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java @@ -121,4 +121,9 @@ public class DatasetTableFieldDTO implements Serializable { * 字段short name */ private String fieldShortName; -} \ No newline at end of file + + /** + * 是否脱敏 + */ + private Boolean desensitized; +}