diff --git a/backend/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java b/backend/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java index c4b06f8977..ecd9b2c418 100644 --- a/backend/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java +++ b/backend/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java @@ -12,7 +12,7 @@ import lombok.Data; @Data public class PanelDesignDTO extends PanelDesign { - //当前视图是否在仪表盘中显示 + //当前视图是否在仪表板中显示 private boolean keepFlag = false; //当前视图是否已经进行样式初始化 diff --git a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index e054ddbaa3..0ee4318af4 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -102,7 +102,7 @@ public class ChartViewService { return dto; } - // 过滤来自仪表盘的条件 + // 过滤来自仪表板的条件 List extFilterList = new ArrayList<>(); if (ObjectUtils.isNotEmpty(requestList.getFilter())) { for (ChartExtFilterRequest request : requestList.getFilter()) { diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 7843b70193..f7767b3f5c 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -86,7 +86,7 @@ public class PanelGroupService { panelGroupMapper.insert(request); } else if ("toDefaultPanel".equals(request.getOptType())) { panelId = UUID.randomUUID().toString(); - // 转存为默认仪表盘 + // 转存为默认仪表板 PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId()); newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM); newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL); diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index e7db5dd9cd..eb1d6ac33f 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -19,6 +19,7 @@ import io.dataease.controller.sys.request.SysUserPwdRequest; import io.dataease.controller.sys.request.SysUserStateRequest; import io.dataease.controller.sys.response.SysUserGridResponse; import io.dataease.controller.sys.response.SysUserRole; +import io.dataease.i18n.Translator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -78,6 +79,7 @@ public class SysUserService { @Transactional public int save(SysUserCreateRequest request) { + checkUsername(request); SysUser user = BeanUtils.copyBean(new SysUser(), request); long now = System.currentTimeMillis(); user.setCreateTime(now); @@ -106,6 +108,7 @@ public class SysUserService { @CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId") @Transactional public int update(SysUserCreateRequest request) { + checkUsername(request); if (StringUtils.isEmpty(request.getPassword())) { request.setPassword(null); } @@ -235,4 +238,16 @@ public class SysUserService { sysUserMapper.updateByPrimaryKeySelective(sysUser); } + private void checkUsername(SysUserCreateRequest request) { + SysUserExample sysUserExample = new SysUserExample(); + SysUserExample.Criteria criteria = sysUserExample.createCriteria(); + if (request.getUserId() != null) { + criteria.andUserIdNotEqualTo(request.getUserId()); + } + criteria.andUsernameEqualTo(request.getUsername()); + List sysUsers = sysUserMapper.selectByExample(sysUserExample); + if (CollectionUtils.isNotEmpty(sysUsers)) { + throw new RuntimeException(Translator.get("i18n_username_exists")); + } + } } diff --git a/backend/src/main/resources/db/migration/V2__dataease_ddl.sql b/backend/src/main/resources/db/migration/V2__dataease_ddl.sql index baa2b50456..b21b7ca9c6 100644 --- a/backend/src/main/resources/db/migration/V2__dataease_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__dataease_ddl.sql @@ -40,7 +40,7 @@ DROP TABLE IF EXISTS `datasource`; CREATE TABLE `datasource` ( `id` varchar(50) NOT NULL DEFAULT '' COMMENT 'ID', `name` varchar(50) NOT NULL COMMENT '名称', - `desc` varchar(50) NOT NULL COMMENT '描述', + `desc` varchar(50) COMMENT '描述', `type` varchar(50) NOT NULL COMMENT '类型', `configuration` longtext NOT NULL COMMENT '详细信息', `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', @@ -288,7 +288,7 @@ CREATE TABLE `chart_view` ( `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间', `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', `snapshot` longtext COMMENT '缩略图 ', - `style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表盘 view 视图', + `style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表板 view 视图', PRIMARY KEY (`id`), KEY `IDX_TABLE_ID` (`table_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; @@ -307,7 +307,7 @@ CREATE TABLE `panel_design` ( `update_time` bigint(13) DEFAULT NULL COMMENT '修改时间', `update_person` varchar(255) DEFAULT NULL COMMENT '修改人', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表盘和组件的关联关系 组件分为普通视图和系统组件'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表板和组件的关联关系 组件分为普通视图和系统组件'; DROP TABLE IF EXISTS `panel_group`; CREATE TABLE `panel_group` ( @@ -318,10 +318,10 @@ CREATE TABLE `panel_group` ( `node_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', `create_time` bigint(13) NULL DEFAULT NULL COMMENT '创建时间', - `panel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仪表盘类型 system 系统内置 self 用户自建 ', + `panel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仪表板类型 system 系统内置 self 用户自建 ', `panel_style` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 样式', `panel_data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 数据', - `source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表盘另存', + `source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表板另存', `extend1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `extend2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, @@ -362,7 +362,7 @@ CREATE TABLE `panel_template` ( `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间', `snapshot` longtext COMMENT '缩略图', - `template_type` varchar(255) DEFAULT NULL COMMENT '仪表盘类型 system 系统内置 self 用户自建 ', + `template_type` varchar(255) DEFAULT NULL COMMENT '仪表板类型 system 系统内置 self 用户自建 ', `template_style` longtext COMMENT 'template 样式', `template_data` longtext COMMENT 'template 数据', `dynamic_data` longtext COMMENT '预存数据', @@ -401,7 +401,7 @@ CREATE TABLE `panel_template` ( `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间', `snapshot` longtext COMMENT '缩略图', - `template_type` varchar(255) DEFAULT NULL COMMENT '仪表盘类型 system 系统内置 self 用户自建 ', + `template_type` varchar(255) DEFAULT NULL COMMENT '仪表板类型 system 系统内置 self 用户自建 ', `template_style` longtext COMMENT 'template 样式', `template_data` longtext COMMENT 'template 数据', `dynamic_data` longtext COMMENT '预存数据', diff --git a/backend/src/main/resources/db/migration/V3__init_data.sql b/backend/src/main/resources/db/migration/V3__init_data.sql index ab4c859edc..a9e67c71c9 100644 --- a/backend/src/main/resources/db/migration/V3__init_data.sql +++ b/backend/src/main/resources/db/migration/V3__init_data.sql @@ -35,7 +35,7 @@ INSERT INTO `sys_menu` VALUES (25, 34, 0, 2, '删除连接', NULL, NULL, 999, NU INSERT INTO `sys_menu` VALUES (26, 34, 0, 2, '编辑连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:edit', NULL, NULL, 1614931234105, 1614931234105); INSERT INTO `sys_menu` VALUES (27, 34, 0, 2, '校验连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:validate', NULL, NULL, 1614931268578, 1614931268578); INSERT INTO `sys_menu` VALUES (28, 2, 0, 2, '修改密码', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:editPwd', NULL, NULL, 1615275128262, 1615275128262); -INSERT INTO `sys_menu` VALUES (30, 0, 0, 1, '仪表盘', 'panel', 'panel/index', 1, NULL, '/panel', b'0', b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081449067); +INSERT INTO `sys_menu` VALUES (30, 0, 0, 1, '仪表板', 'panel', 'panel/index', 1, NULL, '/panel', b'0', b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081449067); INSERT INTO `sys_menu` VALUES (34, 0, 4, 1, '数据源', 'datasource', 'system/datasource/index', 4, NULL, '/datasource', b'0', b'0', b'0', 'datasource:read', NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (35, 1, 0, 1, '用户表单', 'system-user-form', 'system/user/form', 10, '', 'user-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (36, 1, 0, 1, '菜单表单', 'system-menu-form', 'system/menu/form', 11, '', 'menu-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); @@ -108,8 +108,8 @@ INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUE INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.title', '', 'text', 5); BEGIN; -INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('default_panel', 'i18n_default_panel', '0', -1, 'folder', 'admin', NULL, 'system', NULL, NULL, NULL, NULL, NULL, '系统内置 默认仪表盘'); -INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('panel_list', 'i18n_panel_list', '0', -1, 'folder', 'admin', NULL, 'self', NULL, NULL, NULL, NULL, NULL, '系统内置 仪表盘列表'); +INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('default_panel', 'i18n_default_panel', '0', -1, 'folder', 'admin', NULL, 'system', NULL, NULL, NULL, NULL, NULL, '系统内置 默认仪表板'); +INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('panel_list', 'i18n_panel_list', '0', -1, 'folder', 'admin', NULL, 'self', NULL, NULL, NULL, NULL, NULL, '系统内置 仪表板列表'); COMMIT; diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index d60ce6279d..457b55ba55 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -185,7 +185,7 @@ authsource_name_already_exists=Authentication source name already exists authsource_name_is_null=Authentication source name cannot be empty authsource_configuration_is_null=Authentication source configuration cannot be empty 个人信息=Personal Information -仪表盘=Panel +仪表板=Dashboard 修改密码=Change Password 创建用户=Create User 创建组织=Create Organization @@ -233,11 +233,12 @@ i18n_chart_count=Count* i18n_excel_have_merge_region=Excel has merged region i18n_cron_expression_error=Cron expression error i18n_same_folder_can_not_repeat=Same Folder Can Not Repeat -i18n_default_panel=Default Panel -i18n_panel_list=Panel +i18n_default_panel=Default Dashboard +i18n_panel_list=Dashboard i18n_processing_data=Processing data now, Refresh later i18n_union_already_exists=Union relation already exists i18n_union_field_exists=The same field can't in two dataset i18n_cron_time_error=Start time can't greater then end time i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled +i18n_username_exists=ID is already exists diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index fee30d5e09..aa40d38b40 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -187,7 +187,7 @@ authsource_name_is_null=认证源名称不能为空 authsource_configuration_is_null=认证源配置不能为空 个人信息=个人信息 -仪表盘=仪表盘 +仪表板=仪表板 修改密码=修改密码 创建用户=创建用户 创建组织=创建组织 @@ -235,10 +235,11 @@ i18n_chart_count=记录数* i18n_excel_have_merge_region=Excel存在合并单元格 i18n_cron_expression_error=Cron表达式校验错误 i18n_same_folder_can_not_repeat=相同的目录下名称不能重复 -i18n_default_panel=默认仪表盘 -i18n_panel_list=仪表盘 +i18n_default_panel=默认仪表板 +i18n_panel_list=仪表板 i18n_processing_data=正在处理数据,稍后刷新 i18n_union_already_exists=关联关系已存在 i18n_union_field_exists=两个数据集之间关联不能出现多次相同字段 i18n_cron_time_error=开始时间不能大于结束时间 i18n_auth_source_be_canceled=当前资源授权权限已经被取消 +i18n_username_exists=用户ID已存在 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index e6c8738c4a..8d6b357d76 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -187,7 +187,7 @@ authsource_name_already_exists=認證源名稱已經存在 authsource_name_is_null=認證源名稱不能為空 authsource_configuration_is_null=認證源配置不能為空 個人信息=個人信息 -儀表盤=儀表盤 +儀表板=儀表板 修改密碼=修改密碼 創建用戶=創建用戶 創建組織=創建組織 @@ -227,18 +227,19 @@ i18n_auth_view=查看 i18n_auth_use=使用 i18n_auth_export=導出 i18n_auth_manage=管理 -i18n_auth_grant=授权 +i18n_auth_grant=授權 i18n_template_system=系統模板 i18n_template_self=用戶模板 i18n_name_cant_repeat_same_group=同一分組下名稱不能重復 i18n_chart_count=記錄數* i18n_excel_have_merge_region=Excel存在合並單元格 i18n_cron_expression_error=Cron表達式校驗錯誤 -i18n_same_folder_can_not_repeat=相同的目录下名称不能重复 -i18n_default_panel=默认仪表盘 -i18n_panel_list=仪表盘 +i18n_same_folder_can_not_repeat=相同的目錄下名稱不能重復 +i18n_default_panel=默認儀表板 +i18n_panel_list=儀表板 i18n_processing_data=正在處理數據,稍後刷新 i18n_union_already_exists=關聯關系已存在 i18n_union_field_exists=兩個數據集之間關聯不能出現多次相同字段 i18n_cron_time_error=開始時間不能大於結束時間 -i18n_auth_source_be_canceled=当前资源授权权限已经被取消 +i18n_auth_source_be_canceled=當前資源授權權限已經被取消 +i18n_username_exists=用戶ID已存在 diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 42fbc95b8f..f986f92742 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -82,6 +82,14 @@ export default { 'canvasStyleData' ]) }, + watch: { + componentData: { + handler(newVal, oldVla) { + this.restore() + }, + deep: true + } + }, mounted() { const _this = this const erd = elementResizeDetectorMaker() @@ -119,6 +127,7 @@ export default { }, handleScaleChange() { if (this.componentData) { + debugger const componentData = deepCopy(this.componentData) componentData.forEach(component => { Object.keys(component.style).forEach(key => { diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 846c585a96..2c32b55ed9 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -1,21 +1,16 @@