From fe9a137b780e198e89929acc68ba9d36c3aa8495 Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Tue, 17 May 2022 11:00:20 +0800 Subject: [PATCH 1/6] =?UTF-8?q?bugfix----index=E8=B7=AF=E7=94=B1=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anjiplus/template/gaea/business/filter/TokenFilter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java index 642acddc..8022cf44 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java @@ -85,7 +85,12 @@ public class TokenFilter implements Filter { return; } + if (SLASH.equals(uri) || SLASH.concat(BusinessConstant.SLASH).equals(uri)) { + if (BusinessConstant.SLASH.equals(uri)) { + response.sendRedirect("/index.html"); + return; + } response.sendRedirect(SLASH + "/index.html"); return; } From ffc5add0084aaf853192dab2988bb038befdf499 Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Tue, 17 May 2022 12:03:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?bugfix----=E5=A4=A7=E5=B1=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=AF=BC=E5=87=BA=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anjiplus/template/gaea/business/util/FileUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/util/FileUtil.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/util/FileUtil.java index 6fcdbacf..5532b53d 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/util/FileUtil.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/util/FileUtil.java @@ -97,11 +97,13 @@ public class FileUtil { if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } - FileWriter fw = new FileWriter(filePath); - BufferedWriter bw = new BufferedWriter(fw); + FileOutputStream outputStream = new FileOutputStream(filePath); + OutputStreamWriter outputWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8); + BufferedWriter bw = new BufferedWriter(outputWriter); bw.write(content); bw.close(); - fw.close(); + outputWriter.close(); + outputStream.close(); } catch (Exception e) { log.error("写入文件失败", e); throw BusinessExceptionBuilder.build(ResponseCode.FAIL_CODE, e.getMessage()); @@ -178,7 +180,7 @@ public class FileUtil { try { out = new FileOutputStream(dstFile); CheckedOutputStream cos = new CheckedOutputStream(out, new CRC32()); - zipOut = new ZipOutputStream(cos); + zipOut = new ZipOutputStream(cos, StandardCharsets.UTF_8); String baseDir = ""; compress(srcFile, zipOut, baseDir); } catch (IOException e) { From bf7a1371000b7e0cf45537cab3db5c6db6c0bdc7 Mon Sep 17 00:00:00 2001 From: qianming Date: Tue, 17 May 2022 16:30:46 +0800 Subject: [PATCH 3/6] update-0.9.7.2 --- report-ui/src/views/layout/components/Sidebar/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-ui/src/views/layout/components/Sidebar/index.vue b/report-ui/src/views/layout/components/Sidebar/index.vue index 797636d1..1f84de8a 100644 --- a/report-ui/src/views/layout/components/Sidebar/index.vue +++ b/report-ui/src/views/layout/components/Sidebar/index.vue @@ -3,7 +3,7 @@
- V0.9.7 + V0.9.7.2
Date: Tue, 17 May 2022 16:41:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E8=AE=BE=E7=BD=AE=20?= =?UTF-8?q?=E6=8F=8F=E5=86=99=E4=B8=8E=E6=A0=87=E9=A2=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/components/dynamicForm.vue | 1 + .../bigscreenDesigner/designer/index.vue | 28 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/components/dynamicForm.vue b/report-ui/src/views/bigscreenDesigner/designer/components/dynamicForm.vue index 99eb92de..9544eca0 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/components/dynamicForm.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/components/dynamicForm.vue @@ -344,6 +344,7 @@ export default { } else { this.$set(this.formData, key, val); } + this.$emit("onChanged", this.formData); // key为当前用户操作的表单组件 for (let i = 0; i < this.options.length; i++) { diff --git a/report-ui/src/views/bigscreenDesigner/designer/index.vue b/report-ui/src/views/bigscreenDesigner/designer/index.vue index 06795127..5a989550 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/index.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/index.vue @@ -199,7 +199,9 @@ 'background-origin': 'initial', 'background-clip': 'initial' }" - @click.self="setOptionsOnClickScreen" @drop="widgetOnDragged($event)" @dragover="dragOver($event)" + @click.self="setOptionsOnClickScreen" + @drop="widgetOnDragged($event)" + @dragover="dragOver($event)" >
Date: Tue, 17 May 2022 16:57:14 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=98=E5=8C=96----=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/controller/ReportController.java | 6 ++--- .../modules/report/service/ReportService.java | 4 +-- .../service/impl/ReportServiceImpl.java | 26 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java index 65c06afe..fa44a3a3 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java @@ -43,11 +43,11 @@ public class ReportController extends GaeaBaseController { /** * 复制大屏 - * @param reportId + * @param dto */ - void copy(Long reportId); + void copy(ReportDto dto); } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java index 4a36d9f0..e44400b0 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java @@ -3,7 +3,9 @@ package com.anjiplus.template.gaea.business.modules.report.service.impl; import com.anji.plus.gaea.constant.BaseOperationEnum; import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper; import com.anji.plus.gaea.exception.BusinessException; +import com.anji.plus.gaea.exception.BusinessExceptionBuilder; import com.anji.plus.gaea.utils.GaeaBeanUtils; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.anjiplus.template.gaea.business.enums.ReportTypeEnum; import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDashboard; import com.anjiplus.template.gaea.business.modules.dashboard.service.ReportDashboardService; @@ -16,6 +18,7 @@ import com.anjiplus.template.gaea.business.modules.report.service.ReportService; import com.anjiplus.template.gaea.business.modules.reportexcel.dao.entity.ReportExcel; import com.anjiplus.template.gaea.business.modules.reportexcel.service.ReportExcelService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -107,10 +110,16 @@ public class ReportServiceImpl implements ReportService { } @Override - public void copy(Long reportId) { - Report report = selectOne(reportId); + public void copy(ReportDto dto) { + if (null == dto.getId()) { + throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "id"); + } + if (StringUtils.isBlank(dto.getReportCode())) { + throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "报表编码"); + } + Report report = selectOne(dto.getId()); String reportCode = report.getReportCode(); - Report copyReport = copyReport(report); + Report copyReport = copyReport(report, dto); //复制主表数据 insert(copyReport); String copyReportCode = copyReport.getReportCode(); @@ -150,17 +159,12 @@ public class ReportServiceImpl implements ReportService { } } - private Report copyReport(Report report){ + private Report copyReport(Report report, ReportDto dto){ //复制主表数据 Report copyReport = new Report(); GaeaBeanUtils.copyAndFormatter(report, copyReport); - copyReport.setId(null); - String copyReportCode = copyReport.getReportCode().concat("_").concat(String.valueOf(System.currentTimeMillis())); - if (copyReportCode.length() >= 100) { - copyReportCode = copyReportCode.substring(0, 100); - } - copyReport.setReportCode(copyReportCode); - copyReport.setReportName(copyReport.getReportName().concat("_copy")); + copyReport.setReportCode(dto.getReportCode()); + copyReport.setReportName(dto.getReportName()); return copyReport; } From 7fc0bbbf20c4cf6908c139d56aae83fbf6371b21 Mon Sep 17 00:00:00 2001 From: qianlishi <1432731663@qq.com> Date: Tue, 17 May 2022 17:40:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report-ui/src/api/reportmanage.js | 4 +- .../reportManage/components/copyDialog.vue | 84 +++++++++++++++++++ report-ui/src/views/reportManage/index.vue | 29 +++++-- 3 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 report-ui/src/views/reportManage/components/copyDialog.vue diff --git a/report-ui/src/api/reportmanage.js b/report-ui/src/api/reportmanage.js index 3858fde0..75affa48 100644 --- a/report-ui/src/api/reportmanage.js +++ b/report-ui/src/api/reportmanage.js @@ -42,8 +42,8 @@ export function reportDetail(data) { export function reportCopy(data) { return request({ url: '/report/copy', - method: 'get', - params: { reportId: data.id } + method: 'post', + data }) } diff --git a/report-ui/src/views/reportManage/components/copyDialog.vue b/report-ui/src/views/reportManage/components/copyDialog.vue new file mode 100644 index 00000000..9c5275ac --- /dev/null +++ b/report-ui/src/views/reportManage/components/copyDialog.vue @@ -0,0 +1,84 @@ + + + diff --git a/report-ui/src/views/reportManage/index.vue b/report-ui/src/views/reportManage/index.vue index d7811f83..a07f047e 100644 --- a/report-ui/src/views/reportManage/index.vue +++ b/report-ui/src/views/reportManage/index.vue @@ -4,7 +4,7 @@ * @Author: qianlishi * @Date: 2021-12-11 14:48:27 * @LastEditors: qianlishi - * @LastEditTime: 2022-05-15 10:44:58 + * @LastEditTime: 2022-05-17 17:38:44 --> @@ -28,13 +29,15 @@ import { reportCopy } from "@/api/reportmanage"; import Share from "./components/share"; +import copyDialog from "./components/copyDialog.vue"; import { validateEngOrNum } from "@/utils/validate"; import { verificationSet } from "@/api/report"; export default { name: "Report", components: { anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default, - Share + Share, + copyDialog }, data() { return { @@ -306,7 +309,11 @@ export default { } } } - } + }, + + // 复制 + copyVisible: false, + rowData: {} }; }, @@ -358,11 +365,17 @@ export default { }, //复制 async copyReport(val) { - const { code } = await reportCopy(val); - if (code != "200") { - return; - } - this.$message.success("复制成功"); + this.copyVisible = true; + this.rowData = val; + // const { code } = await reportCopy(val); + // if (code != "200") { + // return; + // } + // this.$message.success("复制成功"); + // this.$refs.listPage.handleQueryForm("query"); + }, + close() { + this.copyVisible = false; this.$refs.listPage.handleQueryForm("query"); } }