diff --git a/backend/src/main/java/io/dataease/controller/LicenseController.java b/backend/src/main/java/io/dataease/controller/LicenseController.java index 4071f6b811..160dc80d1b 100644 --- a/backend/src/main/java/io/dataease/controller/LicenseController.java +++ b/backend/src/main/java/io/dataease/controller/LicenseController.java @@ -23,9 +23,9 @@ public class LicenseController { @GetMapping(value = "anonymous/license/validate") public ResultHolder validateLicense() throws Exception { -// if (!need_validate_lic) { -// return ResultHolder.success(null); -// } + if (!need_validate_lic) { + return ResultHolder.success(null); + } F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.validateLicense(); System.out.println(new Gson().toJson(f2CLicenseResponse)); switch (f2CLicenseResponse.getStatus()) { diff --git a/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java b/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java index b05370b044..66bf1189f9 100644 --- a/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java +++ b/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java @@ -91,7 +91,11 @@ public class DatasourceService { DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType()); DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(datasource); - datasourceProvider.test(datasourceRequest); + try { + datasourceProvider.test(datasourceRequest); + } catch (Exception e) { + throw new RuntimeException(Translator.get("i18n_datasource_check_fail")); + } } public List getTables(Datasource datasource) throws Exception { @@ -144,7 +148,7 @@ public class DatasourceService { datasourceRequest.setDatasource(datasource); datasourceProvider.initDataSource(datasourceRequest); LogUtil.info("Succsss to init datasource connection pool: " + datasource.getName()); - }catch (Exception e){ + } catch (Exception e) { LogUtil.error("Failed to init datasource connection pool: " + datasource.getName(), e); } }); diff --git a/backend/src/main/java/io/dataease/plugins/loader/MyScanner.java b/backend/src/main/java/io/dataease/plugins/loader/MyScanner.java index 8fbeada3fb..fa099f7f27 100644 --- a/backend/src/main/java/io/dataease/plugins/loader/MyScanner.java +++ b/backend/src/main/java/io/dataease/plugins/loader/MyScanner.java @@ -8,20 +8,16 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; import org.springframework.stereotype.Component; -import javax.annotation.Resource; - @Component public class MyScanner implements BeanDefinitionRegistryPostProcessor { - @Resource - private MapperScannerConfigurer mapperScannerConfigurer; + private BeanDefinitionRegistry beanDefinitionRegistry; @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) throws BeansException { this.beanDefinitionRegistry = beanDefinitionRegistry; - System.out.println("-----"); } @Override @@ -30,9 +26,7 @@ public class MyScanner implements BeanDefinitionRegistryPostProcessor { } public void scanner() { - if (null == mapperScannerConfigurer){ - mapperScannerConfigurer = SpringContextUtil.getBean(MapperScannerConfigurer.class); - } + MapperScannerConfigurer mapperScannerConfigurer = SpringContextUtil.getBean(MapperScannerConfigurer.class); mapperScannerConfigurer.postProcessBeanDefinitionRegistry(this.beanDefinitionRegistry); } diff --git a/backend/src/main/java/io/dataease/plugins/util/PluginUtils.java b/backend/src/main/java/io/dataease/plugins/util/PluginUtils.java index b8bcb043a7..52c422b870 100644 --- a/backend/src/main/java/io/dataease/plugins/util/PluginUtils.java +++ b/backend/src/main/java/io/dataease/plugins/util/PluginUtils.java @@ -1,21 +1,51 @@ package io.dataease.plugins.util; +import io.dataease.commons.license.DefaultLicenseService; +import io.dataease.commons.license.F2CLicenseResponse; import io.dataease.plugins.common.dto.PluginSysMenu; import io.dataease.plugins.common.service.PluginMenuService; import io.dataease.plugins.config.SpringContextUtil; - +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +@Component public class PluginUtils { + + + private static DefaultLicenseService defaultLicenseService; + + @Autowired + public void setDefaultLicenseService(DefaultLicenseService defaultLicenseService) { + PluginUtils.defaultLicenseService = defaultLicenseService; + } + public static List pluginMenus() { + F2CLicenseResponse f2CLicenseResponse = currentLic(); + if (f2CLicenseResponse.getStatus() != F2CLicenseResponse.Status.valid) + return new ArrayList<>(); Map pluginMenuServiceMap = SpringContextUtil.getApplicationContext().getBeansOfType(PluginMenuService.class); List menus = pluginMenuServiceMap.values().stream().flatMap(item -> item.menus().stream()).collect(Collectors.toList()); return menus; } + public static F2CLicenseResponse currentLic() { + Environment environment = SpringContextUtil.getBean(Environment.class); + Boolean need_validate_lic = environment.getProperty("dataease.need_validate_lic", Boolean.class, true); + if (!need_validate_lic) { + F2CLicenseResponse f2CLicenseResponse = new F2CLicenseResponse(); + f2CLicenseResponse.setStatus(F2CLicenseResponse.Status.valid); + return f2CLicenseResponse; + } + F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.validateLicense(); + return f2CLicenseResponse; + } + diff --git a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java index 0d25d36c4b..04d99e6a0b 100644 --- a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java @@ -131,26 +131,26 @@ public class DorisQueryProvider extends QueryProvider { // 如果原始类型为时间 if (x.getDeExtractType() == 1) { if (x.getDeType() == 2 || x.getDeType() == 3) { - stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as ").append(x.getDataeaseName()); + stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as _").append(x.getDataeaseName()); } else if (x.getDeType() == 1) { String format = transDateFormat(x.getDateStyle(), x.getDatePattern()); - stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as ").append(x.getDataeaseName()); + stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as _").append(x.getDataeaseName()); } else { - stringBuilder.append(x.getDataeaseName()); + stringBuilder.append(x.getDataeaseName()).append(" as _").append(x.getDataeaseName()); } } else { if (x.getDeType() == 1) { String format = transDateFormat(x.getDateStyle(), x.getDatePattern()); - stringBuilder.append("DATE_FORMAT(").append("FROM_UNIXTIME(cast(").append(x.getDataeaseName()).append(" as decimal(20,0))/1000,'%Y-%m-%d %H:%i:%S')").append(",'").append(format).append("') as ").append(x.getDataeaseName()); + stringBuilder.append("DATE_FORMAT(").append("FROM_UNIXTIME(cast(").append(x.getDataeaseName()).append(" as decimal(20,0))/1000,'%Y-%m-%d %H:%i:%S')").append(",'").append(format).append("') as _").append(x.getDataeaseName()); } else { - stringBuilder.append(x.getDataeaseName()); + stringBuilder.append(x.getDataeaseName()).append(" as _").append(x.getDataeaseName()); } } return stringBuilder.toString(); }).toArray(String[]::new); - String[] group = xAxis.stream().map(ChartViewFieldDTO::getDataeaseName).toArray(String[]::new); + String[] group = xAxis.stream().map(x -> "_" + x.getDataeaseName()).toArray(String[]::new); String[] xOrder = xAxis.stream().filter(f -> StringUtils.isNotEmpty(f.getSort()) && !StringUtils.equalsIgnoreCase(f.getSort(), "none")) - .map(f -> f.getDataeaseName() + " " + f.getSort()).toArray(String[]::new); + .map(f -> "_" + f.getDataeaseName() + " " + f.getSort()).toArray(String[]::new); String[] yOrder = yAxis.stream().filter(f -> StringUtils.isNotEmpty(f.getSort()) && !StringUtils.equalsIgnoreCase(f.getSort(), "none")) .map(f -> "_" + f.getSummary() + "_" + (StringUtils.equalsIgnoreCase(f.getDataeaseName(), "*") ? "" : f.getDataeaseName()) + " " + f.getSort()).toArray(String[]::new); String[] order = Arrays.copyOf(xOrder, xOrder.length + yOrder.length); diff --git a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java index bc44fbe313..066204f1f2 100644 --- a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java @@ -137,26 +137,26 @@ public class MysqlQueryProvider extends QueryProvider { // 如果原始类型为时间 if (x.getDeExtractType() == 1) { if (x.getDeType() == 2 || x.getDeType() == 3) { - stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as ").append(x.getDataeaseName()); + stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as _").append(x.getDataeaseName()); } else if (x.getDeType() == 1) { String format = transDateFormat(x.getDateStyle(), x.getDatePattern()); - stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as ").append(x.getDataeaseName()); + stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as _").append(x.getDataeaseName()); } else { - stringBuilder.append(x.getDataeaseName()); + stringBuilder.append(x.getDataeaseName()).append(" as _").append(x.getDataeaseName()); } } else { if (x.getDeType() == 1) { String format = transDateFormat(x.getDateStyle(), x.getDatePattern()); - stringBuilder.append("DATE_FORMAT(").append("FROM_UNIXTIME(cast(").append(x.getDataeaseName()).append(" as decimal(20,0))/1000,'%Y-%m-%d %H:%i:%S')").append(",'").append(format).append("') as ").append(x.getDataeaseName()); + stringBuilder.append("DATE_FORMAT(").append("FROM_UNIXTIME(cast(").append(x.getDataeaseName()).append(" as decimal(20,0))/1000,'%Y-%m-%d %H:%i:%S')").append(",'").append(format).append("') as _").append(x.getDataeaseName()); } else { - stringBuilder.append(x.getDataeaseName()); + stringBuilder.append(x.getDataeaseName()).append(" as _").append(x.getDataeaseName()); } } return stringBuilder.toString(); }).toArray(String[]::new); - String[] group = xAxis.stream().map(ChartViewFieldDTO::getDataeaseName).toArray(String[]::new); + String[] group = xAxis.stream().map(x -> "_" + x.getDataeaseName()).toArray(String[]::new); String[] xOrder = xAxis.stream().filter(f -> StringUtils.isNotEmpty(f.getSort()) && !StringUtils.equalsIgnoreCase(f.getSort(), "none")) - .map(f -> f.getDataeaseName() + " " + f.getSort()).toArray(String[]::new); + .map(f -> "_" + f.getDataeaseName() + " " + f.getSort()).toArray(String[]::new); String[] yOrder = yAxis.stream().filter(f -> StringUtils.isNotEmpty(f.getSort()) && !StringUtils.equalsIgnoreCase(f.getSort(), "none")) .map(f -> "_" + f.getSummary() + "_" + (StringUtils.equalsIgnoreCase(f.getDataeaseName(), "*") ? "" : f.getDataeaseName()) + " " + f.getSort()).toArray(String[]::new); String[] order = Arrays.copyOf(xOrder, xOrder.length + yOrder.length); 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 28f8009981..c980bc0363 100644 --- a/backend/src/main/resources/db/migration/V2__dataease_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__dataease_ddl.sql @@ -66,100 +66,100 @@ CREATE TABLE IF NOT EXISTS `dataset_group` ( DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( - `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `pid` bigint(20) DEFAULT NULL COMMENT '上级部门', - `sub_count` int(5) DEFAULT '0' COMMENT '子部门数目', - `name` varchar(255) NOT NULL COMMENT '名称', - `dept_sort` int(5) DEFAULT '999' COMMENT '排序', - `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', - `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', - `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', - `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`dept_id`) USING BTREE, - KEY `inx_pid` (`pid`) -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='部门'; + `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `pid` bigint(20) DEFAULT NULL COMMENT '上级部门', + `sub_count` int(5) DEFAULT '0' COMMENT '子部门数目', + `name` varchar(255) NOT NULL COMMENT '名称', + `dept_sort` int(5) DEFAULT '999' COMMENT '排序', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`dept_id`) USING BTREE, + KEY `inx_pid` (`pid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='组织机构'; DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( - `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `pid` bigint(20) DEFAULT NULL COMMENT '上级菜单ID', - `sub_count` int(5) DEFAULT '0' COMMENT '子菜单数目', - `type` int(11) DEFAULT NULL COMMENT '菜单类型', - `title` varchar(255) DEFAULT NULL COMMENT '菜单标题', - `name` varchar(255) DEFAULT NULL COMMENT '组件名称', - `component` varchar(255) DEFAULT NULL COMMENT '组件', - `menu_sort` int(5) DEFAULT NULL COMMENT '排序', - `icon` varchar(255) DEFAULT NULL COMMENT '图标', - `path` varchar(255) DEFAULT NULL COMMENT '链接地址', - `i_frame` bit(1) DEFAULT NULL COMMENT '是否外链', - `cache` bit(1) DEFAULT b'0' COMMENT '缓存', - `hidden` bit(1) DEFAULT b'0' COMMENT '隐藏', - `permission` varchar(255) DEFAULT NULL COMMENT '权限', - `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', - `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', - `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', - `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`menu_id`) USING BTREE, - UNIQUE KEY `uniq_title` (`title`), - UNIQUE KEY `uniq_name` (`name`), - KEY `inx_pid` (`pid`) -) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; + `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `pid` bigint(20) DEFAULT NULL COMMENT '上级菜单ID', + `sub_count` int(5) DEFAULT '0' COMMENT '子菜单数目', + `type` int(11) DEFAULT NULL COMMENT '菜单类型', + `title` varchar(255) DEFAULT NULL COMMENT '菜单标题', + `name` varchar(255) DEFAULT NULL COMMENT '组件名称', + `component` varchar(255) DEFAULT NULL COMMENT '组件', + `menu_sort` int(5) DEFAULT NULL COMMENT '排序', + `icon` varchar(255) DEFAULT NULL COMMENT '图标', + `path` varchar(255) DEFAULT NULL COMMENT '链接地址', + `i_frame` bit(1) DEFAULT NULL COMMENT '是否外链', + `cache` bit(1) DEFAULT b'0' COMMENT '缓存', + `hidden` bit(1) DEFAULT b'0' COMMENT '隐藏', + `permission` varchar(255) DEFAULT NULL COMMENT '权限', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`menu_id`) USING BTREE, + UNIQUE KEY `uniq_title` (`title`), + UNIQUE KEY `uniq_name` (`name`), + KEY `inx_pid` (`pid`) +) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( - `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `dept_id` bigint(20) DEFAULT NULL COMMENT '部门名称', - `username` varchar(255) DEFAULT NULL COMMENT '用户名', - `nick_name` varchar(255) DEFAULT NULL COMMENT '昵称', - `gender` varchar(2) DEFAULT NULL COMMENT '性别', - `phone` varchar(255) DEFAULT NULL COMMENT '手机号码', - `email` varchar(255) DEFAULT NULL COMMENT '邮箱', - `password` varchar(255) DEFAULT NULL COMMENT '密码', - `is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号', - `enabled` bigint(20) DEFAULT NULL COMMENT '状态:1启用、0禁用', - `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', - `update_by` varchar(255) DEFAULT NULL COMMENT '更新着', - `pwd_reset_time` bigint(13) DEFAULT NULL COMMENT '修改密码的时间', - `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', - `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', - `language` varchar(20) DEFAULT NULL COMMENT '语言', - PRIMARY KEY (`user_id`) USING BTREE, - UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE, - UNIQUE KEY `username` (`username`) USING BTREE, - UNIQUE KEY `uniq_username` (`username`), - UNIQUE KEY `uniq_email` (`email`), - KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE, - KEY `inx_enabled` (`enabled`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统用户'; + `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `dept_id` bigint(20) DEFAULT NULL COMMENT '部门名称', + `username` varchar(255) DEFAULT NULL COMMENT '用户名', + `nick_name` varchar(255) DEFAULT NULL COMMENT '昵称', + `gender` varchar(2) DEFAULT NULL COMMENT '性别', + `phone` varchar(255) DEFAULT NULL COMMENT '手机号码', + `email` varchar(255) DEFAULT NULL COMMENT '邮箱', + `password` varchar(255) DEFAULT NULL COMMENT '密码', + `is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号', + `enabled` bigint(20) DEFAULT NULL COMMENT '状态:1启用、0禁用', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新着', + `pwd_reset_time` bigint(13) DEFAULT NULL COMMENT '修改密码的时间', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + `language` varchar(20) DEFAULT NULL COMMENT '语言', + PRIMARY KEY (`user_id`) USING BTREE, + UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE, + UNIQUE KEY `username` (`username`) USING BTREE, + UNIQUE KEY `uniq_username` (`username`), + UNIQUE KEY `uniq_email` (`email`), + KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE, + KEY `inx_enabled` (`enabled`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统用户'; DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( - `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `name` varchar(255) NOT NULL COMMENT '名称', - `description` varchar(255) DEFAULT NULL COMMENT '描述', - `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', - `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', - `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', - `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`role_id`) USING BTREE, - UNIQUE KEY `uniq_name` (`name`), - KEY `role_name_index` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色表'; + `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(255) NOT NULL COMMENT '名称', + `description` varchar(255) DEFAULT NULL COMMENT '描述', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`role_id`) USING BTREE, + UNIQUE KEY `uniq_name` (`name`), + KEY `role_name_index` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色表'; DROP TABLE IF EXISTS `sys_roles_menus`; CREATE TABLE `sys_roles_menus` ( - `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', - `role_id` bigint(20) NOT NULL COMMENT '角色ID', - PRIMARY KEY (`menu_id`,`role_id`) USING BTREE, - KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE + `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`menu_id`,`role_id`) USING BTREE, + KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色菜单关联'; DROP TABLE IF EXISTS `sys_users_roles`; CREATE TABLE `sys_users_roles` ( - `user_id` bigint(20) NOT NULL COMMENT '用户ID', - `role_id` bigint(20) NOT NULL COMMENT '角色ID', - PRIMARY KEY (`user_id`,`role_id`) USING BTREE, - KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`,`role_id`) USING BTREE, + KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户角色关联'; DROP TABLE IF EXISTS `my_plugin`; 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 b0daf01eda..2a37e98509 100644 --- a/backend/src/main/resources/db/migration/V3__init_data.sql +++ b/backend/src/main/resources/db/migration/V3__init_data.sql @@ -2,38 +2,17 @@ INSERT INTO system_parameter (param_key, param_value, type, sort) VALUES ('default.language', 'zh_CN', 'text', 5); BEGIN; -INSERT INTO `sys_dept` VALUES (18, 0, 1, '上海飞致云', 1, NULL, NULL, 1614048906358, 1614048906358); -INSERT INTO `sys_dept` VALUES (19, 0, 1, '北京飞致云', 2, NULL, NULL, 1614048918465, 1614048918465); -INSERT INTO `sys_dept` VALUES (20, 18, 1, '营销部', 1, NULL, NULL, 1614048946370, 1614049006759); -INSERT INTO `sys_dept` VALUES (21, 19, 0, '综合部', 3, NULL, NULL, 1614048963483, 1619667528267); -INSERT INTO `sys_dept` VALUES (25, 20, 0, '售前组', 1, NULL, NULL, 1615791706945, 1615791706945); +INSERT INTO `sys_dept` VALUES (1, 0, 0, '默认组织', 0, NULL, NULL, 1622533297817, 1622533297817); COMMIT; BEGIN; INSERT INTO `sys_menu` VALUES (1, 0, 3, 0, '系统管理', 'system', 'Layout', 6, 'system', '/system', NULL, b'0', b'0', 'dir:sys', NULL, NULL, NULL, 1614916695777); INSERT INTO `sys_menu` VALUES (2, 1, 4, 1, '用户管理', 'system-user', 'system/user/index', 1, 'peoples', 'user', NULL, b'0', b'0', 'user:read', NULL, NULL, NULL, 1620281952752); -/*INSERT INTO `sys_menu` VALUES (3, 1, 3, 1, '菜单管理', 'system-menu', 'system/menu/index', 2, 'menu', 'menu', NULL, b'0', b'0', 'menu:read', NULL, NULL, NULL, NULL);*/ -/*INSERT INTO `sys_menu` VALUES (4, 1, 3, 1, '组织管理', 'system-dept', 'system/dept/index', 3, 'dept', 'dept', NULL, b'0', b'0', 'dept:read', NULL, NULL, NULL, NULL);*/ - -/*INSERT INTO `sys_menu` VALUES (5, 1, 3, 1, '角色管理', 'system-role', 'system/role/index', 4, 'role', 'role', b'0', b'0', b'0', 'role:read', NULL, NULL, 1614683852133, 1614683852133); -INSERT INTO `sys_menu` VALUES (6, 1, 0, 1, '参数管理', 'system-param', 'system/systemParamSettings/index', 5, 'sys-tools', 'systemParamSettings', NULL, b'0', b'0', 'sysparam:read', NULL, NULL, NULL, 1615790294169);*/ INSERT INTO `sys_menu` VALUES (8, 0, 0, 1, '数据集', 'dataset', 'dataset/index', 3, '', '/dataset', NULL, b'0', b'0', 'data:read', NULL, NULL, NULL, 1614916684821); INSERT INTO `sys_menu` VALUES (10, 0, 0, 1, '视图', 'view', 'chart/index', 2, '', '/chart', NULL, b'0', b'0', 'chart:read', NULL, NULL, NULL, 1614915491036); -/*INSERT INTO `sys_menu` VALUES (12, 3, 0, 2, '创建菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:add', NULL, NULL, 1614924617327, 1614924617327); -INSERT INTO `sys_menu` VALUES (13, 3, 0, 2, '删除菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:del', NULL, NULL, 1614924667808, 1614924667808); -INSERT INTO `sys_menu` VALUES (14, 3, 0, 2, '编辑菜单', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'menu:edit', NULL, NULL, 1614930734224, 1614936429773);*/ INSERT INTO `sys_menu` VALUES (15, 2, 0, 2, '创建用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:add', NULL, NULL, 1614930862373, 1614930862373); INSERT INTO `sys_menu` VALUES (16, 2, 0, 2, '删除用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:del', NULL, NULL, 1614930903502, 1614930903502); INSERT INTO `sys_menu` VALUES (17, 2, 0, 2, '编辑用户', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:edit', NULL, NULL, 1614930935529, 1614930935529); -/* -INSERT INTO `sys_menu` VALUES (18, 4, 0, 2, '创建组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:add', NULL, NULL, 1614930976297, 1614930976297); -INSERT INTO `sys_menu` VALUES (19, 4, 0, 2, '删除组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:del', NULL, NULL, 1614930997130, 1614930997130); -INSERT INTO `sys_menu` VALUES (20, 4, 0, 2, '编辑组织', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'dept:edit', NULL, NULL, 1614931022967, 1614931022967); -INSERT INTO `sys_menu` VALUES (21, 5, 0, 2, '创建角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:add', NULL, NULL, 1614931069408, 1614931069408); -INSERT INTO `sys_menu` VALUES (22, 5, 0, 2, '删除角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:del', NULL, NULL, 1614931097720, 1614931097720); -INSERT INTO `sys_menu` VALUES (23, 5, 0, 2, '编辑角色', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'role:edit', NULL, NULL, 1614931124782, 1614931124782); - - */ INSERT INTO `sys_menu` VALUES (24, 34, 0, 2, '创建连接', NULL, NULL, 997, NULL, NULL, b'0', b'0', b'0', 'datasource:add', NULL, NULL, 1614931168956, 1615783705537); INSERT INTO `sys_menu` VALUES (25, 34, 0, 2, '删除连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:del', NULL, NULL, 1614931205899, 1614931205899); 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); @@ -42,70 +21,70 @@ INSERT INTO `sys_menu` VALUES (28, 2, 0, 2, '修改密码', NULL, NULL, 999, NUL 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);*/ -/*INSERT INTO `sys_menu` VALUES (37, 1, 0, 1, '组织表单', 'system-dept-form', 'system/dept/form', 12, '', 'dept-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);*/ -/*INSERT INTO `sys_menu` VALUES (38, 1, 0, 1, '角色表单', 'system-role-form', 'system/role/form', 13, '', 'role-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);*/ INSERT INTO `sys_menu` VALUES (39, 0, 0, 1, '数据源表单', 'datasource-form', 'system/datasource/form', 5, NULL, '/ds-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (40, 1, 0, 1, '模板管理', 'system-template', 'panel/template/index', 13, 'dashboard', 'panel/template/index', NULL, b'0', b'0', 'template:read', NULL, NULL, NULL, 1620444227389); -/* -INSERT INTO `sys_menu` VALUES (41, 1, 0, 1, '权限管理', 'system-auth', 'system/authority/index', 14, 'password', 'system/authority/index', b'0', b'0', b'0', 'auth:read', NULL, NULL, NULL, 1620447312657); -INSERT INTO `sys_menu` VALUES (42, 1, 0, 1, '插件管理', 'system-plugin', 'system/plugin/index', 15, 'sys-tools', '/plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, NULL); - */ INSERT INTO `sys_menu` VALUES (50, 0, 0, 1, '个人信息', 'person-info', 'system/user/privateForm', 999, NULL, '/person-info', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (51, 0, 0, 1, '重置密码', 'person-pwd-reset', 'system/user/personPwd', 999, NULL, '/person-pwd', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (52, 0, 0, 1, '关于', 'about', 'system/about/index', 16, 'system', '/about', b'0', b'0', b'1', NULL, NULL, NULL, NULL, 1620897406691); COMMIT; BEGIN; -INSERT INTO `sys_user` VALUES (4, 0, 'admin', '管理员', '男', NULL, 'admin@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'1', 1, NULL, NULL, NULL, NULL, 1615184951534,'zh_CN'); -INSERT INTO `sys_user` VALUES (19, 25, 'demo', 'demo', '男', NULL, 'demo@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'0', 0, NULL, NULL, NULL, 1619086036234, 1619086036234,'zh_CN'); +INSERT INTO `sys_user` VALUES (1, 0, 'admin', '管理员', '男', NULL, 'admin@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'1', 1, NULL, NULL, NULL, NULL, 1615184951534, 'zh_CN'); +INSERT INTO `sys_user` VALUES (2, 1, 'demo', 'demo', '男', NULL, 'demo@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'0', 1, NULL, NULL, NULL, 1619086036234, 1622533509697, 'zh_CN'); COMMIT; BEGIN; -INSERT INTO `sys_role` VALUES (3, '管理员', '', NULL, NULL, REPLACE(unix_timestamp(current_timestamp(3)),'.',''), null); -INSERT INTO `sys_role` VALUES (4, '普通员工', '', NULL, NULL, REPLACE(unix_timestamp(current_timestamp(3)),'.',''), null); +INSERT INTO `sys_role` VALUES (1, '管理员', '', NULL, NULL, REPLACE(unix_timestamp(current_timestamp(3)),'.',''), null); +INSERT INTO `sys_role` VALUES (2, '普通员工', '', NULL, NULL, REPLACE(unix_timestamp(current_timestamp(3)),'.',''), null); COMMIT; BEGIN; -INSERT INTO `sys_roles_menus` VALUES (1, 3); -INSERT INTO `sys_roles_menus` VALUES (2, 3); -INSERT INTO `sys_roles_menus` VALUES (3, 3); -INSERT INTO `sys_roles_menus` VALUES (4, 3); -INSERT INTO `sys_roles_menus` VALUES (5, 3); -INSERT INTO `sys_roles_menus` VALUES (6, 3); -INSERT INTO `sys_roles_menus` VALUES (8, 3); -INSERT INTO `sys_roles_menus` VALUES (10, 3); -INSERT INTO `sys_roles_menus` VALUES (11, 3); -INSERT INTO `sys_roles_menus` VALUES (14, 3); -INSERT INTO `sys_roles_menus` VALUES (15, 3); -INSERT INTO `sys_roles_menus` VALUES (16, 3); -INSERT INTO `sys_roles_menus` VALUES (17, 3); -INSERT INTO `sys_roles_menus` VALUES (18, 3); -INSERT INTO `sys_roles_menus` VALUES (19, 3); -INSERT INTO `sys_roles_menus` VALUES (20, 3); -INSERT INTO `sys_roles_menus` VALUES (21, 3); -INSERT INTO `sys_roles_menus` VALUES (22, 3); -INSERT INTO `sys_roles_menus` VALUES (23, 3); -INSERT INTO `sys_roles_menus` VALUES (24, 3); -INSERT INTO `sys_roles_menus` VALUES (25, 3); -INSERT INTO `sys_roles_menus` VALUES (26, 3); -INSERT INTO `sys_roles_menus` VALUES (27, 3); -INSERT INTO `sys_roles_menus` VALUES (28, 3); -INSERT INTO `sys_roles_menus` VALUES (30, 3); -INSERT INTO `sys_roles_menus` VALUES (31, 3); -INSERT INTO `sys_roles_menus` VALUES (32, 3); -INSERT INTO `sys_roles_menus` VALUES (34, 3); -INSERT INTO `sys_roles_menus` VALUES (40, 3); -INSERT INTO `sys_roles_menus` VALUES (41, 3); -INSERT INTO `sys_roles_menus` VALUES (42, 3); -INSERT INTO `sys_roles_menus` VALUES (30, 4); +INSERT INTO `sys_roles_menus` VALUES (1, 1); +INSERT INTO `sys_roles_menus` VALUES (2, 1); +INSERT INTO `sys_roles_menus` VALUES (3, 1); +INSERT INTO `sys_roles_menus` VALUES (4, 1); +INSERT INTO `sys_roles_menus` VALUES (5, 1); +INSERT INTO `sys_roles_menus` VALUES (6, 1); +INSERT INTO `sys_roles_menus` VALUES (8, 1); +INSERT INTO `sys_roles_menus` VALUES (10, 1); +INSERT INTO `sys_roles_menus` VALUES (11, 1); +INSERT INTO `sys_roles_menus` VALUES (14, 1); +INSERT INTO `sys_roles_menus` VALUES (15, 1); +INSERT INTO `sys_roles_menus` VALUES (16, 1); +INSERT INTO `sys_roles_menus` VALUES (17, 1); +INSERT INTO `sys_roles_menus` VALUES (18, 1); +INSERT INTO `sys_roles_menus` VALUES (19, 1); +INSERT INTO `sys_roles_menus` VALUES (20, 1); +INSERT INTO `sys_roles_menus` VALUES (21, 1); +INSERT INTO `sys_roles_menus` VALUES (22, 1); +INSERT INTO `sys_roles_menus` VALUES (23, 1); +INSERT INTO `sys_roles_menus` VALUES (24, 1); +INSERT INTO `sys_roles_menus` VALUES (25, 1); +INSERT INTO `sys_roles_menus` VALUES (26, 1); +INSERT INTO `sys_roles_menus` VALUES (27, 1); +INSERT INTO `sys_roles_menus` VALUES (28, 1); +INSERT INTO `sys_roles_menus` VALUES (30, 1); +INSERT INTO `sys_roles_menus` VALUES (31, 1); +INSERT INTO `sys_roles_menus` VALUES (32, 1); +INSERT INTO `sys_roles_menus` VALUES (34, 1); +INSERT INTO `sys_roles_menus` VALUES (40, 1); +INSERT INTO `sys_roles_menus` VALUES (41, 1); +INSERT INTO `sys_roles_menus` VALUES (42, 1); +INSERT INTO `sys_roles_menus` VALUES (8, 2); +INSERT INTO `sys_roles_menus` VALUES (10, 2); +INSERT INTO `sys_roles_menus` VALUES (24, 2); +INSERT INTO `sys_roles_menus` VALUES (25, 2); +INSERT INTO `sys_roles_menus` VALUES (26, 2); +INSERT INTO `sys_roles_menus` VALUES (27, 2); +INSERT INTO `sys_roles_menus` VALUES (30, 2); +INSERT INTO `sys_roles_menus` VALUES (34, 2); COMMIT; BEGIN; -INSERT INTO `sys_users_roles` VALUES (4, 3); -INSERT INTO `sys_users_roles` VALUES (19, 4); +INSERT INTO `sys_users_roles` VALUES (1, 1); +INSERT INTO `sys_users_roles` VALUES (2, 2); COMMIT; INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.favicon', NULL, 'file', 6); diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index a89f27a5a3..7bf0bf2b15 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -243,3 +243,4 @@ i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled i18n_username_exists=ID is already exists i18n_ds_name_exists=Datasource name exists i18n_sync_job_exists=There is already a synchronization task running, please try again later +i18n_datasource_check_fail=Invalid,please check config diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 5a3a318e9e..6ef78e0a4f 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -245,3 +245,4 @@ i18n_auth_source_be_canceled=当前资源授权权限已经被取消 i18n_username_exists=用户ID已存在 i18n_ds_name_exists=数据源名称已存在 i18n_sync_job_exists=已经有同步任务在运行,稍后重试 +i18n_datasource_check_fail=校验失败,请检查配置信息 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 49c3d8d98a..fe3e55190d 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -245,3 +245,4 @@ i18n_auth_source_be_canceled=當前資源授權權限已經被取消 i18n_username_exists=用戶ID已存在 i18n_ds_name_exists=數據源名稱已存在 i18n_sync_job_exists=已經有同步任務在運行,稍後重試 +i18n_datasource_check_fail=校驗失敗,請檢查配置信息 diff --git a/frontend/src/components/canvas/components/AttrList.vue b/frontend/src/components/canvas/components/AttrList.vue index b11bcee099..e0c2f6c041 100644 --- a/frontend/src/components/canvas/components/AttrList.vue +++ b/frontend/src/components/canvas/components/AttrList.vue @@ -1,24 +1,42 @@ + @@ -27,21 +45,46 @@ export default { data() { return { - excludes: ['Picture', 'Group'], // 这些组件不显示内容 - options: [ + excludes: ['Picture', 'Group', 'user-view'], // 这些组件不显示内容 + textAlignOptions: [ { - label: this.$t('panel.aline_left'), + label: this.$t('panel.text_align_left'), value: 'left' }, { - label: this.$t('panel.aline_center'), + label: this.$t('panel.text_align_center'), value: 'center' }, { - label: this.$t('panel.aline_right'), + label: this.$t('panel.text_align_right'), value: 'right' } ], + borderStyleOptions: [ + { + label: this.$t('panel.border_style_solid'), + value: 'solid' + }, + { + label: this.$t('panel.border_style_dashed'), + value: 'dashed' + } + ], + verticalAlignOptions: [ + { + label: this.$t('panel.vertical_align_top'), + value: 'top' + }, + { + label: this.$t('panel.vertical_align_middle'), + value: 'middle' + }, + { + label: this.$t('panel.vertical_align_bottom'), + value: 'bottom' + } + ], + selectKey: ['textAlign', 'borderStyle', 'verticalAlign'], map: { left: this.$t('panel.left'), top: this.$t('panel.top'), @@ -49,6 +92,7 @@ export default { width: this.$t('panel.width'), color: this.$t('panel.color'), backgroundColor: this.$t('panel.backgroundColor'), + borderStyle: this.$t('panel.borderStyle'), borderWidth: this.$t('panel.borderWidth'), borderColor: this.$t('panel.borderColor'), borderRadius: this.$t('panel.borderRadius'), @@ -57,12 +101,14 @@ export default { lineHeight: this.$t('panel.lineHeight'), letterSpacing: this.$t('panel.letterSpacing'), textAlign: this.$t('panel.textAlign'), - opacity: this.$t('panel.opacity') + opacity: this.$t('panel.opacity'), + verticalAlign: this.$t('panel.verticalAlign') } } }, computed: { styleKeys() { + console.log(this.$store.state.curComponent.style) return this.$store.state.curComponent ? Object.keys(this.$store.state.curComponent.style) : [] }, curComponent() { @@ -73,10 +119,10 @@ export default { diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index f986f92742..41fe23c0cb 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -127,7 +127,6 @@ 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/Editor/Shape.vue b/frontend/src/components/canvas/components/Editor/Shape.vue index 9db1a349d0..2cc91c0502 100644 --- a/frontend/src/components/canvas/components/Editor/Shape.vue +++ b/frontend/src/components/canvas/components/Editor/Shape.vue @@ -334,7 +334,6 @@ export default { curPoint, symmetricPoint }) - // console.log('this is test:' + JSON.stringify(this.element.propValue.viewId)) this.$store.commit('setShapeStyle', style) this.element.propValue && this.element.propValue.viewId && eventBus.$emit('resizing', this.element.propValue.viewId) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index f651dc1d4f..1f1024e2d3 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -21,22 +21,20 @@ :index="index" :class="{ lock: item.isLock }" > - - - - + + +
+
+
+ +
+
+
+ {{ $t('panel.other_module') }} +
+
+
+
+
+
+
+
@@ -73,6 +90,7 @@ +
{ _this.$nextTick(() => { - debugger _this.restore() }) }) @@ -276,6 +295,9 @@ export default { if (componentDataTemp && canvasStyleDataTemp) { this.$store.commit('setComponentData', this.resetID(JSON.parse(componentDataTemp))) this.$store.commit('setCanvasStyle', JSON.parse(canvasStyleDataTemp)) + // 清空临时画布数据 + this.$store.dispatch('panel/setComponentDataTemp', null) + this.$store.dispatch('panel/setCanvasStyleDataTemp', null) } else if (panelId) { findOne(panelId).then(response => { this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) @@ -341,8 +363,15 @@ export default { const componentInfo = JSON.parse(e.dataTransfer.getData('componentInfo')) - // 用户视图设置 复制一个模板 - if (componentInfo.type === 'view') { + if (componentInfo.type === 'assist') { + // 辅助设计组件 + componentList.forEach(componentTemp => { + if (componentInfo.id === componentTemp.id) { + component = deepCopy(componentTemp) + } + }) + } else if (componentInfo.type === 'view') { + // 用户视图设置 复制一个模板 componentList.forEach(componentTemp => { if (componentTemp.type === 'view') { component = deepCopy(componentTemp) @@ -368,6 +397,7 @@ export default { component = deepCopy(this.currentFilterCom) } + // position = absolution 或导致有偏移 这里中和一下偏移量 component.style.top = e.offsetY component.style.left = e.offsetX component.id = newComponentId @@ -386,7 +416,7 @@ export default { }, handleMouseDown() { - console.log('handleMouseDown123') + // console.log('handleMouseDown123') this.$store.commit('setClickComponentStatus', false) }, @@ -442,14 +472,13 @@ export default { return result }, restore() { - debugger if (document.getElementById('canvasInfo')) { this.$nextTick(() => { const canvasHeight = document.getElementById('canvasInfo').offsetHeight const canvasWidth = document.getElementById('canvasInfo').offsetWidth this.outStyle.height = canvasHeight this.outStyle.width = canvasWidth - console.log(canvasHeight + '--' + canvasWidth) + // console.log(canvasHeight + '--' + canvasWidth) }) } } @@ -546,10 +575,10 @@ export default { background-color: #ffffff!important; } .style-aside{ - width: 85px; - max-width:85px!important; + width: 200px; + max-width:200px!important; border: 1px solid #E6E6E6; - padding: 3px; + padding: 10px; transition: all 0.3s; } diff --git a/frontend/src/views/panel/filter/filterDialog.vue b/frontend/src/views/panel/filter/filterDialog.vue index 3929e6e57b..036d0da230 100644 --- a/frontend/src/views/panel/filter/filterDialog.vue +++ b/frontend/src/views/panel/filter/filterDialog.vue @@ -132,7 +132,7 @@ :move="onMove" style="width:100%;height: 100%;margin:0 10px;border-radius: 4px;overflow-x: auto;display: flex;align-items: center;background-color: white;" @end="end2" - > + > @@ -308,7 +308,7 @@ export default { }, methods: { - attr(){ + attr() { return 'aaa' }, loadViews() { @@ -370,9 +370,17 @@ export default { this.componentSetBreads.push(tail) }, - removeTail() { - this.dataSetBreads = this.dataSetBreads.slice(0, this.dataSetBreads.length - 1) - this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false + removeTail(bread) { + for (let index = 0; index < this.dataSetBreads.length; index++) { + const element = this.dataSetBreads[index] + if (element.type === bread.type) { + this.dataSetBreads = this.dataSetBreads.slice(0, index + 1) + this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false + return + } + } + // this.dataSetBreads = this.dataSetBreads.slice(0, this.dataSetBreads.length - 1) + // this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false }, comRemoveTail() { this.componentSetBreads = this.componentSetBreads.slice(0, this.componentSetBreads.length - 1) @@ -385,7 +393,7 @@ export default { this.showDomType = 'tree' } - this.removeTail() + this.removeTail(bread) }, comBackLink(bread) { this.comShowDomType = 'view' @@ -585,6 +593,9 @@ export default { .filter-dialog-tabs { border: 1px solid #E6E6E6; height: 100%; + >>> div.el-tabs__content { + height: calc(100% - 55px); + } } .filter-common { @@ -596,6 +607,11 @@ export default { margin: 20px 10px !important; } + .component-result-content { + height: calc(50vh - 140px); + overflow-y: auto; + } + .link-text { font-weight: 450 !important; color: #409EFF; diff --git a/frontend/src/views/panel/filter/index.vue b/frontend/src/views/panel/filter/index.vue index ab79d5f418..242e34ceca 100644 --- a/frontend/src/views/panel/filter/index.vue +++ b/frontend/src/views/panel/filter/index.vue @@ -28,7 +28,8 @@ -