diff --git a/backend/src/main/java/io/dataease/plugins/server/SSOServer.java b/backend/src/main/java/io/dataease/plugins/server/SSOServer.java index 768b242ae9..3056caeb2e 100644 --- a/backend/src/main/java/io/dataease/plugins/server/SSOServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/SSOServer.java @@ -5,7 +5,6 @@ import java.net.URLEncoder; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; @@ -46,13 +45,13 @@ public class SSOServer { @GetMapping("/callBack") public ModelAndView callBack(@RequestParam("code") String code, @RequestParam("state") String state) { - ModelAndView modelAndView = new ModelAndView("redirect:/"); - HttpServletResponse response = ServletUtils.response(); + ModelAndView modelAndView = new ModelAndView("redirect:/"); + HttpServletResponse response = ServletUtils.response(); OidcXpackService oidcXpackService = null; String idToken = null; try { Map beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((OidcXpackService.class)); - if(beansOfType.keySet().size() == 0) { + if (beansOfType.keySet().size() == 0) { DEException.throwException("缺少oidc插件"); } oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class); @@ -60,17 +59,18 @@ public class SSOServer { if (!suuportOIDC) { DEException.throwException("未开启oidc"); } - Map config = config(oidcXpackService); + Map config = config(oidcXpackService); SSOToken ssoToken = oidcXpackService.requestSsoToken(config, code, state); idToken = ssoToken.getIdToken(); - Cookie cookie_id_token = new Cookie("IdToken", ssoToken.getIdToken());cookie_id_token.setPath("/"); + Cookie cookie_id_token = new Cookie("IdToken", ssoToken.getIdToken()); + cookie_id_token.setPath("/"); response.addCookie(cookie_id_token); - + SSOUserInfo ssoUserInfo = oidcXpackService.requestUserInfo(config, ssoToken.getAccessToken()); - + SysUserEntity sysUserEntity = authUserService.getUserBySub(ssoUserInfo.getSub()); - if(null == sysUserEntity){ + if (null == sysUserEntity) { sysUserService.validateExistUser(ssoUserInfo.getUsername(), ssoUserInfo.getNickName(), ssoUserInfo.getEmail()); sysUserService.saveOIDCUser(ssoUserInfo); sysUserEntity = authUserService.getUserBySub(ssoUserInfo.getSub()); @@ -79,17 +79,19 @@ public class SSOServer { String realPwd = CodingUtil.md5(sysUserService.defaultPWD()); String token = JWTUtils.sign(tokenInfo, realPwd); ServletUtils.setToken(token); - - - Cookie cookie_token = new Cookie("Authorization", token);cookie_token.setPath("/"); - - Cookie cookie_ac_token = new Cookie("AccessToken", ssoToken.getAccessToken());cookie_ac_token.setPath("/"); + + + Cookie cookie_token = new Cookie("Authorization", token); + cookie_token.setPath("/"); + + Cookie cookie_ac_token = new Cookie("AccessToken", ssoToken.getAccessToken()); + cookie_ac_token.setPath("/"); response.addCookie(cookie_token); - + response.addCookie(cookie_ac_token); - }catch(Exception e) { - + } catch (Exception e) { + String msg = e.getMessage(); if (null != e.getCause()) { msg = e.getCause().getMessage(); @@ -107,19 +109,18 @@ public class SSOServer { } catch (UnsupportedEncodingException e1) { e.printStackTrace(); } - - - } + + + } return modelAndView; } + private Map config(OidcXpackService oidcXpackService) { List sysSettingDtos = oidcXpackService.oidcSettings(); - Map config = sysSettingDtos.stream().collect(HashMap::new,(m, v)->m.put(v.getParamKey(), v.getParamValue()), HashMap::putAll); + Map config = sysSettingDtos.stream().collect(HashMap::new, (m, v) -> m.put(v.getParamKey(), v.getParamValue()), HashMap::putAll); return config; } - - - + } diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index b59431927f..0b6a050ca6 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -533,7 +533,7 @@ public class DataSetTableService { .checked(Boolean.TRUE).build(); List fields = dataSetTableFieldsService.list(datasetTableField); if (CollectionUtils.isNotEmpty(extFields)) { - fields.addAll(extFields); + fields = extFields; } if (CollectionUtils.isEmpty(fields)) { map.put("fields", fields); @@ -749,7 +749,7 @@ public class DataSetTableService { conditionEntities.add(entity2); request.setConditions(conditionEntities); List dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel"); - if(CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)){ + if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) { dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name()); sycnStatus = dataSetTaskLogDTOS.get(0).getStatus(); } @@ -943,14 +943,15 @@ public class DataSetTableService { List sqlVariableDetails = new ArrayList<>(); datasetTables.forEach(datasetTable -> { if (StringUtils.isNotEmpty(datasetTable.getSqlVariableDetails())) { - sqlVariableDetails.addAll(new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken>() {}.getType())); + sqlVariableDetails.addAll(new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken>() { + }.getType())); } }); return sqlVariableDetails; } - public String handleVariableDefaultValue(String sql, String sqlVariableDetails){ + public String handleVariableDefaultValue(String sql, String sqlVariableDetails) { if (StringUtils.isEmpty(sql)) { DataEaseException.throwException(Translator.get("i18n_sql_not_empty")); } @@ -958,7 +959,8 @@ public class DataSetTableService { Matcher matcher = pattern.matcher(sql); while (matcher.find()) { SqlVariableDetails defaultsSqlVariableDetail = null; - List defaultsSqlVariableDetails = new Gson().fromJson(sqlVariableDetails, new TypeToken>() {}.getType()); + List defaultsSqlVariableDetails = new Gson().fromJson(sqlVariableDetails, new TypeToken>() { + }.getType()); for (SqlVariableDetails sqlVariableDetail : defaultsSqlVariableDetails) { if (matcher.group().substring(2, matcher.group().length() - 1).equalsIgnoreCase(sqlVariableDetail.getVariableName())) { defaultsSqlVariableDetail = sqlVariableDetail; @@ -969,11 +971,11 @@ public class DataSetTableService { sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue()); } } - try { - sql = removeVariables(sql); - }catch (Exception e){ - e.printStackTrace(); - } + try { + sql = removeVariables(sql); + } catch (Exception e) { + e.printStackTrace(); + } return sql; } @@ -985,7 +987,7 @@ public class DataSetTableService { hasVariables = true; sql = sql.replace(matcher.group(), SubstitutedParams); } - if(!hasVariables){ + if (!hasVariables) { return sql; } CCJSqlParserUtil.parse(sql, parser -> parser.withSquareBracketQuotation(true)); @@ -993,15 +995,15 @@ public class DataSetTableService { Select select = (Select) statement; PlainSelect plainSelect = ((PlainSelect) select.getSelectBody()); Expression expr = plainSelect.getWhere(); - if(expr == null){ + if (expr == null) { return sql; } StringBuilder stringBuilder = new StringBuilder(); - BinaryExpression binaryExpression = (BinaryExpression)expr; + BinaryExpression binaryExpression = (BinaryExpression) expr; - if(!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())){ + if (!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())) { stringBuilder.append(SubstitutedSql); - }else { + } else { expr.accept(getExpressionDeParser(stringBuilder)); } plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString())); @@ -2626,6 +2628,7 @@ public class DataSetTableService { }; return expressionDeParser; } + static private boolean hasVarible(String sql) { return sql.contains(SubstitutedParams); } diff --git a/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java b/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java index 4889f9e7ee..ab8256223a 100644 --- a/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java +++ b/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java @@ -4,6 +4,7 @@ import com.google.gson.Gson; import io.dataease.commons.exception.DEException; import io.dataease.commons.model.BaseTreeNode; import io.dataease.commons.utils.BeanUtils; +import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.TreeUtils; import io.dataease.dto.dataset.DeSortDTO; import io.dataease.plugins.common.base.domain.DatasetTable; @@ -86,6 +87,8 @@ public class DirectFieldService implements DataSetFieldService { List deSortFields = buildSorts(fields, sortDTO); + Boolean needSort = CollectionUtils.isNotEmpty(deSortFields); + final List allTableFieldIds = fields.stream().map(DatasetTableField::getId).collect(Collectors.toList()); boolean multi = fieldIds.stream().anyMatch(item -> !allTableFieldIds.contains(item)); if (multi && needMapping) { @@ -136,22 +139,22 @@ public class DirectFieldService implements DataSetFieldService { QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); if (StringUtils.equalsIgnoreCase(datasetTable.getType(), DatasetType.DB.toString())) { datasourceRequest.setTable(dataTableInfoDTO.getTable()); - datasourceRequest.setQuery(qp.createQuerySQL(dataTableInfoDTO.getTable(), permissionFields, false, ds, customFilter, deSortFields)); + datasourceRequest.setQuery(qp.createQuerySQL(dataTableInfoDTO.getTable(), permissionFields, !needSort, ds, customFilter, deSortFields)); } else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), DatasetType.SQL.toString())) { String sql = dataTableInfoDTO.getSql(); if (rowAndColumnMgm) { sql = dataSetTableService.removeVariables(sql); } - datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, false, customFilter, deSortFields)); + datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, !needSort, customFilter, deSortFields)); } else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), DatasetType.CUSTOM.toString())) { DataTableInfoDTO dt = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class); List listUnion = dataSetTableUnionService.listByTableId(dt.getList().get(0).getTableId()); String sql = dataSetTableService.getCustomSQLDatasource(dt, listUnion, ds); - datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, false, customFilter, deSortFields)); + datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, !needSort, customFilter, deSortFields)); } else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), DatasetType.UNION.toString())) { DataTableInfoDTO dt = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class); String sql = (String) dataSetTableService.getUnionSQLDatasource(dt, ds).get("sql"); - datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, false, customFilter, deSortFields)); + datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, permissionFields, !needSort, customFilter, deSortFields)); } } else if (datasetTable.getMode() == 1) {// 抽取 // 连接doris,构建doris数据源查询 @@ -162,9 +165,9 @@ public class DirectFieldService implements DataSetFieldService { String tableName = "ds_" + datasetTable.getId().replaceAll("-", "_"); datasourceRequest.setTable(tableName); QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); - datasourceRequest.setQuery(qp.createQuerySQL(tableName, permissionFields, false, null, customFilter)); + datasourceRequest.setQuery(qp.createQuerySQL(tableName, permissionFields, !needSort, null, customFilter, deSortFields)); } - System.out.println(datasourceRequest.getQuery()); + LogUtil.info(datasourceRequest.getQuery()); List rows = datasourceProvider.getData(datasourceRequest); if (!needMapping) { List results = rows.stream().map(row -> row[0]).distinct().collect(Collectors.toList()); diff --git a/backend/src/main/resources/db/migration/V37__1.12.sql b/backend/src/main/resources/db/migration/V37__1.12.sql index 7dd338599b..92a1356bbb 100644 --- a/backend/src/main/resources/db/migration/V37__1.12.sql +++ b/backend/src/main/resources/db/migration/V37__1.12.sql @@ -26,4 +26,13 @@ ALTER TABLE `dataset_table` ADD COLUMN `sql_variable_details` LONGTEXT NULL AFTE INSERT INTO `my_plugin` (`name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `creator`, `load_mybatis`, `install_time`, `module_name`, `ds_type`) VALUES ('达梦数据源插件', 'default', '0', '0', 'datasource', '达梦数据源插件', '1.0-SNAPSHOT', 'DATAEASE', '0', - '1650765903630', 'dm-backend', 'dm'); \ No newline at end of file + '1650765903630', 'dm-backend', 'dm'); + +update sys_user set nick_name='示例用户' where user_id =2; +DROP VIEW IF EXISTS `v_auth_model`; +CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,concat(`sys_user`.`nick_name`,'(',`sys_user`.`username`,')') AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `sys_user` where (`sys_user`.`is_admin` <> 1) union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,(cast(`sys_dept`.`pid` as char charset utf8mb4) collate utf8mb4_general_ci) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by`,`dataset_group`.`level` AS `level`,0 AS `mode`,'0' AS `data_source_id` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by`,0 AS `level`,`dataset_table`.`mode` AS `mode`,`dataset_table`.`data_source_id` AS `data_source_id` from `dataset_table` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `sys_menu` where ((`sys_menu`.`i_frame` <> 1) or isnull(`sys_menu`.`i_frame`)) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by`,0 AS `level`,0 AS `mode`,'0' AS `data_source_id` from `plugin_sys_menu` where ((`plugin_sys_menu`.`i_frame` <> 1) or isnull(`plugin_sys_menu`.`i_frame`)); + +delete from panel_subject; +INSERT INTO `panel_subject` (`id`, `name`, `type`, `details`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('system_2', '系统主题_深色', 'system', '{\"width\":1600,\"height\":900,\"scale\":100,\"scaleWidth\":100,\"scaleHeight\":100,\"selfAdaption\":true,\"auxiliaryMatrix\":true,\"openCommonStyle\":true,\"panel\":{\"themeColor\":\"dark\",\"color\":\"#030B2E\",\"imageUrl\":{},\"backgroundType\":\"color\",\"gap\":\"yes\",\"resultMode\":\"all\",\"resultCount\":1000},\"aidedDesign\":{\"showGrid\":false,\"matrixBase\":4},\"refreshViewLoading\":true,\"refreshUnit\":\"minute\",\"refreshTime\":5,\"themeId\":\"b32bb6c0-f381-11ec-8f96-ef9d1b285eec\",\"chartInfo\":{\"chartTitle\":{\"show\":true,\"fontSize\":\"18\",\"color\":\"#FFFFFF\",\"hPosition\":\"left\",\"vPosition\":\"top\",\"isItalic\":false,\"isBolder\":true},\"chartColor\":{\"value\":\"default\",\"colors\":[\"#5470c6\",\"#91cc75\",\"#fac858\",\"#ee6666\",\"#73c0de\",\"#3ba272\",\"#fc8452\",\"#9a60b4\",\"#ea7ccc\"],\"alpha\":100,\"tableHeaderBgColor\":\"#4E81BB\",\"tableItemBgColor\":\"#131E42\",\"tableFontColor\":\"#ffffff\",\"tableStripe\":true,\"dimensionColor\":\"#ffffff\",\"quotaColor\":\"#4E81BB\",\"tableBorderColor\":\"#CCCCCC\",\"seriesColors\":[]},\"chartCommonStyle\":{\"backgroundColorSelect\":true,\"color\":\"#131E42\",\"alpha\":100,\"borderRadius\":5,\"innerPadding\":0},\"filterStyle\":{\"horizontal\":\"left\",\"vertical\":\"top\",\"color\":\"#FFFFFF\",\"brColor\":\"#4E4B4B\",\"wordColor\":\"#4E4B4B\",\"innerBgColor\":\"#131E42\"}}}', 1656049892765, NULL, NULL, NULL); +INSERT INTO `panel_subject` (`id`, `name`, `type`, `details`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('system_1', '系统主题_浅色', 'system', '{\"width\":1600,\"height\":900,\"scale\":100,\"scaleWidth\":100,\"scaleHeight\":100,\"selfAdaption\":true,\"auxiliaryMatrix\":true,\"openCommonStyle\":true,\"panel\":{\"themeColor\":\"light\",\"color\":\"#F1F3F5\",\"imageUrl\":{},\"backgroundType\":\"color\",\"gap\":\"yes\",\"resultMode\":\"all\",\"resultCount\":1000},\"aidedDesign\":{\"showGrid\":false,\"matrixBase\":4},\"refreshViewLoading\":true,\"refreshUnit\":\"minute\",\"refreshTime\":5,\"themeId\":\"b1b1c0f0-f381-11ec-8f96-ef9d1b285eec\",\"chartInfo\":{\"chartTitle\":{\"show\":true,\"fontSize\":\"18\",\"color\":\"#000000\",\"hPosition\":\"left\",\"vPosition\":\"top\",\"isItalic\":false,\"isBolder\":true},\"chartColor\":{\"value\":\"default\",\"colors\":[\"#5470c6\",\"#91cc75\",\"#fac858\",\"#ee6666\",\"#73c0de\",\"#3ba272\",\"#fc8452\",\"#9a60b4\",\"#ea7ccc\"],\"alpha\":100,\"tableHeaderBgColor\":\"#6D9A49\",\"tableItemBgColor\":\"#FFFFFF\",\"tableFontColor\":\"#000000\",\"tableStripe\":true,\"dimensionColor\":\"#000000\",\"quotaColor\":\"#4E81BB\",\"tableBorderColor\":\"#E6E7E4\",\"seriesColors\":[]},\"chartCommonStyle\":{\"backgroundColorSelect\":true,\"color\":\"#FFFFFF\",\"alpha\":100,\"borderRadius\":5,\"innerPadding\":0},\"filterStyle\":{\"horizontal\":\"left\",\"vertical\":\"top\",\"color\":\"#000000\",\"brColor\":\"\",\"wordColor\":\"\",\"innerBgColor\":\"\"}}}', 1656049890290, NULL, NULL, NULL); + diff --git a/frontend/src/components/ElTreeSelect/index.vue b/frontend/src/components/ElTreeSelect/index.vue index 86bcb61a68..af475cab2a 100644 --- a/frontend/src/components/ElTreeSelect/index.vue +++ b/frontend/src/components/ElTreeSelect/index.vue @@ -30,8 +30,8 @@ - - + + @@ -48,6 +48,7 @@ :render-content="treeRenderFun" @node-click="_treeNodeClickFun" @check="_treeCheckFun" + @check-change="_treeCheckChange" />
暂无数据
@@ -282,6 +283,9 @@ export default { off(document, 'mouseup', this._popoverHideFun) }, methods: { + _treeCheckChange() { + this.$emit("treeCheckChange") + }, // 根据类型判断单选,多选 _setMultipleFun() { let multiple = false diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue new file mode 100644 index 0000000000..5338d70b59 --- /dev/null +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index c24992499d..9072ff6edb 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -43,7 +43,7 @@ top="5vh" > - + {{ $t('chart.export_img') }} diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 392b1e590e..853bf428f8 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -144,7 +144,7 @@ top="5vh" > - + {{ $t('chart.export_img') }} diff --git a/frontend/src/components/canvas/components/TextAttr.vue b/frontend/src/components/canvas/components/TextAttr.vue index b3bab89ced..8714099d1e 100644 --- a/frontend/src/components/canvas/components/TextAttr.vue +++ b/frontend/src/components/canvas/components/TextAttr.vue @@ -105,7 +105,7 @@
- +
@@ -115,7 +115,7 @@
- +
@@ -123,58 +123,70 @@
- +
- +
- +
- +
- +
- - + +
- +
- +
- +
+
+ + + + + +
@@ -257,12 +269,23 @@ export default { value: '5', label: '5' }], + pictureAdaptation: [{ + value: 'adaptation', + label: this.$t('panel.pic_adaptation') + }, { + value: 'equiratio', + label: this.$t('panel.pic_equiratio') + }, { + value: 'original', + label: this.$t('panel.pic_original') + }], // 矩形组件显示的属性 'picture-add': [ 'borderStyle', 'borderWidth', 'borderColor', - 'hyperlinks' + 'hyperlinks', + 'adaptation' ], // 过滤组件显示的属性 'custom': [ @@ -345,13 +368,16 @@ export default { mainStyle() { const style = { left: (this.getPositionX(this.curComponent.style.left) - this.scrollLeft) + 'px', - top: (this.getPositionY(this.curComponent.style.top) - this.scrollTop - 3) + 'px' + top: (this.getPositionY(this.curComponent.style.top) - this.scrollTop + 25) + 'px' } return style }, styleInfo() { return this.$store.state.curComponent.style }, + elementType() { + return this.$store.state.curComponent.component + }, canvasWidth() { return this.canvasStyleData.width * this.curCanvasScale.scalePointWidth }, @@ -477,6 +503,7 @@ export default { .el-card-main { height: 34px; z-index: 10; + padding-right: 2px; position: absolute; } diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 4a70cf7612..0c670b939b 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -3,12 +3,10 @@
- - - + - +
@@ -28,69 +26,73 @@
- - - - + + {{ panelInfo.name }}
- + - + - + - - + - - {{ $t('panel.more') }} + + + {{ $t('panel.more') }} + - + - - {{ $t('panel.new_element_distribution') }} - + + {{ $t('panel.new_element_distribution') }} + - - {{ $t('panel.suspension') }} - + + {{ $t('panel.suspension') }} + - - {{ $t('panel.matrix') }} - + + {{ $t('panel.matrix') }} + - - {{ $t('panel.aided_grid') }} - + + {{ $t('panel.aided_grid') }} + - - {{ $t('panel.params_setting') }} + + {{ $t('panel.params_setting') }} - - {{ $t('panel.clean_canvas') }} + + {{ $t('panel.clean_canvas') }} - {{ $t('panel.panel_style') }} - {{ $t('panel.batch_opt') }} - + + {{ $t('panel.panel_style') }} + + {{ $t('panel.batch_opt') }} + {{ $t('commons.save') }} @@ -110,7 +112,9 @@ - {{ $t('panel.panel_save_warn_tips') }} + {{ + $t('panel.panel_save_warn_tips') + }}