Pārlūkot izejas kodu

Merge remote-tracking branch 'refs/remotes/origin/dev'

Devli 11 mēneši atpakaļ
vecāks
revīzija
1c7730ea74
26 mainītis faili ar 618 papildinājumiem un 358 dzēšanām
  1. 1 1
      build.sh
  2. BIN
      report-core/lib/dm8/DmJdbcDriver18-8.1.3.140.jar
  3. BIN
      report-core/lib/kingbase/kingbase8-8.6.0.jar
  4. BIN
      report-core/lib/opengauss/opengauss-jdbc-6.0.0-RC1.jar
  5. BIN
      report-core/lib/postgresql/postgresql-42.2.18.jar
  6. BIN
      report-core/lib/postgresql/postgresql-9.4.1212.jre7.jar
  7. 20 0
      report-core/src/main/assembly/assembly.xml
  8. 7 5
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/datasetparam/service/impl/DataSetParamServiceImpl.java
  9. 6 0
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/datasource/service/impl/DataSourceServiceImpl.java
  10. 6 2
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/controller/GaeaDictController.java
  11. 1 6
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/service/GaeaDictService.java
  12. 58 54
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/service/impl/GaeaDictServiceImpl.java
  13. 8 7
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/controller/ReportExcelController.java
  14. 7 2
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/ReportExcelService.java
  15. 202 161
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java
  16. 4 3
      report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/util/XlsSheetUtil.java
  17. 3 2
      report-core/src/main/java/com/anjiplus/template/gaea/business/util/JdbcConstants.java
  18. 22 0
      report-core/src/main/resources/db/migration/V1.4.2__update.sql
  19. 1 1
      report-core/src/main/resources/mapper/ReportExcelMapper.xml
  20. 15 1
      report-ui/src/api/GaeaReport.js
  21. 183 91
      report-ui/src/views/bigscreenDesigner/designer/tools/configure/texts/widget-table.js
  22. 9 4
      report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue
  23. 29 1
      report-ui/src/views/bigscreenDesigner/viewer/index.vue
  24. 4 10
      report-ui/src/views/excelreport/designer/index.vue
  25. 32 7
      report-ui/src/views/excelreport/viewer/index.vue
  26. 0 0
      report-ui/static/luckysheet/luckysheet.umd.js

+ 1 - 1
build.sh

@@ -16,7 +16,7 @@ echo "npm run build"
 npm run build:prod
 
 echo "publish web to springboot src/main/resources/static"
