diff --git a/backend/pom.xml b/backend/pom.xml deleted file mode 100644 index 775a68bfd8..0000000000 --- a/backend/pom.xml +++ /dev/null @@ -1,543 +0,0 @@ - - - - - dataease-server - io.dataease - 1.18.1 - - - 4.0.0 - backend - - - UTF-8 - 1.9.1 - 1.8 - 20.1.0 - 3.12.1 - 4.0.0 - 3.3.0 - - - - - - junit - junit - test - - - com.google.guava - guava - 31.0.1-jre - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-configuration-processor - - - org.springframework.boot - spring-boot-starter - - - org.slf4j - slf4j-api - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-aop - - - javax.servlet - javax.servlet-api - 4.0.1 - - - org.springframework.boot - spring-boot-starter-mail - - - org.projectlombok - lombok - - - org.springframework.boot - spring-boot-starter-websocket - - - com.google.code.gson - gson - - - - org.flywaydb - flyway-core - - - mysql - mysql-connector-java - 8.0.28 - runtime - - - com.github.pagehelper - pagehelper - 5.3.1 - - - org.apache.shiro - shiro-spring - ${shiro.version} - - - - org.apache.commons - commons-lang3 - - - org.apache.commons - commons-collections4 - 4.4 - - - org.apache.commons - commons-text - [1.10.0,) - - - commons-codec - commons-codec - - - com.alibaba - fastjson - 1.2.83 - - - com.auth0 - java-jwt - ${jwt.version} - - - org.apache.curator - curator-framework - 4.0.1 - - - org.slf4j - slf4j-api - - - guava - com.google.guava - - - - - org.apache.curator - curator-recipes - 4.0.1 - - - - com.fit2cloud - quartz-spring-boot-starter - 0.0.7 - - - org.slf4j - slf4j-api - - - - - org.apache.commons - commons-compress - 1.21 - - - - jaxen - jaxen - 1.2.0 - - - - org.springframework.boot - spring-boot-starter-cache - - - org.testng - testng - 6.8 - test - - - - net.sf.ehcache - ehcache - 2.9.1 - - - org.slf4j - slf4j-api - - - - - io.dataease - dataease-plugin-interface - 1.18.1 - - - guava - com.google.guava - - - - - io.dataease - dataease-plugin-view - 1.18.1 - - - io.dataease - dataease-plugin-datasource - 1.18.1 - - - - pentaho-kettle - kettle-core - 8.3.0.18-1112 - - - org.slf4j - slf4j-api - - - guava - com.google.guava - - - commons-io - commons-io - - - - - pentaho-kettle - kettle-engine - 8.3.0.18-1112 - - - org.slf4j - slf4j-api - - - org.springframework.security - spring-security-core - - - guava - com.google.guava - - - commons-io - commons-io - - - - - pentaho - metastore - 8.3.0.18-1112 - - - guava - com.google.guava - - - commons-io - commons-io - - - - - org.pentaho.di.plugins - pdi-engine-configuration-impl - 8.3.0.7-683 - - - com.alibaba - druid - 1.2.8 - - - com.alibaba - jconsole - - - com.alibaba - tools - - - - - org.seleniumhq.selenium - selenium-java - - - org.jsoup - jsoup - 1.15.3 - - - com.jayway.jsonpath - json-path - 2.4.0 - - - org.slf4j - slf4j-api - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - org.apache.commons - commons-pool2 - - - - ru.yandex.qatools.ashot - ashot - 1.5.4 - - - - - - - - - src/main/java - - **/*.properties - **/*.xml - - false - - - src/main/resources - true - - static/**/*.woff - static/**/*.woff2 - static/**/*.ttf - static/**/*.ico - - - - src/main/resources - false - - static/**/*.woff - static/**/*.woff2 - static/**/*.ttf - static/**/*.ico - - - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.1.0 - - UTF-8 - - xlsx - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - org.projectlombok - lombok - - - org.springframework.boot - spring-boot-configuration-processor - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - true - - - - maven-clean-plugin - - - - src/main/resources/static - - ** - - false - - - src/main/resources/templates - - ** - - false - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-war-plugin - 2.6 - - - org.mybatis.generator - mybatis-generator-maven-plugin - 1.3.7 - - true - true - - - - mysql - mysql-connector-java - 8.0.28 - - - com.itfsw - mybatis-generator-plugin - 1.3.8 - - - - - - - - - whole - - whole - - - true - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - - main-class-placement - generate-resources - - - - - - - - - - - - - - - - - - - - - - run - - - - - - - - - stage - - stage - - - - - - - pentaho-public - Pentaho Public - https://nexus.pentaho.org/content/groups/omni - - true - always - - - true - always - - - - - diff --git a/backend/src/main/java/io/dataease/commons/license/F2CLicense.java b/backend/src/main/java/io/dataease/commons/license/F2CLicense.java index c2d7b5cb39..5b145233c8 100644 --- a/backend/src/main/java/io/dataease/commons/license/F2CLicense.java +++ b/backend/src/main/java/io/dataease/commons/license/F2CLicense.java @@ -1,5 +1,8 @@ package io.dataease.commons.license; +import lombok.Data; + +@Data public class F2CLicense { private String corporation; @@ -10,61 +13,6 @@ public class F2CLicense { private String edition; private Long count; - public String getCorporation() { - return corporation; - } - - public void setCorporation(String corporation) { - this.corporation = corporation; - } - - public String getExpired() { - return expired; - } - - public void setExpired(String expired) { - this.expired = expired; - } - - public String getLicenseVersion() { - return licenseVersion; - } - - public void setLicenseVersion(String licenseVersion) { - this.licenseVersion = licenseVersion; - } - - public String getProduct() { - return product; - } - - public void setProduct(String product) { - this.product = product; - } - - public Long getGenerateTime() { - return generateTime; - } - - public void setGenerateTime(Long generateTime) { - this.generateTime = generateTime; - } - - public String getEdition() { - return edition; - } - - public void setEdition(String edition) { - this.edition = edition; - } - - public Long getCount() { - return count; - } - - public void setCount(Long count) { - this.count = count; - } - - + private String serialNo; + private String remark; } \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java b/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java index 700e8ce7be..52843a0b7f 100644 --- a/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java +++ b/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java @@ -164,6 +164,9 @@ public class DatasourceController { public ApiDefinition checkApiDatasource(@RequestBody Map data) throws Exception { ApiDefinition apiDefinition = new Gson().fromJson(new String(java.util.Base64.getDecoder().decode(data.get("data"))), new TypeToken() { }.getType()); + if(data.keySet().contains("type") && data.get("type").equals("apiStructure")){ + apiDefinition.setShowApiStructure(true); + } return datasourceService.checkApiDatasource(apiDefinition); } diff --git a/backend/src/main/java/io/dataease/controller/panel/PanelAppTemplateController.java b/backend/src/main/java/io/dataease/controller/panel/PanelAppTemplateController.java index 984d04326d..56d3d7e222 100644 --- a/backend/src/main/java/io/dataease/controller/panel/PanelAppTemplateController.java +++ b/backend/src/main/java/io/dataease/controller/panel/PanelAppTemplateController.java @@ -8,6 +8,7 @@ import io.dataease.service.panel.PanelAppTemplateService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; + import javax.annotation.Resource; import java.util.List; @@ -57,7 +58,14 @@ public class PanelAppTemplateController { @PostMapping("/nameCheck") @I18n public String nameCheck(@RequestBody PanelAppTemplateRequest request) { - return panelAppTemplateService.nameCheck(request); + return panelAppTemplateService.nameCheck(request); + } + + @ApiOperation("移动") + @PostMapping("/move") + @I18n + public void move(@RequestBody PanelAppTemplateRequest request) { + panelAppTemplateService.move(request); } } diff --git a/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinition.java b/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinition.java index b00980d258..b3689548c6 100644 --- a/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinition.java +++ b/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinition.java @@ -23,5 +23,8 @@ public class ApiDefinition { private int previewNum = 10; private int maxPreviewNum = 10; private int serialNumber; + private boolean useJsonPath; + private String jsonPath; + private boolean showApiStructure; } diff --git a/backend/src/main/java/io/dataease/dto/chart/ChartSeniorAssistDTO.java b/backend/src/main/java/io/dataease/dto/chart/ChartSeniorAssistDTO.java index 20b362e863..073f49ed32 100644 --- a/backend/src/main/java/io/dataease/dto/chart/ChartSeniorAssistDTO.java +++ b/backend/src/main/java/io/dataease/dto/chart/ChartSeniorAssistDTO.java @@ -17,4 +17,5 @@ public class ChartSeniorAssistDTO { private String lineType; private String color; private DatasetTableField curField; + private String fontSize; } diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml index 2e572d0578..abb27c3635 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml @@ -124,8 +124,8 @@ and configuration = #{configuration,jdbcType=LONGVARCHAR} - - order by ${sort} + + order by #{sort} diff --git a/backend/src/main/java/io/dataease/listener/DataSourceInitStartListener.java b/backend/src/main/java/io/dataease/listener/DataSourceInitStartListener.java index bc53c1b879..fed96e7708 100644 --- a/backend/src/main/java/io/dataease/listener/DataSourceInitStartListener.java +++ b/backend/src/main/java/io/dataease/listener/DataSourceInitStartListener.java @@ -1,5 +1,6 @@ package io.dataease.listener; +import io.dataease.listener.util.CacheUtils; import io.dataease.service.datasource.DatasourceService; import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.engine.EngineService; @@ -25,7 +26,7 @@ public class DataSourceInitStartListener implements ApplicationListener screenpdf(@RequestBody XpackReportExportRequest request) { + EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); + String url = ServletUtils.domain() + "/#/previewScreenShot/" + request.getPanelId() + "/true"; + byte[] bytes = null; + try { + String currentToken = ServletUtils.getToken(); + Future future = priorityExecutor.submit(() -> { + try { + return emailXpackService.printPdf(url, currentToken, buildPixel(request.getPixel()), request.isShowPageNo()); + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException("预览失败,请联系管理员"); + } + return null; + }, 0); + Object object = future.get(); + if (ObjectUtils.isNotEmpty(object)) { + bytes = (byte[]) object; + if (ArrayUtil.isNotEmpty(bytes)) { + String fileName = request.getPanelId() + ".pdf"; + ByteArrayResource bar = new ByteArrayResource(bytes); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_PDF); + ContentDisposition contentDisposition = ContentDisposition.parse("attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); + headers.setContentDisposition(contentDisposition); + return new ResponseEntity(bar, headers, HttpStatus.OK); + } + } + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException("预览失败,请联系管理员"); + } + + return null; + } + @DeRateLimiter @PostMapping(value = "/screenshot", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE}) public ResponseEntity screenshot(@RequestBody XpackEmailViewRequest request) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java index 5b288b0aa8..79fd7d769e 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java @@ -81,8 +81,17 @@ public class XWecomServer { return wecomXpackService.getQrParam(); } + @GetMapping("/callBackWithoutLogin") + public ModelAndView callBackWithoutLogin(@RequestParam("code") String code,@RequestParam("state") String state) { + return privateCallBack(code, state, true); + } + @GetMapping("/callBack") public ModelAndView callBack(@RequestParam("code") String code, @RequestParam("state") String state) { + return privateCallBack(code, state, false); + } + + private ModelAndView privateCallBack(String code, String state, Boolean withoutLogin) { ModelAndView modelAndView = new ModelAndView("redirect:/"); HttpServletResponse response = ServletUtils.response(); WecomXpackService wecomXpackService = null; @@ -123,6 +132,12 @@ public class XWecomServer { Cookie cookie_token = new Cookie("Authorization", token); cookie_token.setPath("/"); + if (withoutLogin) { + Cookie platformCookie = new Cookie("inOtherPlatform", "true"); + platformCookie.setPath("/"); + response.addCookie(platformCookie); + } + response.addCookie(cookie_token); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java index 5d7218e6d4..c1e5c73141 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java @@ -125,7 +125,6 @@ public class ApiProvider extends Provider { } static public String execHttpRequest(ApiDefinition apiDefinition, int socketTimeout) throws Exception { - String response = ""; HttpClientConfig httpClientConfig = new HttpClientConfig(); httpClientConfig.setSocketTimeout(socketTimeout * 1000); @@ -135,7 +134,6 @@ public class ApiProvider extends Provider { httpClientConfig.addHeader(header.get("name").toString(), header.get("value").toString()); } } - if (apiDefinitionRequest.getAuthManager() != null && StringUtils.isNotBlank(apiDefinitionRequest.getAuthManager().getUsername()) && StringUtils.isNotBlank(apiDefinitionRequest.getAuthManager().getPassword()) @@ -188,27 +186,72 @@ public class ApiProvider extends Provider { throw new Exception("该请求返回数据为空"); } List fields = new ArrayList<>(); - String rootPath; - if (response.startsWith("[")) { - rootPath = "$[*]"; - JSONArray jsonArray = JSONObject.parseArray(response); - for (Object o : jsonArray) { - handleStr(apiDefinition, o.toString(), fields, rootPath); + if (apiDefinition.isUseJsonPath() && !apiDefinition.isShowApiStructure()) { + List currentData = new ArrayList<>(); + Object object = JsonPath.read(response, apiDefinition.getJsonPath()); + if (object instanceof List) { + currentData = (List) object; + } else { + currentData.add((LinkedHashMap) object); } + int i = 0; + for (LinkedHashMap data : currentData) { + if (i >= apiDefinition.getPreviewNum()) { + break; + } + if (i == 0) { + for (Object o : data.keySet()) { + JSONObject field = new JSONObject(); + field.put("originName", o.toString()); + field.put("name", o.toString()); + field.put("type", "STRING"); + field.put("checked", true); + field.put("size", 65535); + field.put("deExtractType", 0); + field.put("deType", 0); + field.put("extField", 0); + fields.add(field); + } + } + for (JSONObject field : fields) { + JSONArray array = field.getJSONArray("value"); + if (array != null) { + array.add(Optional.ofNullable(data.get(field.getString("originName"))).orElse("").toString().replaceAll("\n", " ").replaceAll("\r", " ")); + } else { + array = new JSONArray(); + array.add(Optional.ofNullable(data.get(field.getString("originName"))).orElse("").toString().replaceAll("\n", " ").replaceAll("\r", " ")); + } + field.put("value", array); + } + i++; + } + + apiDefinition.setJsonFields(fields); + return apiDefinition; } else { - rootPath = "$"; - handleStr(apiDefinition, response, fields, rootPath); - } - for (JSONObject field : fields) { - if (field.containsKey("children") && CollectionUtils.isNotEmpty(field.getJSONArray("children"))) { - field.put("disabled", false); + + String rootPath; + if (response.startsWith("[")) { + rootPath = "$[*]"; + JSONArray jsonArray = JSONObject.parseArray(response); + for (Object o : jsonArray) { + handleStr(apiDefinition, o.toString(), fields, rootPath); + } + } else { + rootPath = "$"; + handleStr(apiDefinition, response, fields, rootPath); } - if (field.containsKey("children") && CollectionUtils.isEmpty(field.getJSONArray("children"))) { - field.put("disabled", true); + for (JSONObject field : fields) { + if (field.containsKey("children") && CollectionUtils.isNotEmpty(field.getJSONArray("children"))) { + field.put("disabled", false); + } + if (field.containsKey("children") && CollectionUtils.isEmpty(field.getJSONArray("children"))) { + field.put("disabled", true); + } } + apiDefinition.setJsonFields(fields); + return apiDefinition; } - apiDefinition.setJsonFields(fields); - return apiDefinition; } @@ -362,9 +405,9 @@ public class ApiProvider extends Provider { private List fetchResult(String result, ApiDefinition apiDefinition) { List dataList = new LinkedList<>(); - if (StringUtils.isNotEmpty(apiDefinition.getDataPath()) && CollectionUtils.isEmpty(apiDefinition.getJsonFields())) { + if(apiDefinition.isUseJsonPath()){ List currentData = new ArrayList<>(); - Object object = JsonPath.read(result, apiDefinition.getDataPath()); + Object object = JsonPath.read(result, apiDefinition.getJsonPath()); if (object instanceof List) { currentData = (List) object; } else { @@ -379,30 +422,49 @@ public class ApiProvider extends Provider { } dataList.add(row); } - } else { - List jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList()); - Long maxLength = 0l; - List> columnDataList = new ArrayList<>(); - for (int i = 0; i < jsonPaths.size(); i++) { - List data = new ArrayList<>(); - Object object = JsonPath.read(result, jsonPaths.get(i)); - if (object instanceof List && jsonPaths.get(i).contains("[*]")) { - data = (List) object; + }else { + if (StringUtils.isNotEmpty(apiDefinition.getDataPath()) && CollectionUtils.isEmpty(apiDefinition.getJsonFields())) { + List currentData = new ArrayList<>(); + Object object = JsonPath.read(result, apiDefinition.getDataPath()); + if (object instanceof List) { + currentData = (List) object; } else { - if (object != null) { - data.add(object.toString()); - } + currentData.add((LinkedHashMap) object); } - maxLength = maxLength > data.size() ? maxLength : data.size(); - columnDataList.add(data); - } - for (int i = 0; i < maxLength; i++) { - String[] row = new String[apiDefinition.getFields().size()]; - dataList.add(row); - } - for (int i = 0; i < columnDataList.size(); i++) { - for (int j = 0; j < columnDataList.get(i).size(); j++) { - dataList.get(j)[i] = Optional.ofNullable(String.valueOf(columnDataList.get(i).get(j))).orElse("").replaceAll("\n", " ").replaceAll("\r", " "); + for (LinkedHashMap data : currentData) { + String[] row = new String[apiDefinition.getFields().size()]; + int i = 0; + for (DatasetTableFieldDTO field : apiDefinition.getFields()) { + row[i] = Optional.ofNullable(data.get(field.getOriginName())).orElse("").toString().replaceAll("\n", " ").replaceAll("\r", " "); + i++; + } + dataList.add(row); + } + } else { + List jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList()); + Long maxLength = 0l; + List> columnDataList = new ArrayList<>(); + for (int i = 0; i < jsonPaths.size(); i++) { + List data = new ArrayList<>(); + Object object = JsonPath.read(result, jsonPaths.get(i)); + if (object instanceof List && jsonPaths.get(i).contains("[*]")) { + data = (List) object; + } else { + if (object != null) { + data.add(object.toString()); + } + } + maxLength = maxLength > data.size() ? maxLength : data.size(); + columnDataList.add(data); + } + for (int i = 0; i < maxLength; i++) { + String[] row = new String[apiDefinition.getFields().size()]; + dataList.add(row); + } + for (int i = 0; i < columnDataList.size(); i++) { + for (int j = 0; j < columnDataList.get(i).size(); j++) { + dataList.get(j)[i] = Optional.ofNullable(String.valueOf(columnDataList.get(i).get(j))).orElse("").replaceAll("\n", " ").replaceAll("\r", " "); + } } } } diff --git a/backend/src/main/java/io/dataease/provider/query/impala/ImpalaQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/impala/ImpalaQueryProvider.java index fbdcfb0a8a..6f139c6482 100644 --- a/backend/src/main/java/io/dataease/provider/query/impala/ImpalaQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/impala/ImpalaQueryProvider.java @@ -345,16 +345,6 @@ public class ImpalaQueryProvider extends QueryProvider { return sqlLimit(st.render(), view); } - @Override - public String getSQLWithPage(boolean isTable, String table, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { - String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + pageInfo.getPageSize() + " offset " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() : ""); - if (isTable) { - return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; - } else { - return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; - } - } - private String originalTableInfo(String table, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) { SQLObj tableObj = SQLObj.builder() .tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(ImpalaConstants.KEYWORD_TABLE, table)) @@ -1297,4 +1287,8 @@ public class ImpalaQueryProvider extends QueryProvider { "{\"dateformat\": \"yyyyMMdd HH:mm:ss\"}\n" + "]", Dateformat.class); } + + public String getResultCount(boolean isTable, String sql, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) { + return null; + } } 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 d06d88f47f..2cb580c952 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -444,7 +444,7 @@ public class ChartViewService { fieldMap.put("yAxis", yAxis); fieldMap.put("extStack", extStack); fieldMap.put("extBubble", extBubble); - PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view); + PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view, rowPermissionsTree); String sql = pluginViewSql(pluginViewParam, view); if (StringUtils.isBlank(sql)) { return new ArrayList(); @@ -525,6 +525,9 @@ public class ChartViewService { datasourceRequest.setQuery(qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view)); } } + List xAxisForRequest = new ArrayList<>(); + xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack); + datasourceRequest.setXAxis(xAxisForRequest); data = datasourceProvider.getData(datasourceRequest); } else if (table.getMode() == 1) {// 抽取 datasourceRequest.setDatasource(ds); @@ -905,7 +908,7 @@ public class ChartViewService { fieldMap.put("extBubble", extBubble); fieldMap.put("xAxis", xAxis); fieldMap.put("yAxis", yAxis); - PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view); + PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view, rowPermissionsTree); String sql = pluginViewSql(pluginViewParam, view); if (StringUtils.isBlank(sql)) { return emptyChartViewDTO(view); @@ -1039,6 +1042,9 @@ public class ChartViewService { } datasourceRequest.setQuery(querySql); + List xAxisForRequest = new ArrayList<>(); + xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack); + datasourceRequest.setXAxis(xAxisForRequest); data = datasourceProvider.getData(datasourceRequest); if (CollectionUtils.isNotEmpty(assistFields)) { datasourceAssistRequest.setQuery(assistSQL(datasourceRequest.getQuery(), assistFields)); @@ -1352,7 +1358,7 @@ public class ChartViewService { return dto; } - private PluginViewParam buildPluginParam(Map> fieldMap, List customFilters, List extFilters, Datasource ds, DatasetTable table, ChartViewDTO view) { + private PluginViewParam buildPluginParam(Map> fieldMap, List customFilters, List extFilters, Datasource ds, DatasetTable table, ChartViewDTO view, List rowPermissionsTree) { PluginViewParam pluginViewParam = new PluginViewParam(); PluginViewSetImpl pluginViewSet = BeanUtils.copyBean(new PluginViewSetImpl(), table); pluginViewSet.setDsType(ds.getType()); @@ -1374,6 +1380,7 @@ public class ChartViewService { pluginViewParam.setPluginChartFieldCustomFilters(fieldFilters); pluginViewParam.setPluginChartExtFilters(panelFilters); pluginViewParam.setPluginViewLimit(pluginViewLimit); + pluginViewParam.setRowPermissionsTree(rowPermissionsTree); return pluginViewParam; } diff --git a/backend/src/main/java/io/dataease/service/chart/ViewPluginBaseServiceImpl.java b/backend/src/main/java/io/dataease/service/chart/ViewPluginBaseServiceImpl.java index 5b54376b2c..c77eba238c 100644 --- a/backend/src/main/java/io/dataease/service/chart/ViewPluginBaseServiceImpl.java +++ b/backend/src/main/java/io/dataease/service/chart/ViewPluginBaseServiceImpl.java @@ -15,6 +15,7 @@ import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO; import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO; import io.dataease.plugins.common.dto.sqlObj.SQLObj; import io.dataease.plugins.common.request.chart.ChartExtFilterRequest; +import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO; import io.dataease.plugins.common.util.BeanUtils; import io.dataease.plugins.common.util.ConstantsUtil; import io.dataease.plugins.datasource.query.QueryProvider; @@ -74,9 +75,9 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { String methodName = "transCustomFilterList"; SQLObj sqlObj = BeanUtils.copyBean(SQLObj.builder().build(), pluginViewSQL); List filters = list.stream().map(item -> gson.fromJson(gson.toJson(item), ChartFieldCustomFilterDTO.class)).collect(Collectors.toList()); - Object o ; + Object o; if ((o = execProviderMethod(queryProvider, methodName, sqlObj, filters)) != null) { - return (String)o; + return (String) o; } return null; } @@ -89,30 +90,38 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { List filters = list.stream().map(item -> gson.fromJson(gson.toJson(item), ChartExtFilterRequest.class)).collect(Collectors.toList()); Object o; if ((o = execProviderMethod(queryProvider, methodName, sqlObj, filters)) != null) { - return (String)o; + return (String) o; } return null; } + @Override + public String permissionWhere(String s, List list, PluginViewSQL pluginViewSQL) { + QueryProvider queryProvider = ProviderFactory.getQueryProvider(s); + SQLObj sqlObj = BeanUtils.copyBean(SQLObj.builder().build(), pluginViewSQL); + return queryProvider.transFilterTrees(sqlObj, list); + } + private String sqlFix(String sql) { if (sql.lastIndexOf(";") == (sql.length() - 1)) { sql = sql.substring(0, sql.length() - 1); } return sql; } + @Override public PluginViewSQL getTableObj(PluginViewSet pluginViewSet) { String tableName = null; DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class); if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) { tableName = TableUtils.tableName(pluginViewSet.getTableId()); - }else { + } else { switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) { case DB: tableName = dataTableInfoDTO.getTable(); break; case SQL: - String sql = dataTableInfoDTO.isBase64Encryption()? new String(java.util.Base64.getDecoder().decode(dataTableInfoDTO.getSql())): dataTableInfoDTO.getSql(); + String sql = dataTableInfoDTO.isBase64Encryption() ? new String(java.util.Base64.getDecoder().decode(dataTableInfoDTO.getSql())) : dataTableInfoDTO.getSql(); tableName = dataSetTableService.handleVariableDefaultValue(sql, null, pluginViewSet.getDsType()); tableName = "(" + sqlFix(tableName) + ")"; @@ -139,7 +148,7 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { PluginViewSQL tableObj = PluginViewSQL.builder().tableName(realTableName).tableAlias(tableAlias).build(); QueryProvider queryProvider = ProviderFactory.getQueryProvider(pluginViewSet.getDsType()); SQLObj sqlObj = SQLObj.builder().tableName(realTableName).tableAlias(tableAlias).build(); - PluginViewSetImpl child = (PluginViewSetImpl)pluginViewSet; + PluginViewSetImpl child = (PluginViewSetImpl) pluginViewSet; queryProvider.setSchema(sqlObj, child.getDs()); tableObj.setTableName(sqlObj.getTableName()); tableObj.setTableAlias(sqlObj.getTableAlias()); @@ -149,9 +158,9 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { private String getOriginName(String dsType, PluginViewField pluginViewField, PluginViewSQL tableObj) { String keyword_fix = ConstantsUtil.constantsValue(dsType, "KEYWORD_FIX"); String originField; - String reflectField = reflectFieldName(dsType, pluginViewField); + String reflectField = reflectFieldName(dsType, pluginViewField); if (ObjectUtils.isNotEmpty(pluginViewField.getExtField()) && pluginViewField.getExtField() == 2) { - originField = calcFieldRegex(dsType,pluginViewField.getOriginName(), tableObj); + originField = calcFieldRegex(dsType, pluginViewField.getOriginName(), tableObj); } else if (ObjectUtils.isNotEmpty(pluginViewField.getExtField()) && pluginViewField.getExtField() == 1) { originField = String.format(keyword_fix, tableObj.getTableAlias(), StringUtils.isNotBlank(reflectField) ? reflectField : pluginViewField.getOriginName()); } else { @@ -164,38 +173,37 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { QueryProvider queryProvider = ProviderFactory.getQueryProvider(dsType); String methodName = "calcFieldRegex"; SQLObj sqlObj = BeanUtils.copyBean(SQLObj.builder().build(), pluginViewSQL); - Object o ; + Object o; if ((o = execProviderMethod(queryProvider, methodName, originField, sqlObj)) != null) { - return (String)o; + return (String) o; } return null; } - private String reflectFieldName(String dsType, PluginViewField pluginViewField ) { + private String reflectFieldName(String dsType, PluginViewField pluginViewField) { QueryProvider queryProvider = ProviderFactory.getQueryProvider(dsType); String methodName = "reflectFieldName"; - DatasetTableField field = BeanUtils.copyBean(new DatasetTableField(), pluginViewField);; - Object o ; + DatasetTableField field = BeanUtils.copyBean(new DatasetTableField(), pluginViewField); + Object o; if ((o = execProviderMethod(queryProvider, methodName, field)) != null) { - return (String)o; + return (String) o; } return null; } - private PluginViewSQL getField(String dsType, PluginViewField field, String originField, String fieldAlias) { QueryProvider queryProvider = ProviderFactory.getQueryProvider(dsType); String methodName; if (StringUtils.equals(field.getTypeField(), "xAxis") || StringUtils.equals(field.getTypeField(), "extStack")) { methodName = "getXFields"; - }else { + } else { methodName = "getYFields"; } ChartViewFieldDTO chartViewFieldDTO = BeanUtils.copyBean(new ChartViewFieldDTO(), field); Object execResult; - if ((execResult = execProviderMethod(queryProvider, methodName, chartViewFieldDTO, originField, fieldAlias)) != null){ - SQLObj sqlObj = (SQLObj)execResult; + if ((execResult = execProviderMethod(queryProvider, methodName, chartViewFieldDTO, originField, fieldAlias)) != null) { + SQLObj sqlObj = (SQLObj) execResult; PluginViewSQL result = PluginViewSQL.builder().build(); return BeanUtils.copyBean(result, sqlObj); } @@ -215,27 +223,26 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService { } - - private PluginViewSQL addSort(String sort, String originField, String fieldAlias) { + private PluginViewSQL addSort(String sort, String originField, String fieldAlias) { if (StringUtils.isNotEmpty(sort) && !StringUtils.equalsIgnoreCase(sort, "none")) { return PluginViewSQL.builder().orderField(originField).orderAlias(fieldAlias).orderDirection(sort).build(); } return null; } - private String getWhere(String dsType, PluginViewField field,String originField,String fieldAlias) { + private String getWhere(String dsType, PluginViewField field, String originField, String fieldAlias) { QueryProvider queryProvider = ProviderFactory.getQueryProvider(dsType); String methodName; if (StringUtils.equals(field.getTypeField(), "xAxis") || StringUtils.equals(field.getTypeField(), "extStack")) { return null; - }else { + } else { methodName = "getYWheres"; } ChartViewFieldDTO chartViewFieldDTO = BeanUtils.copyBean(new ChartViewFieldDTO(), field); Object execResult; - if ((execResult = execProviderMethod(queryProvider, methodName, chartViewFieldDTO, originField, fieldAlias)) != null){ - String where = (String)execResult; + if ((execResult = execProviderMethod(queryProvider, methodName, chartViewFieldDTO, originField, fieldAlias)) != null) { + String where = (String) execResult; return where; } return null; 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 c7244f0ed6..344eb45540 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -972,7 +972,11 @@ public class DataSetTableService { return new ArrayList<>(); } DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(id); - return getSqlVariableDetails(type, Arrays.asList(datasetTable)); + if (datasetTable != null) { + return getSqlVariableDetails(type, Arrays.asList(datasetTable)); + } else { + return null; + } } private List getSqlVariableDetails(String type, List datasetTables) { @@ -1086,7 +1090,7 @@ public class DataSetTableService { if (!hasVariables && !tmpSql.contains(SubstitutedParams)) { return tmpSql; } - CCJSqlParserUtil.parse(tmpSql, parser -> parser.withSquareBracketQuotation(true)); + Statement statement = CCJSqlParserUtil.parse(tmpSql); Select select = (Select) statement; @@ -2427,7 +2431,7 @@ public class DataSetTableService { int num = 1; String line; while ((line = reader.readLine()) != null) { - if (num > 100) { + if (num > 1000) { break; } data.add(Arrays.asList(line.split(","))); @@ -2861,7 +2865,8 @@ public class DataSetTableService { hasSubBinaryExpression = false; try { BinaryExpression rightBinaryExpression = (BinaryExpression) expr.getRightExpression(); - hasSubBinaryExpression = rightBinaryExpression instanceof AndExpression || rightBinaryExpression instanceof OrExpression;; + hasSubBinaryExpression = rightBinaryExpression instanceof AndExpression || rightBinaryExpression instanceof OrExpression; + ; } catch (Exception e) { } if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getRightExpression().toString())) { diff --git a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java index b867ebed3c..900c9ef98d 100644 --- a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java +++ b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java @@ -158,11 +158,17 @@ public class DatasourceService { } public List getDatasourceList(DatasourceUnionRequest request) throws Exception { - request.setSort("update_time desc"); List datasourceDTOS = extDataSourceMapper.queryUnion(request); - datasourceDTOS.forEach(datasourceDTO -> { - datasourceTrans(datasourceDTO); - }); + datasourceDTOS.forEach(this::datasourceTrans); + if (StringUtils.isBlank(request.getSort())) { + datasourceDTOS.sort((o1,o2) -> { + int tmp = StringUtils.compareIgnoreCase(o1.getTypeDesc(), o2.getTypeDesc()); + if (tmp == 0) { + tmp = StringUtils.compareIgnoreCase(o1.getName(), o2.getName()); + } + return tmp; + }); + } return datasourceDTOS; } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java b/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java index 51ce96c0a5..fe726d488f 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java @@ -120,6 +120,16 @@ public class PanelAppTemplateService { } + public void move(PanelAppTemplateRequest request) { + if (!CommonConstants.CHECK_RESULT.NONE.equals(nameCheck(CommonConstants.OPT_TYPE.INSERT, request.getName(), request.getPid(), request.getId()))) { + throw new RuntimeException("当前名称在目标分类中已经存在!请选择其他分类或修改名称"); + } + PanelAppTemplateWithBLOBs appTemplate = new PanelAppTemplateWithBLOBs(); + appTemplate.setId(request.getId()); + appTemplate.setPid(request.getPid()); + panelAppTemplateMapper.updateByPrimaryKeySelective(appTemplate); + } + //名称检查 public String nameCheck(String optType, String name, String pid, String id) { PanelAppTemplateExample example = new PanelAppTemplateExample(); diff --git a/backend/src/main/resources/db/migration/V48__1.18.1.sql b/backend/src/main/resources/db/migration/V48__1.18.1.sql index e4c41e6f51..9794167dec 100644 --- a/backend/src/main/resources/db/migration/V48__1.18.1.sql +++ b/backend/src/main/resources/db/migration/V48__1.18.1.sql @@ -1,3 +1,15 @@ UPDATE `my_plugin` SET `version` = '1.18.1' where `plugin_id` > 0 and `version` = '1.18.0'; +<<<<<<< HEAD +======= + +ALTER TABLE `dataset_table_field` + CHANGE COLUMN `origin_name` `origin_name` LONGTEXT BINARY NOT NULL COMMENT '原始字段名' ; + +ALTER TABLE `dataset_table_field` + CHANGE COLUMN `name` `name` LONGTEXT BINARY NOT NULL COMMENT '字段名名' ; + +ALTER TABLE `datasource` + CHANGE COLUMN `name` `name` VARCHAR(50) BINARY NOT NULL COMMENT '数据源名称' ; +>>>>>>> dev diff --git a/backend/src/main/resources/db/migration/V49__1.18.2.sql b/backend/src/main/resources/db/migration/V49__1.18.2.sql new file mode 100644 index 0000000000..5306f8280c --- /dev/null +++ b/backend/src/main/resources/db/migration/V49__1.18.2.sql @@ -0,0 +1,8 @@ +UPDATE `my_plugin` +SET `version` = '1.18.2' +where `plugin_id` > 0 + and `version` = '1.18.1'; + +UPDATE `panel_subject` +SET `details` = '{\"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\":\"e846db60-9619-11ed-b973-39e0420a3eeb\",\"chartInfo\":{\"chartTitle\":{\"show\":true,\"fontSize\":\"18\",\"color\":\"#000000\",\"hPosition\":\"left\",\"vPosition\":\"top\",\"isItalic\":false,\"isBolder\":true,\"remarkShow\":false,\"remark\":\"\",\"remarkBackgroundColor\":\"#ffffffff\",\"fontFamily\":\"Microsoft YaHei\",\"letterSpace\":\"0\",\"fontShadow\":false},\"chartColor\":{\"value\":\"default\",\"colors\":[\"#5470c6\",\"#91cc75\",\"#fac858\",\"#ee6666\",\"#73c0de\",\"#3ba272\",\"#fc8452\",\"#9a60b4\",\"#ea7ccc\"],\"alpha\":100,\"tableHeaderBgColor\":\"#6D9A49\",\"tableItemBgColor\":\"#FFFFFF\",\"tableHeaderFontColor\":\"#000000\",\"tableFontColor\":\"#000000\",\"tableStripe\":true,\"dimensionColor\":\"#000000\",\"quotaColor\":\"#5470c6\",\"tableBorderColor\":\"#E6E7E4\",\"seriesColors\":[],\"areaBorderColor\":\"#303133\",\"gradient\":false,\"areaBaseColor\":\"#FFFFFF\",\"tableScrollBarColor\":\"rgba(0, 0, 0, 0.15)\",\"tableScrollBarHoverColor\":\"rgba(0, 0, 0, 0.4)\"},\"chartCommonStyle\":{\"backgroundColorSelect\":true,\"color\":\"#FFFFFF\",\"alpha\":100,\"borderRadius\":5,\"innerPadding\":0,\"enable\":false,\"innerImageColor\":\"#1E90FF\",\"backgroundType\":\"outerImage\",\"outerImage\":null},\"filterStyle\":{\"horizontal\":\"left\",\"vertical\":\"top\",\"color\":\"#000000\",\"brColor\":\"\",\"wordColor\":\"\",\"innerBgColor\":\"\"},\"tabStyle\":{\"headFontColor\":\"#OOOOOO\",\"headFontActiveColor\":\"#OOOOOO\",\"headBorderColor\":\"#OOOOOO\",\"headBorderActiveColor\":\"#OOOOOO\",\"headPosition\":\"left\"}}}' +WHERE `id` = 'system_1'; diff --git a/frontend/package.json b/frontend/package.json index dbcfebf69f..f312476501 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "dataease", - "version": "1.18.1", + "version": "1.18.2", "description": "dataease front", "private": true, "scripts": { @@ -51,6 +51,7 @@ "jquery": "^3.1.1", "js-base64": "^3.7.2", "js-cookie": "2.2.0", + "js-pinyin": "^0.1.9", "jsencrypt": "^3.0.0-rc.1", "jspdf": "^2.3.1", "jszip": "^3.10.1", diff --git a/frontend/pom.xml b/frontend/pom.xml index e8c6c35f1d..d49c6b1aa2 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -6,7 +6,7 @@ dataease-server io.dataease - 1.18.1 + 1.18.2 4.0.0 diff --git a/frontend/src/api/system/appTemplate.js b/frontend/src/api/system/appTemplate.js index 6e11252b57..653c5ef6bd 100644 --- a/frontend/src/api/system/appTemplate.js +++ b/frontend/src/api/system/appTemplate.js @@ -56,3 +56,11 @@ export function nameCheck(data) { method: 'post' }) } + +export function move(data) { + return request({ + url: '/appTemplate/move', + data: data, + method: 'post' + }) +} diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 57e03c64c3..587b472952 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -116,6 +116,13 @@ export function wecomStatus() { }) } +export function wecomQrParams() { + return request({ + url: '/plugin/wecom/getQrParam', + method: 'post' + }) +} + export function dingtalkStatus() { return request({ url: '/api/auth/isOpenDingtalk', diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue index 797273c3f3..959a1379aa 100644 --- a/frontend/src/components/canvas/DeCanvas.vue +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -297,6 +297,9 @@ export default { // this.$emit('handleDrop', e) // } handleDrop(e) { + if (!this.dragComponentInfo) { + return + } this.dragComponentInfo.moveStatus = 'drop' // 记录拖拽信息 this.dropComponentInfo = deepCopy(this.dragComponentInfo) diff --git a/frontend/src/components/canvas/components/TextAttr.vue b/frontend/src/components/canvas/components/TextAttr.vue index 5b42a930bd..59a66cf145 100644 --- a/frontend/src/components/canvas/components/TextAttr.vue +++ b/frontend/src/components/canvas/components/TextAttr.vue @@ -24,7 +24,7 @@ > - + @@ -47,7 +47,7 @@ :value="item.value" > - + {{ item.label }} @@ -257,7 +257,7 @@ @click="goColor" /> -
+
-
+
-
+
- +
@@ -327,7 +327,7 @@ style="width: 20px;float: left;margin-top: 2px;margin-left: 2px;" > - +
@@ -336,7 +336,7 @@ style="width: 20px;float: left;margin-top: 2px;margin-left: 2px;" > - +
- +
@@ -616,7 +616,7 @@ export default { mainStyle() { const style = { - left: (this.getPositionX(this.curComponent.style.left) - this.scrollLeft) + 'px', + left: (this.getPositionX(this.curComponent.style.left) - this.scrollLeft - 10) + 'px', top: (this.getPositionY(this.curComponent.style.top) - this.scrollTop + 20) + 'px' } return style diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 2900b4b022..b2138a1d57 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -153,6 +153,30 @@ @change="styleChange" /> + + + + + + + + {{ $t('panel.export_pdf_page') }} + + + + @@ -247,6 +271,7 @@ export default { }, data() { return { + showPageLine: false, showGridSwitch: false, mobileLayoutInitStatus: false, isShowPreview: false, @@ -305,6 +330,7 @@ export default { this.scale = this.canvasStyleData.scale this.mobileLayoutInitStatus = this.mobileLayoutStatus this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + this.showPageLine = this.canvasStyleData.pdfPageLine?.showPageLine this.autoCache() }, beforeDestroy() { @@ -323,6 +349,7 @@ export default { }, editPanelInit() { this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + this.showPageLine = this.canvasStyleData.pdfPageLine?.showPageLine }, close() { // 关闭页面清理缓存 @@ -589,6 +616,10 @@ export default { this.$store.commit('canvasChange') this.canvasStyleData.aidedDesign.showGrid = !this.canvasStyleData.aidedDesign.showGrid }, + showPageLineChange() { + this.$store.commit('canvasChange') + this.canvasStyleData.pdfPageLine.showPageLine = !this.canvasStyleData.pdfPageLine.showPageLine + }, // batch option batchOption() { bus.$emit('change_panel_right_draw', !this.batchOptStatus) diff --git a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue index bba9a44403..feb5095084 100644 --- a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue @@ -204,7 +204,7 @@ export default { return style }, componentActiveFlag() { - return !this.mobileLayoutStatus && ((this.curComponent && this.config.id === this.curComponent.id && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing')) + return (!this.mobileLayoutStatus || this.terminal === 'mobile') && ((this.curComponent && this.config.id === this.curComponent.id && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing')) }, scale() { return Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) @@ -279,7 +279,7 @@ export default { } else { return { ... - getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), + getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), position: 'relative' } } diff --git a/frontend/src/components/canvas/components/editor/DeEditor.vue b/frontend/src/components/canvas/components/editor/DeEditor.vue index 31234920ae..8f2eeff20e 100644 --- a/frontend/src/components/canvas/components/editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/editor/DeEditor.vue @@ -12,6 +12,11 @@ @mousedown="handleMouseDown" @scroll="canvasScroll" > + { + const top = this.getShapeStyleIntDeDrag(item.style, 'top') + const height = this.getShapeStyleIntDeDrag(item.style, 'height') + baseHeight = Math.max(baseHeight, top + height) + }) + return baseHeight + }, customStyle() { let style = { width: '100%', @@ -1024,6 +1046,19 @@ export default { }, deep: true }, + scrollHeight: { + handler(newVal, oldVla) { + this.$nextTick(() => { + if (newVal !== oldVla && this.showPageLine) { + const lineRef = this.$refs['main-page-line'] + if (lineRef?.init) { + lineRef.init(newVal) + } + } + }) + }, + deep: true + }, outStyle: { handler(newVal, oldVla) { this.resizeParentBoundsRef() @@ -1251,6 +1286,9 @@ export default { }, changeStyleWithScale, handleMouseDown(e) { + if (this.isPageLineTarget(e)) { + return + } // 如果没有选中组件 在画布上点击时需要调用 e.preventDefault() 防止触发 drop 事件 if (!this.curComponent || (this.curComponent.component !== 'v-text' && this.curComponent.component !== 'rect-shape')) { e.preventDefault() @@ -1259,6 +1297,9 @@ export default { // 挤占式画布设计 this.containerMouseDown(e) }, + isPageLineTarget(e) { + return e.target.classList && [...e.target.classList].includes('page-line-item') + }, hideArea() { this.isShowArea = 0 @@ -1517,6 +1558,9 @@ export default { } }, handleDragOver(e) { + if (!this.dragComponentInfo?.shadowStyle) { + return + } this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth diff --git a/frontend/src/components/canvas/components/editor/FieldsList.vue b/frontend/src/components/canvas/components/editor/FieldsList.vue index 06c2513694..9135f9aa45 100644 --- a/frontend/src/components/canvas/components/editor/FieldsList.vue +++ b/frontend/src/components/canvas/components/editor/FieldsList.vue @@ -1,5 +1,5 @@ + + diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 47955dbe3f..3a12ce4475 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -165,12 +165,12 @@ v-show=" show &&showIndex===1" :canvas-id="canvasId" /> - - + +
- + - + {{ panelInfo.name }} @@ -205,7 +205,7 @@ class="this_mobile_canvas_main" :style="mobileCanvasStyle" > - + - +
- + @@ -268,7 +268,7 @@ />
- +
@@ -287,7 +287,7 @@ >{{ $t('panel.position_adjust') }} - +
diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index 846602157d..ac77d2d6ab 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -117,7 +117,7 @@ @change="checkedViewsChange" > item.tableId) || [] + + const views = this.childViews.viewInfos.filter(view => tableIdList.includes(view.tableId)) + return views } }, watch: { diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js index d9d4c94fff..84dd3c7b52 100644 --- a/frontend/src/views/panel/panel.js +++ b/frontend/src/views/panel/panel.js @@ -69,6 +69,10 @@ export const CANVAS_STYLE = { showGrid: false, matrixBase: 4 // 当前matrix的基数 (是pcMatrixCount的几倍) }, // 辅助设计 + pdfPageLine: { + showPageLine: false, + proportion: null + }, refreshViewEnable: true, // 开启视图刷新(默认开启) refreshViewLoading: true, // 仪表板视图loading提示 refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟 @@ -82,6 +86,11 @@ export const AIDED_DESIGN = { matrixBase: 1 // 当前matrix的基数 (是pcMatrixCount的几倍) } +export const PAGE_LINE_DESIGN = { + showPageLine: false, + proportion: null +} + export const DEFAULT_COMMON_CANVAS_STYLE_STRING = { ...CANVAS_STYLE } diff --git a/frontend/src/views/panel/template/component/TemplateList.vue b/frontend/src/views/panel/template/component/TemplateList.vue index b52312dde6..01786f8645 100644 --- a/frontend/src/views/panel/template/component/TemplateList.vue +++ b/frontend/src/views/panel/template/component/TemplateList.vue @@ -253,8 +253,8 @@ export default { } li.select { - background: var(--deWhiteHover, #3370ff); - color: var(--TextActive, #f4f4f5); + background: var(--deWhiteHover, #e0eaff) !important; + color: var(--TextActive, #3370ff) !important; } .de-btn-fix { diff --git a/frontend/src/views/system/about/index.vue b/frontend/src/views/system/about/index.vue index 68cca784c8..972a41aed9 100644 --- a/frontend/src/views/system/about/index.vue +++ b/frontend/src/views/system/about/index.vue @@ -1,6 +1,9 @@