-
+rm -rf $BuildDir/report-core/src/main/resources/static
 mkdir -p $BuildDir/report-core/src/main/resources/static
 mv $BuildDir/report-ui/dist/* $BuildDir/report-core/src/main/resources/static/
 

BIN
report-core/lib/dm8/DmJdbcDriver18-8.1.3.140.jar


BIN
report-core/lib/kingbase/kingbase8-8.6.0.jar


BIN
report-core/lib/opengauss/opengauss-jdbc-6.0.0-RC1.jar


BIN
report-core/lib/postgresql/postgresql-42.2.18.jar


BIN
report-core/lib/postgresql/postgresql-9.4.1212.jre7.jar


+ 20 - 0
report-core/src/main/assembly/assembly.xml

@@ -26,6 +26,26 @@
 			<outputDirectory>lib</outputDirectory>
 			<fileMode>0755</fileMode>
 		</fileSet>
+		<fileSet>
+			<directory>lib/postgresql</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
+		<fileSet>
+			<directory>lib/dm8</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
+		<fileSet>
+			<directory>lib/opengauss</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
+		<fileSet>
+			<directory>lib/kingbase</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
 		<fileSet>
 			<directory>src/main/assembly/bin</directory>
 			<outputDirectory>bin</outputDirectory>

+ 7 - 5
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/datasetparam/service/impl/DataSetParamServiceImpl.java

@@ -33,11 +33,13 @@ import java.util.Set;
 @Slf4j
 public class DataSetParamServiceImpl implements DataSetParamService {
     static final Set<String> blackList = Sets.newHashSet("java.lang.ProcessBuilder", "java.lang.Runtime", "java.lang.ProcessImpl");
-
-    private ScriptEngine engine;
-    {
+    private static final ThreadLocal<ScriptEngine> engineHolder = ThreadLocal.withInitial(() -> {
         NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
-        engine = factory.getScriptEngine(clz -> !blackList.contains(clz));
+        ScriptEngine engine = factory.getScriptEngine(clz -> !blackList.contains(clz));
+        return engine;
+    });
+    public static ScriptEngine getEngine() {
+        return engineHolder.get();
     }
 
     @Autowired
@@ -96,10 +98,10 @@ public class DataSetParamServiceImpl implements DataSetParamService {
      */
     @Override
     public Object verification(DataSetParamDto dataSetParamDto) {
-
         String validationRules = dataSetParamDto.getValidationRules();
         if (StringUtils.isNotBlank(validationRules)) {
             try {
+                ScriptEngine engine = getEngine();
                 engine.eval(validationRules);
                 if(engine instanceof Invocable){
                     Invocable invocable = (Invocable) engine;

+ 6 - 0
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/datasource/service/impl/DataSourceServiceImpl.java

@@ -101,6 +101,9 @@ public class DataSourceServiceImpl implements DataSourceService {
             case JdbcConstants.SQL_SERVER:
             case JdbcConstants.JDBC:
             case JdbcConstants.POSTGRESQL:
+            case JdbcConstants.DAMENG:
+            case JdbcConstants.OPENGAUSS:
+            case JdbcConstants.KINGBASE:
                 testRelationalDb(dto);
                 break;
             case JdbcConstants.HTTP:
@@ -126,6 +129,9 @@ public class DataSourceServiceImpl implements DataSourceService {
             case JdbcConstants.SQL_SERVER:
             case JdbcConstants.JDBC:
             case JdbcConstants.POSTGRESQL:
+            case JdbcConstants.DAMENG:
+            case JdbcConstants.OPENGAUSS:
+            case JdbcConstants.KINGBASE:
                 return executeRelationalDb(dto);
             case JdbcConstants.HTTP:
                 return executeHttp(dto);

+ 6 - 2
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/controller/GaeaDictController.java

@@ -57,8 +57,12 @@ public class GaeaDictController extends GaeaBaseController<GaeaDictParam, GaeaDi
     @PostMapping("/freshDict")
     @Permission(code = "fresh",name = "刷新")
     public ResponseBean refreshDict(@RequestBody List<String> dictCodes) {
+        //语言
+        Locale locale = LocaleContextHolder.getLocale();
+        String language = locale.getLanguage();
+
         //刷新
-        gaeaDictService.refreshCache(dictCodes);
+        gaeaDictService.refreshCache(dictCodes, language);
         return responseSuccess();
     }
 
@@ -69,8 +73,8 @@ public class GaeaDictController extends GaeaBaseController<GaeaDictParam, GaeaDi
     @GetMapping("/select/{dictCode}")
     @Permission(code = "query",name = "下拉")
     public ResponseBean select(@PathVariable("dictCode") String dictName){
-        Locale locale = LocaleContextHolder.getLocale();
         //语言
+        Locale locale = LocaleContextHolder.getLocale();
         String language = locale.getLanguage();
 
         List<KeyValue> keyValues = gaeaDictService.select(dictName,language);

+ 1 - 6
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/service/GaeaDictService.java

@@ -22,7 +22,7 @@ public interface GaeaDictService extends GaeaBaseService<GaeaDictParam, GaeaDict
      * 刷新全部缓存
      * @param dictCodes
      */
-    void refreshCache(List<String> dictCodes);
+    void refreshCache(List<String> dictCodes, String language);
 
 
     /**
@@ -33,11 +33,6 @@ public interface GaeaDictService extends GaeaBaseService<GaeaDictParam, GaeaDict
      */
     List<KeyValue> select(String dictCode, String language);
 
-    /**
-     * 获取所有字典项
-     * @return
-     */
-    List<GaeaDictItem> findItems(List<String> dictCodes);
     /**
      * 获取所有 typecode
      * @param system

+ 58 - 54
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/service/impl/GaeaDictServiceImpl.java

@@ -1,5 +1,7 @@
 package com.anjiplus.template.gaea.business.modules.dict.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.anji.plus.gaea.bean.KeyValue;
 import com.anji.plus.gaea.cache.CacheHelper;
 import com.anji.plus.gaea.constant.Enabled;
@@ -50,22 +52,20 @@ public class GaeaDictServiceImpl implements GaeaDictService {
      * @param dictCodes
      */
     @Override
-    public void refreshCache(List<String> dictCodes) {
-
-        //查询指定字典项
-        List<GaeaDictItem> gaeaDictItems = findItems(dictCodes);
-
-        //对数据字典项进行分组,分组key=语言标识:字典编码
-        Map<String, Map<String, String>> dictItemMap = gaeaDictItems.stream()
-                .collect(Collectors
-                        .groupingBy(item -> item.getLocale() + GaeaConstant.REDIS_SPLIT +item.getDictCode(),
-                                Collectors.toMap(GaeaDictItem::getItemValue, GaeaDictItem::getItemName,(v1,v2)-> v2)));
+    public void refreshCache(List<String> dictCodes, String language) {
+        // 查询指定字典项
+        List<GaeaDictItem> gaeaDictItems = findItems(dictCodes, language);
+        // 对数据字典项进行分组,分组key=语言标识:字典编码
+        Map<String, List<GaeaDictItem>> dictItemMap = gaeaDictItems.stream().collect(
+                Collectors.groupingBy(item -> item.getLocale() + GaeaConstant.REDIS_SPLIT +item.getDictCode(), Collectors.toList())
+        );
 
         //遍历并保持到Redis中
         dictItemMap.entrySet().stream().forEach(entry -> {
             String key = GaeaKeyConstant.DICT_PREFIX  + entry.getKey();
-            cacheHelper.delete(key);
-            cacheHelper.hashSet(key, entry.getValue());
+            List<GaeaDictItem> dictItems = entry.getValue();
+            // 转换成KeyValue后缓存
+            List<KeyValue> keyValues = convertToKeyValueAndCache(dictItems, key);
         });
     }
 
@@ -78,59 +78,63 @@ public class GaeaDictServiceImpl implements GaeaDictService {
      */
     @Override
     public List<KeyValue> select(String dictCode, String language) {
-
-        //缓存字典Key
+        // 先看缓存中是否存在
         String dictKey = GaeaKeyConstant.DICT_PREFIX  + language + GaeaConstant.REDIS_SPLIT + dictCode;
-
-        Map<String, String> dictMap = cacheHelper.hashGet(dictKey);
-
-        //当查询的字典为空时
-        if (CollectionUtils.isEmpty(dictMap)) {
-            LambdaQueryWrapper<GaeaDictItem> wrapper = Wrappers.lambdaQuery();
-            wrapper.eq(GaeaDictItem::getDictCode, dictCode)
-                    .eq(GaeaDictItem::getEnabled, Enabled.YES.getValue())
-                    .eq(GaeaDictItem::getLocale, language)
-                    .orderByAsc(GaeaDictItem::getSort);
-
-            List<GaeaDictItem> list = gaeaDictItemMapper.selectList(wrapper);
-
-            List<KeyValue> keyValues = list.stream()
-                    .map(dictItemEntity -> new KeyValue(dictItemEntity.getItemValue(), dictItemEntity.getItemName(), dictItemEntity.getItemExtend()))
-                    .collect(Collectors.toList());
-            //当缓存不存在时,刷新缓存
-            List<String> dictCodes = new ArrayList<>();
-            dictCodes.add(dictCode);
-            refreshCache(dictCodes);
+        String keyValueListStr = cacheHelper.stringGet(dictKey);
+        if(StringUtils.isNoneBlank(keyValueListStr)){
+            List<KeyValue> keyValues = JSONArray.parseArray(keyValueListStr, KeyValue.class);
             return keyValues;
         }
 
-        List<KeyValue> keyValues = GaeaUtils.formatKeyValue(dictMap);
-
-        //添加扩展字段
-        LambdaQueryWrapper<GaeaDictItem> gaeaDictItemWrapper = Wrappers.lambdaQuery();
-        gaeaDictItemWrapper.eq(GaeaDictItem::getDictCode, dictCode);
-        gaeaDictItemWrapper.isNotNull(GaeaDictItem::getItemExtend);
-
-        Map<String, String> extendMap = gaeaDictItemMapper.selectList(gaeaDictItemWrapper).stream()
-                .filter(gaeaDictItem -> StringUtils.isNotBlank(gaeaDictItem.getItemExtend()))
-                .collect(Collectors.toMap(GaeaDictItem::getItemValue, GaeaDictItem::getItemExtend, (v1, v2) -> v2));
-        if (!CollectionUtils.isEmpty(extendMap)) {
-            keyValues.stream().forEach(keyValue -> keyValue.setExtend(extendMap.get(keyValue.getId())));
-        }
+        // 缓存中没有,从数据库中查询
+        List<String> dictCodes = new ArrayList<>();
+        dictCodes.add(dictCode);
+        List<GaeaDictItem> list = findItems(dictCodes, language);
+        List<KeyValue> keyValues = convertToKeyValueAndCache(list, dictKey);
         return keyValues;
     }
 
-    @Override
-    public List<GaeaDictItem> findItems(List<String> dictCodes) {
-
-        LambdaQueryWrapper<GaeaDictItem> gaeaDictItemQueryWrapper = Wrappers.lambdaQuery();
-        gaeaDictItemQueryWrapper.eq(GaeaDictItem::getEnabled, Enabled.YES.getValue());
+    private List<GaeaDictItem> findItems(List<String> dictCodes, String language) {
+        LambdaQueryWrapper<GaeaDictItem> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(GaeaDictItem::getEnabled, Enabled.YES.getValue())
+                .eq(GaeaDictItem::getLocale, language);
         if (!CollectionUtils.isEmpty(dictCodes)) {
-            gaeaDictItemQueryWrapper.in(GaeaDictItem::getDictCode, dictCodes);
+            wrapper.in(GaeaDictItem::getDictCode, dictCodes);
         }
-        return gaeaDictItemMapper.selectList(gaeaDictItemQueryWrapper);
+        wrapper.orderByAsc(GaeaDictItem::getSort);
+
+        List<GaeaDictItem> list = gaeaDictItemMapper.selectList(wrapper);
+        return list;
     }
 
+    /**
+     * 将一个字典的所有项,转换成KeyValue并缓存
+     * @param list
+     * @return
+     *
+     * @author Devli
+     * @date 2024-07-17 16:15:11.902
+     */
+    private List<KeyValue> convertToKeyValueAndCache(List<GaeaDictItem> list, String cacheKey){
+        // 入参数校验
+        List<KeyValue> keyValues = new ArrayList<>();
+        if(CollectionUtils.isEmpty(list)){
+            return keyValues;
+        }
+
+        // 数据类型转换
+        keyValues = list.stream()
+                .map(dictItemEntity -> new KeyValue(dictItemEntity.getItemValue(), dictItemEntity.getItemName(), dictItemEntity.getItemExtend()))
+                .collect(Collectors.toList());
+
+        // 缓存
+        if(StringUtils.isNoneBlank(cacheKey)){
+            String cacheValue = JSONArray.toJSONString(keyValues);
+            cacheHelper.delete(cacheKey);
+            cacheHelper.stringSet(cacheKey, cacheValue);
+        }
+        return keyValues;
+    }
 
     @Override
     public Collection<KeyValue> selectTypeCode(String system, String language) {

+ 8 - 7
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/controller/ReportExcelController.java

@@ -14,9 +14,14 @@ import com.anjiplus.template.gaea.business.modules.reportshare.controller.dto.Re
 import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
 /**
  * @author chenkening
  * @date 2021/4/13 15:12
@@ -64,15 +69,11 @@ public class ReportExcelController extends GaeaBaseController<ReportExcelParam,
         return ResponseBean.builder().data(result).build();
     }
 
-
     @PostMapping("/exportExcel")
+    @GaeaAuditLog(pageTitle = "excel导出")
     @Permission(code = "export", name = "导出")
-    @GaeaAuditLog(pageTitle = "报表导出")
-    public ResponseBean exportExcel(@RequestBody ReportExcelDto reportExcelDto) {
-
-        return ResponseBean.builder().code(ResponseCode.SUCCESS_CODE)
-                .data(reportExcelService.exportExcel(reportExcelDto))
-                .message("导出成功,请稍后在文件管理中查看").build();
+    public ResponseEntity<byte[]> export(HttpServletRequest request, HttpServletResponse response, @RequestBody ReportExcelDto reportExcelDto) throws IOException {
+        return reportExcelService.exportExcel(request, response, reportExcelDto);
     }
 
 //    @PostMapping("/exportPdf")

+ 7 - 2
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/ReportExcelService.java

@@ -5,6 +5,11 @@ import com.anji.plus.gaea.curd.service.GaeaBaseService;
 import com.anjiplus.template.gaea.business.modules.reportexcel.controller.dto.ReportExcelDto;
 import com.anjiplus.template.gaea.business.modules.reportexcel.controller.param.ReportExcelParam;
 import com.anjiplus.template.gaea.business.modules.reportexcel.dao.entity.ReportExcel;
+import org.springframework.http.ResponseEntity;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 /**
  * TODO
@@ -30,14 +35,14 @@ public interface ReportExcelService extends GaeaBaseService<ReportExcelParam, Re
      */
     ReportExcelDto preview(ReportExcelDto reportExcelDto);
 
-
     /**
      * 导出为excel
      *
      * @param reportExcelDto
      * @return
      */
-    Boolean exportExcel(ReportExcelDto reportExcelDto);
+
+    ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,ReportExcelDto reportExcelDto) throws IOException;
 
 //    Boolean exportPdf(ReportExcelDto reportExcelDto);
 }

+ 202 - 161
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java

@@ -16,6 +16,7 @@ import com.anjiplus.template.gaea.business.modules.dataset.controller.dto.DataSe
 import com.anjiplus.template.gaea.business.modules.dataset.controller.dto.OriginalDataDto;
 import com.anjiplus.template.gaea.business.modules.dataset.service.DataSetService;
 import com.anjiplus.template.gaea.business.modules.file.service.GaeaFileService;
+import com.anjiplus.template.gaea.business.modules.file.util.FileUtils;
 import com.anjiplus.template.gaea.business.modules.report.dao.ReportMapper;
 import com.anjiplus.template.gaea.business.modules.report.dao.entity.Report;
 import com.anjiplus.template.gaea.business.modules.reportexcel.controller.dto.ReportExcelDto;
@@ -32,6 +33,7 @@ import com.itextpdf.text.pdf.PdfPCell;
 import com.itextpdf.text.pdf.PdfPTable;
 import com.itextpdf.text.pdf.PdfWriter;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.openxml4j.util.ZipSecureFile;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -42,8 +44,12 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -145,21 +151,71 @@ public class ReportExcelServiceImpl implements ReportExcelService {
         return reportExcelDto;
     }
 
+    /**
+     * Excel导出
+     *
+     * @param request
+     * @param response
+     * @param reportExcelDto
+     * @return
+     * @throws IOException
+     */
     @Override
-    public Boolean exportExcel(ReportExcelDto reportExcelDto) {
-        logger.error("导出...");
-        exportExcelCore(reportExcelDto);
-        return true;
+    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response, ReportExcelDto reportExcelDto) throws IOException {
+        String userAgent = request.getHeader("User-Agent");
+        boolean isIeBrowser = userAgent.indexOf("MSIE") > 0;
+
+        String reportCode = reportExcelDto.getReportCode();
+        String exportType = reportExcelDto.getExportType();
+        List<List<ReportExcelStyleDto>> reportExcelStyleList = new ArrayList<>();
+        JSONObject rowData = JSON.parseObject(reportExcelDto.getRowDatas());
+        // 将JSONObject对象转换为列表
+        List<Integer> dataNumList = rowData.keySet().stream().map(Integer::parseInt).sorted().collect(Collectors.toList());
+        for (Integer i : dataNumList) {
+            JSONArray jsonArray = rowData.getJSONArray(i.toString());
+            List<ReportExcelStyleDto> reportExcelStyleDtos = jsonArray.toJavaList(ReportExcelStyleDto.class);
+            reportExcelStyleList.add(reportExcelStyleDtos);
+        }
+        ReportExcelDto report = detailByReportCode(reportCode);
+        reportExcelDto.setJsonStr(report.getJsonStr());
+        String jsonStr = analysisReportData(reportExcelDto);
+        List<JSONObject> lists = (List<JSONObject>) JSON.parse(jsonStr);
+        OutputStream out = null;
+        File file = null;
+        File pdfFile = null;
+
+        String fileName = report.getReportCode();
+        File dir = new File(dictPath + ZIP_PATH);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        String filePath = dir.getAbsolutePath() + File.separator + fileName + ".xlsx";
+        file = new File(filePath);
+        out = Files.newOutputStream(Paths.get(filePath));
+        XlsUtil.exportXlsFile(out, true, lists);
+
+        ResponseEntity.BodyBuilder builder = ResponseEntity.ok();
+        builder.contentLength(file.length());
+        //application/octet-stream 二进制数据流(最常见的文件下载)
+        builder.contentType(MediaType.APPLICATION_OCTET_STREAM);
+        if (isIeBrowser) {
+            builder.header("Content-Disposition", "attachment; filename=" + reportCode + ".xlsx");
+        } else {
+            builder.header("Content-Disposition", "attacher; filename*=UTF-8''" + reportCode + ".xlsx");
+        }
+        ResponseEntity<byte[]> body = builder.body(FileUtils.readFileToByteArray(file));
+
+        return body;
     }
+
     /**
      * 抽取导出Excel核心逻辑
      */
-    public void exportExcelCore(ReportExcelDto reportExcelDto)
-    {
+    public void exportExcelCore(ReportExcelDto reportExcelDto) {
         String reportCode = reportExcelDto.getReportCode();
         String exportType = reportExcelDto.getExportType();
         List<List<ReportExcelStyleDto>> reportExcelStyleList = new ArrayList<>();
-        JSONObject rowData= JSON.parseObject(reportExcelDto.getRowDatas());
+        JSONObject rowData = JSON.parseObject(reportExcelDto.getRowDatas());
         // 将JSONObject对象转换为列表
         List<Integer> dataNumList = rowData.keySet().stream().map(Integer::parseInt).sorted().collect(Collectors.toList());
         for (Integer i : dataNumList) {
@@ -170,14 +226,14 @@ public class ReportExcelServiceImpl implements ReportExcelService {
         ReportExcelDto report = detailByReportCode(reportCode);
         reportExcelDto.setJsonStr(report.getJsonStr());
         String jsonStr = analysisReportData(reportExcelDto);
-        List<JSONObject> lists=(List<JSONObject> ) JSON.parse(jsonStr);
+        List<JSONObject> lists = (List<JSONObject>) JSON.parse(jsonStr);
         OutputStream out = null;
         File file = null;
         File pdfFile = null;
         try {
             String fileName = report.getReportCode();
             File dir = new File(dictPath + ZIP_PATH);
-            if (!dir.exists()){
+            if (!dir.exists()) {
                 dir.mkdirs();
             }
             String filePath = dir.getAbsolutePath() + File.separator + fileName + ".xlsx";
@@ -186,24 +242,21 @@ public class ReportExcelServiceImpl implements ReportExcelService {
             XlsUtil.exportXlsFile(out, true, lists);
             if (exportType.equals(ExportTypeEnum.GAEA_TEMPLATE_EXCEL.getCodeValue())) {
                 gaeaFileService.upload(file);
-            }
-            else if(exportType.equals(ExportTypeEnum.GAEA_TEMPLATE_PDF.getCodeValue()))
-            {
+            } else if (exportType.equals(ExportTypeEnum.GAEA_TEMPLATE_PDF.getCodeValue())) {
                 // 将Excel文件转换为PDF
                 String pdfFileName = fileName + ".pdf";
                 String pdfFilePath = dir.getAbsolutePath() + File.separator + pdfFileName;
-                pdfFile = convertExcelToPdf(filePath, pdfFilePath,reportExcelStyleList);
+                pdfFile = convertExcelToPdf(filePath, pdfFilePath, reportExcelStyleList);
                 gaeaFileService.upload(pdfFile);
             }
 
         } catch (IOException e) {
             logger.error("导出失败", e);
-        }finally {
+        } finally {
             try {
                 out.close();
                 file.delete();
-                if(!Objects.isNull(pdfFile))
-                {
+                if (!Objects.isNull(pdfFile)) {
                     pdfFile.delete();
                 }
             } catch (IOException e) {
@@ -212,9 +265,12 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
         }
     }
+
     // 将Excel文件转换为PDF
     public File convertExcelToPdf(String excelFilePath, String pdfFilePath, List<List<ReportExcelStyleDto>> reportExcelStyleList) {
         try {
+            //  解决excel转换为pdf zipboom问题
+            ZipSecureFile.setMinInflateRatio(0);
             // 读取Excel文件
             Workbook workbook = new XSSFWorkbook(excelFilePath);
             Sheet sheet = workbook.getSheetAt(0);
@@ -241,9 +297,8 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 PdfPCell tableCell = new PdfPCell();
                 tableCell.setPhrase(new Phrase(getStringValue(headerCell), font));
                 ReportExcelStyleDto reportExcelStyleDto = reportExcelStyleList.get(0).get(i);
-                if(!Objects.isNull(reportExcelStyleDto))
-                {
-                    processCellStyle(reportExcelStyleDto,tableCell,font);
+                if (!Objects.isNull(reportExcelStyleDto)) {
+                    processCellStyle(reportExcelStyleDto, tableCell, font);
                 }
                 table.addCell(tableCell);
             }
@@ -263,9 +318,8 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                     PdfPCell tableCell = new PdfPCell();
                     tableCell.setPhrase(new Phrase(getStringValue(cell), font));
                     ReportExcelStyleDto reportExcelStyleDto = reportExcelStyleList.get(i).get(j);
-                    if(!Objects.isNull(reportExcelStyleDto))
-                    {
-                        processCellStyle(reportExcelStyleDto,tableCell,font);
+                    if (!Objects.isNull(reportExcelStyleDto)) {
+                        processCellStyle(reportExcelStyleDto, tableCell, font);
                     }
                     table.addCell(tableCell);
                 }
@@ -291,15 +345,14 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 处理导出pdf文件样式
+     *
      * @param tableCell
      */
-    public void processCellStyle(ReportExcelStyleDto reportExcelStyleDto,PdfPCell tableCell,Font font)
-    {
+    public void processCellStyle(ReportExcelStyleDto reportExcelStyleDto, PdfPCell tableCell, Font font) {
         // 处理单元格背景颜色
         String bg = reportExcelStyleDto.getBg();
         java.awt.Color color = null;
-        if(!Objects.isNull(bg))
-        {
+        if (!Objects.isNull(bg)) {
             color = parseRGB(bg);
             tableCell.setBackgroundColor(new BaseColor(color.getRed(), color.getGreen(), color.getBlue()));
         }
@@ -315,88 +368,64 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
 
         // 设置字体颜色
-        if(!Objects.isNull(fc))
-        {
+        if (!Objects.isNull(fc)) {
             color = parseRGB(fc);
             font.setColor(new BaseColor(color.getRed(), color.getGreen(), color.getBlue()));
         }
         // 设置字体
-        if(!Objects.isNull(ff) && !Objects.equals("0",ff))
-        {
+        if (!Objects.isNull(ff) && !Objects.equals("0", ff)) {
             font.setFamily(ff.toString());
         }
         // 设置字体大小
-        if(!Objects.isNull(fs) && !Objects.equals(0,fs))
-        {
+        if (!Objects.isNull(fs) && !Objects.equals(0, fs)) {
             font.setSize(fs);
         }
         // 设置字体加粗
-        if(Objects.equals(Boolean.TRUE,bl))
-        {
+        if (Objects.equals(Boolean.TRUE, bl)) {
             font.setStyle(Font.BOLD);
         }
         // 设置字体斜体
-        if(Objects.equals(Boolean.TRUE,it))
-        {
+        if (Objects.equals(Boolean.TRUE, it)) {
             font.setStyle(Font.ITALIC);
         }
         // 设置字体加粗且斜体
-        if(Objects.equals(Boolean.TRUE,bl) && Objects.equals(Boolean.TRUE,it))
-        {
+        if (Objects.equals(Boolean.TRUE, bl) && Objects.equals(Boolean.TRUE, it)) {
             font.setStyle(Font.BOLDITALIC);
         }
         // 是否删除线
-        if(Objects.equals(Boolean.TRUE,cl))
-        {
+        if (Objects.equals(Boolean.TRUE, cl)) {
             // 如果是粗体且斜体
-            if (font.getStyle() == Font.BOLDITALIC)
-            {
+            if (font.getStyle() == Font.BOLDITALIC) {
                 font.setStyle(Font.BOLDITALIC | Font.STRIKETHRU);
             }
             // 如果是粗体
-            else if(font.getStyle() == Font.BOLD)
-            {
+            else if (font.getStyle() == Font.BOLD) {
                 font.setStyle(Font.BOLD | Font.STRIKETHRU);
             }
             // 如果是斜体
-            else if(font.getStyle() == Font.ITALIC)
-            {
+            else if (font.getStyle() == Font.ITALIC) {
                 font.setStyle(Font.ITALIC | Font.STRIKETHRU);
-            }
-            else
-            {
+            } else {
                 font.setStyle(Font.STRIKETHRU);
             }
         }
         // 水平对齐
-        if(!Objects.isNull(ht))
-        {
-            if(Objects.equals(ht,0))
-            {
+        if (!Objects.isNull(ht)) {
+            if (Objects.equals(ht, 0)) {
                 tableCell.setHorizontalAlignment(Element.ALIGN_CENTER);
-            }
-            else if(Objects.equals(ht,1))
-            {
+            } else if (Objects.equals(ht, 1)) {
                 tableCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-            }
-            else if(Objects.equals(ht,2))
-            {
+            } else if (Objects.equals(ht, 2)) {
                 tableCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
             }
         }
         // 垂直对齐
-        if(!Objects.isNull(vt))
-        {
-            if(Objects.equals(ht,0))
-            {
+        if (!Objects.isNull(vt)) {
+            if (Objects.equals(ht, 0)) {
                 tableCell.setVerticalAlignment(com.itextpdf.text.Element.ALIGN_MIDDLE);
-            }
-            else if(Objects.equals(ht,1))
-            {
+            } else if (Objects.equals(ht, 1)) {
                 tableCell.setVerticalAlignment(Element.ALIGN_TOP);
-            }
-            else if(Objects.equals(ht,2))
-            {
+            } else if (Objects.equals(ht, 2)) {
                 tableCell.setVerticalAlignment(Element.ALIGN_BOTTOM);
             }
         }
@@ -407,19 +436,19 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     }
 
-        public static java.awt.Color parseRGB(String rgb) {
-            try {
-                String[] components = rgb.substring(rgb.indexOf("(") + 1, rgb.indexOf(")")).split(",");
-                int red = Integer.parseInt(components[0].trim());
-                int green = Integer.parseInt(components[1].trim());
-                int blue = Integer.parseInt(components[2].trim());
-
-                return new java.awt.Color(red, green, blue);
-            } catch (Exception e) {
-                e.printStackTrace();
-                return null; // 解析失败,返回null
-            }
+    public static java.awt.Color parseRGB(String rgb) {
+        try {
+            String[] components = rgb.substring(rgb.indexOf("(") + 1, rgb.indexOf(")")).split(",");
+            int red = Integer.parseInt(components[0].trim());
+            int green = Integer.parseInt(components[1].trim());
+            int blue = Integer.parseInt(components[2].trim());
+
+            return new java.awt.Color(red, green, blue);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null; // 解析失败,返回null
         }
+    }
 
     private String getStringValue(Cell cell) {
         if (cell == null) {
@@ -428,6 +457,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
             return cell.toString();
         }
     }
+
     /**
      * 解析报表数据,动态插入列表数据和对象数据
      */
@@ -496,7 +526,6 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                     }
 
 
-
                 }
             }
 
@@ -523,33 +552,34 @@ public class ReportExcelServiceImpl implements ReportExcelService {
             celldata.addAll((List<JSONObject>) dbObject.get("celldata"));
 
             //整理celldata数据,转换为map格式,方便后续使用单元格位置获取对应的cell对象
-            Map<String,JSONObject> cellDataMap = cellDataList2Map(celldata);
+            Map<String, JSONObject> cellDataMap = cellDataList2Map(celldata);
             //清除原有的数据
             dbObject.getJSONArray("celldata").clear();
             //获取配置项中的合并属性
             JSONObject merge = dbObject.getJSONObject("config").getJSONObject("merge");
-            if(merge != null) {
+            if (merge != null) {
                 merge.clear();
             }
             //定义存储每一列动态扩展的行数
-            Map<Integer,Integer> colAddCntMap = new HashMap<>();
+            Map<Integer, Integer> colAddCntMap = new HashMap<>();
             // 遍历已存在的单元格,查看是否存在动态参数
             for (int i = 0; i < celldata.size(); i++) {
                 //单元格对象
                 JSONObject cellObj = celldata.get(i);
                 //fastjson深拷贝问题
                 String cellStr = cellObj.toJSONString();
-                analysisCellData(cellObj,setParam,colAddCntMap,cellStr,merge, dbObject,cellDataMap, setMap);
+                analysisCellData(cellObj, setParam, colAddCntMap, cellStr, merge, dbObject, cellDataMap, setMap);
             }
         }
     }
 
     /**
      * 开始解析并渲染 cellData
+     *
      * @param cellObject
      */
-    public void analysisCellData(JSONObject cellObject,String setParam,Map<Integer,Integer> colAddCntMap,String cellStr,
-                                 JSONObject merge,JSONObject dbObject,Map<String,JSONObject> cellDataMap, Map<String, OriginalDataDto> setMap){
+    public void analysisCellData(JSONObject cellObject, String setParam, Map<Integer, Integer> colAddCntMap, String cellStr,
+                                 JSONObject merge, JSONObject dbObject, Map<String, JSONObject> cellDataMap, Map<String, OriginalDataDto> setMap) {
         //获取行号
         Integer cellR = cellObject.getInteger("r");
         //获取列数
@@ -558,7 +588,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
         int cnt = colAddCntMap.get(cellC) == null ? 0 : colAddCntMap.get(cellC);
         //获取单元格类型
         CellType cellType = getCellType(cellObject);
-        switch (cellType){
+        switch (cellType) {
             case BLACK:
                 //空数据单元格不处理
                 break;
@@ -567,17 +597,18 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 //处理动态单元格
                 String v = cellObject.getJSONObject("v").getString("v");
                 DataSetDto dataSet = getDataSet(v, setParam);
-                handleDynamicCellObject(dataSet,v,cellStr,cnt,cellR,cellC,merge,dbObject,colAddCntMap, setMap);
+                handleDynamicCellObject(dataSet, v, cellStr, cnt, cellR, cellC, merge, dbObject, colAddCntMap, setMap);
                 break;
             default:
                 //处理静态单元格
-                handleStaticCellObject(cellStr,dbObject,cnt,cellR,cellC,cellDataMap,setParam,merge,colAddCntMap,cellType, setMap);
+                handleStaticCellObject(cellStr, dbObject, cnt, cellR, cellC, cellDataMap, setParam, merge, colAddCntMap, cellType, setMap);
                 break;
         }
     }
 
     /**
      * 处理动态数据单元格自动扩展
+     *
      * @param dataSet
      * @param v
      * @param cellStr
@@ -588,19 +619,19 @@ public class ReportExcelServiceImpl implements ReportExcelService {
      * @param dbObject
      * @param colAddCntMap
      */
-    public void handleDynamicCellObject(DataSetDto dataSet,String v,String cellStr,int cnt,int r,int c,
-                                        JSONObject merge,JSONObject dbObject,Map<Integer,Integer> colAddCntMap, Map<String, OriginalDataDto> setMap){
+    public void handleDynamicCellObject(DataSetDto dataSet, String v, String cellStr, int cnt, int r, int c,
+                                        JSONObject merge, JSONObject dbObject, Map<Integer, Integer> colAddCntMap, Map<String, OriginalDataDto> setMap) {
         //获取动态数据
         OriginalDataDto originalDataDto;
         if (dataSet != null && setMap.containsKey(dataSet.getSetCode())) {
             originalDataDto = setMap.get(dataSet.getSetCode());
-        }else {
+        } else {
             originalDataDto = dataSetService.getData(dataSet);
             setMap.put(dataSet.getSetCode(), originalDataDto);
         }
         List<JSONObject> cellDynamicData = originalDataDto.getData();
 
-        if(cellDynamicData != null){
+        if (cellDynamicData != null) {
             //循环数据赋值
             for (int j = 0; j < cellDynamicData.size(); j++) {
                 //新增的行数据
@@ -614,25 +645,25 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 //转字符串,解决深拷贝问题
                 JSONObject addCellData = JSONObject.parseObject(cellStr);
 
-                addCellData.put("r",  cnt + r + j); //行数增加
+                addCellData.put("r", cnt + r + j); //行数增加
                 addCellData.put("c", c);
                 addCellData.getJSONObject("v").put("v", replace);
                 addCellData.getJSONObject("v").put("m", replace);
                 JSONObject cellMc = addCellData.getJSONObject("v").getJSONObject("mc");
                 //判断是否是合并单元格
-                if(null != cellMc){
+                if (null != cellMc) {
                     //处理合并单元格
                     Integer rs = cellMc.getInteger("rs");
-                    cellMc.put("r",  cnt + r + rs*j); //行数增加
+                    cellMc.put("r", cnt + r + rs * j); //行数增加
                     cellMc.put("c", c);
-                    addCellData.put("r",  cnt + r + rs*j);
+                    addCellData.put("r", cnt + r + rs * j);
                     //合并单元格需要处理config.merge
-                    merge.put(cellMc.getString("r")+"_"+cellMc.getString("c"),cellMc);
+                    merge.put(cellMc.getString("r") + "_" + cellMc.getString("c"), cellMc);
                     //处理单元格扩展之后此列扩展的总行数
-                    colAddCntMap.put(c,cnt + rs * cellDynamicData.size() - 1);
-                }else{
+                    colAddCntMap.put(c, cnt + rs * cellDynamicData.size() - 1);
+                } else {
                     //处理单元格扩展之后此列扩展的总行数
-                    colAddCntMap.put(c,cnt + cellDynamicData.size() - 1);
+                    colAddCntMap.put(c, cnt + cellDynamicData.size() - 1);
                 }
                 dbObject.getJSONArray("celldata").add(addCellData);
             }
@@ -641,6 +672,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 处理静态单元格数据
+     *
      * @param cellStr
      * @param dbObject
      * @param cnt
@@ -652,49 +684,49 @@ public class ReportExcelServiceImpl implements ReportExcelService {
      * @param colAddCntMap
      * @param cellType
      */
-    public void handleStaticCellObject(String cellStr,JSONObject dbObject,int cnt,int r,int c,
-                                       Map<String,JSONObject> cellDataMap,String setParam,
-                                       JSONObject merge,Map<Integer,Integer> colAddCntMap,CellType cellType,Map<String, OriginalDataDto> setMap){
+    public void handleStaticCellObject(String cellStr, JSONObject dbObject, int cnt, int r, int c,
+                                       Map<String, JSONObject> cellDataMap, String setParam,
+                                       JSONObject merge, Map<Integer, Integer> colAddCntMap, CellType cellType, Map<String, OriginalDataDto> setMap) {
         //转字符串,解决深拷贝问题
         JSONObject addCellData = JSONObject.parseObject(cellStr);
         int rows = 0;
-        switch(cellType){
+        switch (cellType) {
             case STATIC:
             case STATIC_MERGE:
                 //静态不扩展单元格只需要初始化位置就可以
-                initCellPosition(addCellData,cnt,merge);
+                initCellPosition(addCellData, cnt, merge);
                 break;
             case STATIC_AUTO:
                 //获取静态单元格右侧动态单元格的总行数
-                rows = getRightDynamicCellRows(addCellData,cellDataMap,setParam,rows,cellType, setMap);
-                initCellPosition(addCellData,cnt,merge);
-                if(rows > 1){
+                rows = getRightDynamicCellRows(addCellData, cellDataMap, setParam, rows, cellType, setMap);
+                initCellPosition(addCellData, cnt, merge);
+                if (rows > 1) {
                     //需要把这个静态扩展单元格 改变为 静态合并扩展单元格,就是增加合并属性 mc 以及merge配置
                     JSONObject mc = new JSONObject();
-                    mc.put("rs",rows);
-                    mc.put("cs",1);
-                    mc.put("r",addCellData.getIntValue("r"));
-                    mc.put("c",addCellData.getIntValue("c"));
-                    addCellData.getJSONObject("v").put("mc",mc);
+                    mc.put("rs", rows);
+                    mc.put("cs", 1);
+                    mc.put("r", addCellData.getIntValue("r"));
+                    mc.put("c", addCellData.getIntValue("c"));
+                    addCellData.getJSONObject("v").put("mc", mc);
                     //合并单元格需要处理config.merge
-                    merge.put((mc.getInteger("r")) + "_" + mc.getString("c"),mc);
+                    merge.put((mc.getInteger("r")) + "_" + mc.getString("c"), mc);
                     //处理单元格扩展之后此列扩展的总行数
-                    colAddCntMap.put(c,cnt + rows - 1);
+                    colAddCntMap.put(c, cnt + rows - 1);
                 }
                 break;
             case STATIC_MERGE_AUTO:
                 //获取静态单元格右侧动态单元格的总行数
                 rows = getRightDynamicCellRows(addCellData, cellDataMap, setParam, rows, cellType, setMap);
-                initCellPosition(addCellData,cnt,merge);
-                if(rows > 0){
+                initCellPosition(addCellData, cnt, merge);
+                if (rows > 0) {
                     //需要修改单元格mc中的rs
                     JSONObject cellMc = addCellData.getJSONObject("v").getJSONObject("mc");
                     int addCnt = cellMc.getInteger("rs");
-                    cellMc.put("rs",rows);
+                    cellMc.put("rs", rows);
                     //合并单元格需要处理config.merge
-                    merge.put((cellMc.getInteger("r")) + "_" + cellMc.getString("c"),cellMc);
+                    merge.put((cellMc.getInteger("r")) + "_" + cellMc.getString("c"), cellMc);
                     //处理单元格扩展之后此列扩展的总行数
-                    colAddCntMap.put(c,cnt + rows - addCnt);
+                    colAddCntMap.put(c, cnt + rows - addCnt);
                 }
                 break;
         }
@@ -703,31 +735,34 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 初始化单元格位置,主要是这一列已经动态增加的行数
+     *
      * @param addCellData
      * @param cnt
      * @param merge
      */
-    public void initCellPosition(JSONObject addCellData,int cnt,JSONObject merge){
+    public void initCellPosition(JSONObject addCellData, int cnt, JSONObject merge) {
         addCellData.put("r", cnt + addCellData.getInteger("r"));//行数增加
         //是否是合并单元格
         JSONObject mc = addCellData.getJSONObject("v").getJSONObject("mc");
-        if(mc != null){
-            mc.put("r",addCellData.getInteger("r"));
-            initCellMerge(merge,mc);
+        if (mc != null) {
+            mc.put("r", addCellData.getInteger("r"));
+            initCellMerge(merge, mc);
         }
     }
 
     /**
      * 初始化单元格合并属性的行数
+     *
      * @param merge
      * @param mc
      */
-    public void initCellMerge(JSONObject merge,JSONObject mc){
-        merge.put((mc.getInteger("r"))+"_"+mc.getString("c"),mc);
+    public void initCellMerge(JSONObject merge, JSONObject mc) {
+        merge.put((mc.getInteger("r")) + "_" + mc.getString("c"), mc);
     }
 
     /**
      * 获取合并单元格右侧的动态扩展行数,用来设置当前单元格的实际
+     *
      * @param addCellData
      * @param cellDataMap
      * @param setParam
@@ -735,18 +770,18 @@ public class ReportExcelServiceImpl implements ReportExcelService {
      * @param cellType
      * @return
      */
-    public int getRightDynamicCellRows(JSONObject addCellData,Map<String,JSONObject> cellDataMap,String setParam,int sumRows,CellType cellType,Map<String, OriginalDataDto> setMap){
+    public int getRightDynamicCellRows(JSONObject addCellData, Map<String, JSONObject> cellDataMap, String setParam, int sumRows, CellType cellType, Map<String, OriginalDataDto> setMap) {
         //1、获取此单元格右侧关联的所有单元格
-        List<JSONObject> rightCellList = getRightDynamicCell(addCellData,cellDataMap,cellType);
+        List<JSONObject> rightCellList = getRightDynamicCell(addCellData, cellDataMap, cellType);
         //2、循环获取每个单元格的扩展行数
         for (JSONObject rightCell : rightCellList) {
             //首先判断这个单元格是否也是【静态扩展单元格】
             CellType rightCellType = getCellType(rightCell);
-            switch (rightCellType){
+            switch (rightCellType) {
                 case STATIC_AUTO:
                 case STATIC_MERGE_AUTO:
                     //递归查找
-                    sumRows = getRightDynamicCellRows(rightCell,cellDataMap,setParam,sumRows,rightCellType, setMap);
+                    sumRows = getRightDynamicCellRows(rightCell, cellDataMap, setParam, sumRows, rightCellType, setMap);
                     break;
                 case BLACK:
                 case STATIC:
@@ -756,11 +791,11 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                     sumRows += rightCell.getJSONObject("v").getJSONObject("mc").getInteger("rs");
                     break;
                 default:
-                    List<JSONObject> cellDynamicData = getDynamicDataList(rightCell.getJSONObject("v").getString("v"),setParam, setMap);
-                    if(cellDynamicData != null && cellDynamicData.size() > 1){
+                    List<JSONObject> cellDynamicData = getDynamicDataList(rightCell.getJSONObject("v").getString("v"), setParam, setMap);
+                    if (cellDynamicData != null && cellDynamicData.size() > 1) {
                         int size = cellDynamicData.size();
                         sumRows += size;
-                    }else{
+                    } else {
                         sumRows++;
                     }
                     break;
@@ -771,12 +806,13 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 获取扩展单元格右侧相邻的所有单元格实体
+     *
      * @param addCellData
      * @param cellDataMap
      * @param cellType
      * @return
      */
-    public List<JSONObject> getRightDynamicCell(JSONObject addCellData,Map<String,JSONObject> cellDataMap,CellType cellType){
+    public List<JSONObject> getRightDynamicCell(JSONObject addCellData, Map<String, JSONObject> cellDataMap, CellType cellType) {
         //静态数据合并单元格需要根据右侧的单元格进行自动向下扩展
         //1、先获取右侧一列的关联的单元格,根据自身的位置,以及自己合并的合并的信息推断
         //如果自己位置是 2,5,并且本身合并 行数2,列数3,则需要推断出两个单元格的位置
@@ -785,7 +821,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
         Integer cellC = addCellData.getInteger("c");
         Integer cellRs = 0;
         Integer cellCs = 0;
-        switch (cellType){
+        switch (cellType) {
             case STATIC_AUTO:
                 cellRs = 1;
                 cellCs = 1;
@@ -796,11 +832,11 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 break;
         }
         List<JSONObject> rightCells = new ArrayList<>();
-        for(int nums = 0;nums < cellRs;nums++){
+        for (int nums = 0; nums < cellRs; nums++) {
             int r = cellR + nums;
             int c = cellC + cellCs;
             String key = r + "," + c;
-            if(cellDataMap.containsKey(key)){
+            if (cellDataMap.containsKey(key)) {
                 JSONObject cellData = cellDataMap.get(r + "," + c);
                 rightCells.add(cellData);
             }
@@ -810,48 +846,50 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 判断单元格类型
+     *
      * @param cellObject
      * @return
      */
-    public CellType getCellType(JSONObject cellObject){
+    public CellType getCellType(JSONObject cellObject) {
         JSONObject cellV1 = cellObject.getJSONObject("v");
         if (null != cellV1 && cellV1.containsKey("v") && StringUtils.isNotBlank(cellV1.getString("v"))) {
             String cellV2 = cellObject.getJSONObject("v").getString("v");
             String auto = cellObject.getJSONObject("v").getString("auto");
             JSONObject mc = cellObject.getJSONObject("v").getJSONObject("mc");
-            if(cellV2.contains("#{") && cellV2.contains("}") ){
+            if (cellV2.contains("#{") && cellV2.contains("}")) {
                 //动态单元格
-                if(mc != null){
+                if (mc != null) {
                     return CellType.DYNAMIC_MERGE;
-                }else{
+                } else {
                     return CellType.DYNAMIC;
                 }
-            }else{
+            } else {
                 //静态单元格
-                if(mc != null && "1".equals(auto)){
+                if (mc != null && "1".equals(auto)) {
                     return CellType.STATIC_MERGE_AUTO;
-                }else {
-                    if("1".equals(auto)){
+                } else {
+                    if ("1".equals(auto)) {
                         return CellType.STATIC_AUTO;
-                    }else if(mc != null){
+                    } else if (mc != null) {
                         return CellType.STATIC_MERGE;
-                    }else{
+                    } else {
                         return CellType.STATIC;
                     }
                 }
             }
-        }else{
+        } else {
             return CellType.BLACK;
         }
     }
 
     /**
      * list转为map结构,方便使用行列号查找对应cell对象
+     *
      * @param cellDataList
      * @return
      */
-    public Map<String,JSONObject> cellDataList2Map(List<JSONObject> cellDataList){
-        Map<String,JSONObject> cellDataMap = new HashMap<>();
+    public Map<String, JSONObject> cellDataList2Map(List<JSONObject> cellDataList) {
+        Map<String, JSONObject> cellDataMap = new HashMap<>();
         for (JSONObject cellData : cellDataList) {
             String r = cellData.getString("r");
             String c = cellData.getString("c");
@@ -862,6 +900,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 解析 #{xxxx.xxxxx} 数据
+     *
      * @param v
      * @return
      */
@@ -875,7 +914,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 String substring = v.substring(start, end);
                 if (substring.contains(".")) {
                     String[] split = substring.split("\\.");
-                    dto.setSetCode( split[0]);
+                    dto.setSetCode(split[0]);
                     dto.setFieldLabel(split[1]);
                     getContextData(setParam, dto);
                     return dto;
@@ -887,32 +926,34 @@ public class ReportExcelServiceImpl implements ReportExcelService {
 
     /**
      * 获取单元格对应的动态数据集
+     *
      * @param v
      * @param setParam
      * @return
      */
-    private List<JSONObject> getDynamicDataList(String v, String setParam, Map<String, OriginalDataDto> setMap){
-        if(StringUtils.isNotBlank(v)){
-            DataSetDto dataSet = getDataSet(v,setParam);
-            if(dataSet != null){
+    private List<JSONObject> getDynamicDataList(String v, String setParam, Map<String, OriginalDataDto> setMap) {
+        if (StringUtils.isNotBlank(v)) {
+            DataSetDto dataSet = getDataSet(v, setParam);
+            if (dataSet != null) {
                 OriginalDataDto originalDataDto;
                 if (setMap.containsKey(dataSet.getSetCode())) {
                     originalDataDto = setMap.get(dataSet.getSetCode());
-                }else {
+                } else {
                     originalDataDto = dataSetService.getData(dataSet);
                     setMap.put(dataSet.getSetCode(), originalDataDto);
                 }
                 return originalDataDto.getData();
-            }else{
+            } else {
                 return null;
             }
-        }else{
+        } else {
             return null;
         }
     }
 
     /**
      * 动态参数替换
+     *
      * @param setParam
      * @param dto
      */

+ 4 - 3
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/util/XlsSheetUtil.java

@@ -48,11 +48,13 @@ public class XlsSheetUtil {
             List<JSONObject> cells_json = (List<JSONObject>) dbObject.get("celldata");
             Map<Integer, List<JSONObject>> cellMap = cellGroup(cells_json);
             //循环每一行
+            // 样式创建放到循环外层,防止样式过多,超出excel最大样式限制
+            CellStyle style = wb.createCellStyle();
             for (Integer r : cellMap.keySet()) {
                 Row row = sheet.createRow(r);
                 //循环每一列
                 for (JSONObject col : cellMap.get(r)) {
-                    createCell(wb, sheet, row, col);
+                    createCell(wb, sheet, row, col,style);
                 }
             }
         }
@@ -73,7 +75,7 @@ public class XlsSheetUtil {
      * @param row
      * @param dbObject
      */
-    private static void createCell(Workbook wb, Sheet sheet, Row row, JSONObject dbObject) {
+    private static void createCell(Workbook wb, Sheet sheet, Row row, JSONObject dbObject, CellStyle style) {
         if (dbObject.containsKey("c")) {
             Integer c = getStrToInt(dbObject.get("c"));
             if (c != null) {
@@ -97,7 +99,6 @@ public class XlsSheetUtil {
                     //转换v为对象(v是一个对象)
                     JSONObject v_json = (JSONObject) obj;
                     //样式
-                    CellStyle style = wb.createCellStyle();
                     cell.setCellStyle(style);
 
 

+ 3 - 2
report-core/src/main/java/com/anjiplus/template/gaea/business/util/JdbcConstants.java

@@ -15,7 +15,9 @@ public class JdbcConstants {
    public final static String SQL_SERVER = "mssqlserver";
    public final static String JDBC = "jdbc";
    public final static String POSTGRESQL = "postgresql";
-
+   public final static String DAMENG = "dameng";
+   public final static String OPENGAUSS = "openGauss";
+   public final static String KINGBASE = "Kingbase";
 
    public final static String JTDS = "jtds";
    public final static String MOCK = "mock";
@@ -44,7 +46,6 @@ public class JdbcConstants {
    public final static String H2_DRIVER = "org.h2.Driver";
    public final static String DM = "dm";
    public final static String DM_DRIVER = "dm.jdbc.driver.DmDriver";
-   public final static String KINGBASE = "kingbase";
    public final static String KINGBASE_DRIVER = "com.kingbase.Driver";
    public final static String GBASE = "gbase";
    public final static String GBASE_DRIVER = "com.gbase.jdbc.Driver";

+ 22 - 0
report-core/src/main/resources/db/migration/V1.4.2__update.sql

@@ -0,0 +1,22 @@
+delete from gaea_dict_item where dict_code ='SOURCE_TYPE' and item_value in ('postgresql','dameng','openGauss','Kingbase');
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', 'postgresql', 'postgresql', '[{"label":"driverName","value":"org.postgresql.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:postgresql://127.0.0.1:5432/pgdb","labelValue":"连接串"},{"label":"username","value":"root","labelValue":"用户名"},{"label":"password","value":"root","labelValue":"密码"}]', 1, 'zh', NULL, 4, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', '达梦', 'dameng', '[{"label":"driverName","value":"dm.jdbc.driver.DmDriver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:dm://127.0.0.1:5236","labelValue":"连接串"},{"label":"username","value":"SYSDBA","labelValue":"用户名"},{"label":"password","value":"SYSDBA","labelValue":"密码"}]', 1, 'zh', NULL, 11, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', 'openGauss', 'openGauss', '[{"label":"driverName","value":"org.opengauss.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:opengauss://127.0.0.1:5432/postgres","labelValue":"连接串"},{"label":"username","value":"gaussdb","labelValue":"用户名"},{"label":"password","value":"gaussdb","labelValue":"密码"}]', 1, 'zh', NULL, 12, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', '人大金仓', 'Kingbase', '[{"label":"driverName","value":"com.kingbase8.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:kingbase8://127.0.0.1:54321/test","labelValue":"连接串"},{"label":"username","value":"SYSTEM","labelValue":"用户名"},{"label":"password","value":"123456","labelValue":"密码"}]', 1, 'zh', NULL, 13, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+UPDATE gaea_dict_item SET sort=31 WHERE dict_code ='SOURCE_TYPE' and item_name='elasticsearch_sql';
+UPDATE gaea_dict_item SET sort=32 WHERE dict_code ='SOURCE_TYPE' and item_name='kudu impala';
+UPDATE gaea_dict_item SET sort=33 WHERE dict_code ='SOURCE_TYPE' and item_name='jdbc';
+UPDATE gaea_dict_item SET sort=34 WHERE dict_code ='SOURCE_TYPE' and item_name='http';

+ 1 - 1
report-core/src/main/resources/mapper/ReportExcelMapper.xml

@@ -1,5 +1,5 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.anjiplus.template.gaea.business.modules.data.reportexcel.dao.ReportExcelMapper">
+<mapper namespace="com.anjiplus.template.gaea.business.modules.reportexcel.dao.ReportExcelMapper">
 
     <resultMap type="com.anjiplus.template.gaea.business.modules.reportexcel.dao.entity.ReportExcel" id="ReportMap">
         <!--jdbcType="{column.columnType}"-->

+ 15 - 1
report-ui/src/api/GaeaReport.js

@@ -1,5 +1,6 @@
 import request from '@/utils/request'
 import {getShareToken, getToken} from "@/utils/auth";
+import axios from "axios";
 
 // 设计报表
 export function design(data) {
@@ -22,10 +23,23 @@ export function preview(data) {
 
 // 导出报表
 export function exportExcel(data) {
-  return request({
+/*  return request({
     url: 'reportExcel/exportExcel',
     method: 'post',
     data,
+  })*/
+  return new Promise((resolve) =>{
+    axios({
+      method:'post',
+      url: process.env.BASE_API + '/reportExcel/exportExcel',
+      headers: { 'Authorization': getToken() },
+      data,
+      responseType:'blob'
+    }).then(res =>{
+      resolve(res.data);
+    }).catch(err =>{
+      resolve('error');
+    })
   })
 }
 

+ 183 - 91
report-ui/src/views/bigscreenDesigner/designer/tools/configure/texts/widget-table.js

@@ -22,23 +22,60 @@ export const widgetTable = {
         placeholder: '',
         value: '表格',
       },
-      {
-        type: 'el-input-number',
-        label: '显示行数',
-        name: 'vis',
-        required: false,
-        placeholder: '',
-        value: '5'
-      },
-      {
-        type: 'el-input-number',
-        label: '行高',
-        name: 'rowHeight',
-        required: false,
-        placeholder: '',
-        value: '50'
-      },
       [
+        {
+          name: '表格设置',
+          list: [
+            {
+              type: 'el-input-number',
+              label: '显示行数',
+              name: 'vis',
+              required: false,
+              placeholder: '',
+              value: '5'
+            },
+            {
+              type: 'el-input-number',
+              label: '行高',
+              name: 'rowHeight',
+              required: false,
+              placeholder: '',
+              value: '50'
+            },
+            {
+              type: 'vue-color',
+              label: '背景色',
+              name: 'tableBgColor',
+              require: false,
+              placeholder: '',
+              value: '',
+            },
+            {
+              type: 'el-switch',
+              label: '边框线',
+              name: 'isLine',
+              required: false,
+              placeholder: '',
+              value: false
+            },
+            {
+              type: 'el-input-number',
+              label: '边框宽度',
+              name: 'borderWidth',
+              required: false,
+              placeholder: '',
+              value: 1
+            },
+            {
+              type: 'vue-color',
+              label: '边框颜色',
+              name: 'borderColor',
+              required: false,
+              placeholder: '',
+              value: '#fff'
+            },
+          ]
+        },
         {
           name: '表头设置',
           list: [
@@ -79,9 +116,50 @@ export const widgetTable = {
               placeholder: '',
               value: '#fff',
             },
+            {
+              type: 'el-select',
+              label: '字体粗细',
+              name: 'headTextFontWeight',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                {code: 'normal', name: '正常'},
+                {code: 'bold', name: '粗体'},
+                {code: 'bolder', name: '特粗体'},
+                {code: 'lighter', name: '细体'}
+              ],
+              value: 'normal'
+            },
+            {
+              type: 'el-select',
+              label: '字体风格',
+              name: 'headTextFontStyle',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                {code: 'normal', name: '正常'},
+                {code: 'italic', name: 'italic斜体'},
+                {code: 'oblique', name: 'oblique斜体'},
+              ],
+              value: 'normal'
+            },
+            {
+              type: 'el-select',
+              label: '字体系列',
+              name: 'headTextFontFamily',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                {code: 'sans-serif', name: 'sans-serif'},
+                {code: 'serif', name: 'serif'},
+                {code: 'Arial', name: 'Arial'},
+                {code: 'Courier New', name: 'Courier New'},
+              ],
+              value: 'sans-serif'
+            },
             {
               type: 'vue-color',
-              label: '表头背景色',
+              label: '背景色',
               name: 'headBackColor',
               require: false,
               placeholder: '',
@@ -122,12 +200,45 @@ export const widgetTable = {
               value: '#fff',
             },
             {
-              type: 'vue-color',
-              label: '表体背景色',
-              name: 'tableBgColor',
-              require: false,
+              type: 'el-select',
+              label: '字体粗细',
+              name: 'bodyTextFontWeight',
+              required: false,
               placeholder: '',
-              value: '',
+              selectOptions: [
+                {code: 'normal', name: '正常'},
+                {code: 'bold', name: '粗体'},
+                {code: 'bolder', name: '特粗体'},
+                {code: 'lighter', name: '细体'}
+              ],
+              value: 'normal'
+            },
+            {
+              type: 'el-select',
+              label: '字体风格',
+              name: 'bodyTextFontStyle',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                {code: 'normal', name: '正常'},
+                {code: 'italic', name: 'italic斜体'},
+                {code: 'oblique', name: 'oblique斜体'},
+              ],
+              value: 'normal'
+            },
+            {
+              type: 'el-select',
+              label: '字体系列',
+              name: 'bodyTextFontFamily',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                {code: 'sans-serif', name: 'sans-serif'},
+                {code: 'serif', name: 'serif'},
+                {code: 'Arial', name: 'Arial'},
+                {code: 'Courier New', name: 'Courier New'},
+              ],
+              value: 'sans-serif'
             },
             {
               type: 'vue-color',
@@ -147,75 +258,56 @@ export const widgetTable = {
             }
           ],
         },
+        {
+          name: '动画设置',
+          list: [
+            {
+              type: 'el-switch',
+              label: '开启滚动',
+              name: 'isRoll',
+              required: false,
+              placeholder: '',
+              value: true
+            },
+            {
+              type: 'el-select',
+              label: '动画效果',
+              name: 'effect',
+              required: false,
+              placeholder: '',
+              selectOptions: [
+                { code: 'top', name: '上滚动' },
+                { code: 'topLoop', name: '上循环滚动' },
+              ],
+              value: 'topLoop'
+            },
+            {
+              type: 'el-input-number',
+              label: '滚动间隔(毫秒)',
+              name: 'interTime',
+              required: false,
+              placeholder: '',
+              value: 2500
+            },
+            {
+              type: 'el-input-number',
+              label: '动效时间(毫秒)',
+              name: 'delayTime',
+              required: false,
+              placeholder: '',
+              value: 500
+            },
+            {
+              type: 'el-input-number',
+              label: '滚动个数',
+              name: 'scroll',
+              required: false,
+              placeholder: '',
+              value: 1
+            },
+          ]
+        }
       ],
-      {
-        type: 'el-switch',
-        label: '开启滚动',
-        name: 'isRoll',
-        required: false,
-        placeholder: '',
-        value: true
-      },
-      {
-        type: 'el-select',
-        label: '动画效果',
-        name: 'effect',
-        required: false,
-        placeholder: '',
-        selectOptions: [
-          { code: 'top', name: '上滚动' },
-          { code: 'topLoop', name: '上循环滚动' },
-        ],
-        value: 'topLoop'
-      },
-      {
-        type: 'el-input-number',
-        label: '滚动间隔(毫秒)',
-        name: 'interTime',
-        required: false,
-        placeholder: '',
-        value: 2500
-      },
-      {
-        type: 'el-input-number',
-        label: '动效时间(毫秒)',
-        name: 'delayTime',
-        required: false,
-        placeholder: '',
-        value: 500
-      },
-      {
-        type: 'el-input-number',
-        label: '滚动个数',
-        name: 'scroll',
-        required: false,
-        placeholder: '',
-        value: 1
-      },
-      {
-        type: 'el-switch',
-        label: '边框线',
-        name: 'isLine',
-        required: false,
-        placeholder: '',
-        value: false
-      },
-      {
-        type: 'el-input-number',
-        label: '边框宽度',
-        name: 'borderWidth',
-        required: false,
-        placeholder: '',
-        value: 1
-      },
-      {
-        type: 'vue-color',
-        label: '边框颜色',
-        name: 'borderColor',
-        required: false,
-        placeholder: '',
-        value: '#fff'
-      },
       {
         type: 'dynamic-add-table',
         label: '',
@@ -226,7 +318,7 @@ export const widgetTable = {
           { name: '日期', key: 'date', width: '50%' },
           { name: '姓名', key: 'name', width: '50%' },
           {name: '地址', key: 'address', width: '200%',}
-          ]
+        ]
       }
     ],
     data: [

+ 9 - 4
report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue

@@ -4,7 +4,7 @@
       <!--表头-->
       <div class="title">
         <div v-for="(item, index) in header" :key="index"
-          :style="[headerTableStyle, tableFiledWidth(index), tableRowHeight()]">
+             :style="[headerTableStyle, tableFiledWidth(index), tableRowHeight()]">
           {{ item.name }}
         </div>
       </div>
@@ -13,8 +13,8 @@
         <ul class="infoList">
           <li v-for="(item, index) in list" :key="index" :style="tableRowHeight()">
             <div v-for="(itemChild, idx) in header"
-              :key="idx"
-              :style="[
+                 :key="idx"
+                 :style="[
                 bodyTableStyle,
                 bodyTable(index),
                 tableFiledWidth(idx),
@@ -82,6 +82,9 @@ export default {
       return {
         "text-align": headStyle.textAlignHeader,
         "font-size": headStyle.fontSizeHeader + "px",
+        "font-weight": headStyle.headTextFontWeight,
+        "font-style": headStyle.headTextFontStyle,
+        "font-family": headStyle.headTextFontFamily,
         "border-style": headStyle.isLine ? "solid" : "none",
         "border-width": headStyle.borderWidth + "px",
         "border-color": headStyle.borderColor,
@@ -96,11 +99,13 @@ export default {
       return {
         "text-align": bodyStyle.textAlignBody,
         "font-size": bodyStyle.fontSizeBody + "px",
+        "font-weight": bodyStyle.bodyTextFontWeight,
+        "font-style": bodyStyle.bodyTextFontStyle,
+        "font-family": bodyStyle.bodyTextFontFamily,
         "border-style": bodyStyle.isLine ? "solid" : "none",
         "border-width": bodyStyle.borderWidth + "px",
         "border-color": bodyStyle.borderColor,
         "color": bodyStyle.bodyColor,
-        "background-color": bodyStyle.tableBgColor
       };
     }
   },

+ 29 - 1
report-ui/src/views/bigscreenDesigner/viewer/index.vue

@@ -30,17 +30,20 @@ export default {
   data() {
     return {
       bigScreenStyle: {},
+      dashboard:{},
       widgets: []
     };
   },
   mounted() {
     this.getData();
+    window.onresize=this.Debounce(this.setScale,500);
   },
   methods: {
     async getData() {
       const reportCode = this.$route.query.reportCode;
       const { code, data } = await detailDashboard(reportCode);
       if (code != 200) return;
+      this.dashboard=data.dashboard||{};
       const equipment = document.body.clientWidth;
       const ratioEquipment = equipment / data.dashboard.width;
       this.bigScreenStyle = {
@@ -74,7 +77,32 @@ export default {
       if(data.dashboard.refreshSeconds>0) {
         setTimeout(function(){ window.location.reload(); }, data.dashboard.refreshSeconds*1000);
       }
-    }
+    },
+    Debounce:(fn,t)=>{
+      const delay=t||500;
+      let timer=null;
+      return(...args)=>{
+        if(timer){
+          clearTimeout(timer);
+        }
+        const context=this
+        timer=setTimeout(()=>{
+          fn.apply(context,args);
+        },delay);
+      }
+    },
+    setScale(){
+      const scale=this.getScale();
+      this.bigScreenStyle.transform='scale('+scale.scalex+','+scale.scaley+')'
+    },
+    getScale(){
+      let width=this.dashboard.width;
+      let height=this.dashboard.height;
+      return{
+        scalex:(window.innerWidth)/width,
+        scaley:(window.innerHeight)/height,
+      }
+    },
   }
 };
 </script>

+ 4 - 10
report-ui/src/views/excelreport/designer/index.vue

@@ -288,7 +288,7 @@ export default {
           }
           that.luckysheet.destroy();
           // that.luckysheet.refresh({
-          //   container: "luckysheet", 
+          //   container: "luckysheet",
           //   showinfobar: false,
           //   data: exportJson.sheets,
           //   title: exportJson.info.name,
@@ -503,15 +503,9 @@ export default {
     },
     checkDataSet() {
       this.outerVisible = false;
-      if (this.multipleSelection.length > 1) {
-        this.$message({
-          message: "一次最多勾选一个数据集",
-          type: "warning",
-        });
-        this.outerVisible = true;
-      } else {
-        this.detail(this.multipleSelection[0].id);
-      }
+      this.multipleSelection.forEach((value => {
+        this.detail(value.id)
+      }))
     },
     async detail(id) {
       const { code, data } = await detail(id);

+ 32 - 7
report-ui/src/views/excelreport/viewer/index.vue

@@ -1,5 +1,5 @@
 <!--
- * @Descripttion: 
+ * @Descripttion:
  * @Author: qianlishi
  * @Date: 2021-3-19 10:23:24
  * @Last Modified by:   Raod
@@ -91,16 +91,16 @@ export default {
       this.reportName = JSON.parse(data.jsonStr).name;
       // 渲染查询表单
       this.params.setParam = JSON.parse(data.setParam);
-      const extendArry = [];
+      const extendArray = [];
       const extendObj = this.params.setParam;
       for (const i in extendObj) {
         const children = [];
         for (const y in extendObj[i]) {
           children.push({ name: y, value: extendObj[i][y] });
         }
-        extendArry.push({ name: i, children: children });
+        extendArray.push({ name: i, children: children });
       }
-      this.tableData2 = extendArry;
+      this.tableData2 = extendArray;
 
       this.excelData = data.jsonStr;
       this.sheetData = data == null ? [{}] : JSON.parse(data.jsonStr);
@@ -120,9 +120,34 @@ export default {
         result["exportType"] = val;
       }
       this.getCellStyleData(result);
-      const { code, message } = await exportExcel(result);
-      if (code != 200) return;
-      this.$message.success(message);
+      const fileName = this.reportCode + ".xlsx";
+      exportExcel(result).then(res=>{
+        const that = this;
+        const type = res.type;
+        if (type == "application/json") {
+          let reader = new FileReader();
+          reader.readAsText(res, "utf-8");
+          reader.onload = function() {
+            const data = JSON.parse(reader.result);
+            that.$message.error(data.message);
+          };
+          return;
+        }
+
+        const blob = new Blob([res], {
+          type: "application/octet-stream"
+        });
+        if (window.navigator.msSaveOrOpenBlob) {
+          //msSaveOrOpenBlob方法返回bool值
+          navigator.msSaveBlob(blob, fileName); //本地保存
+        } else {
+          const link = document.createElement("a"); //a标签下载
+          link.href = window.URL.createObjectURL(blob);
+          link.download = fileName;
+          link.click();
+          window.URL.revokeObjectURL(link.href);
+        }
+      })
     },
     // 表单封装json
     toObject(val) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
report-ui/static/luckysheet/luckysheet.umd.js


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels