From 0108025b34d4cff725a069b30d86c76439422502 Mon Sep 17 00:00:00 2001 From: qianming Date: Mon, 1 Aug 2022 15:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82--Excel=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dto/ReportShareDto.java | 2 + .../reportshare/dao/entity/ReportShare.java | 3 + .../service/impl/ReportShareServiceImpl.java | 34 ++++++-- report-ui/src/router/index.js | 5 ++ .../bigScreenReport/components/share.vue | 11 ++- report-ui/src/views/bigScreenReport/index.vue | 5 +- .../views/excelreport/components/share.vue | 12 ++- report-ui/src/views/excelreport/el/index.vue | 85 +++++++++++++++++++ report-ui/src/views/excelreport/index.vue | 9 +- 9 files changed, 151 insertions(+), 15 deletions(-) create mode 100644 report-ui/src/views/excelreport/el/index.vue diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/controller/dto/ReportShareDto.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/controller/dto/ReportShareDto.java index f9a42cce..b0c4944b 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/controller/dto/ReportShareDto.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/controller/dto/ReportShareDto.java @@ -60,4 +60,6 @@ public class ReportShareDto extends GaeaBaseDTO implements Serializable { private boolean sharePasswordFlag = false; + private String reportType; + } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/dao/entity/ReportShare.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/dao/entity/ReportShare.java index 5b2af8a5..b581504c 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/dao/entity/ReportShare.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/dao/entity/ReportShare.java @@ -45,5 +45,8 @@ public class ReportShare extends GaeaBaseEntity { @TableField(exist = false) private boolean sharePasswordFlag; + /** 大屏类型 report excel */ + @TableField(exist = false) + private String reportType; } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/service/impl/ReportShareServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/service/impl/ReportShareServiceImpl.java index 1fe00e40..02eec6eb 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/service/impl/ReportShareServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportshare/service/impl/ReportShareServiceImpl.java @@ -29,7 +29,11 @@ import org.springframework.stereotype.Service; **/ @Service public class ReportShareServiceImpl implements ReportShareService { + private static final String SHARE_AJFLAG = "#/aj/"; + private static final String SHARE_ELFLAG = "#/el/"; + private static final String REPORT = "report_screen"; + private static final String EXCEL = "report_excel"; /** * 默认跳转路由为aj的页面 */ @@ -126,11 +130,31 @@ public class ReportShareServiceImpl implements ReportShareService { //http://127.0.0.1:9095/reportDashboard/getData String shareCode = UuidUtil.generateShortUuid(); entity.setShareCode(shareCode); - if (entity.getShareUrl().contains(SHARE_URL)) { - String prefix = entity.getShareUrl().substring(0, entity.getShareUrl().indexOf("#")); - entity.setShareUrl(prefix + SHARE_FLAG + shareCode); - } else { - entity.setShareUrl(entity.getShareUrl() + SHARE_FLAG + shareCode); + +// if (entity.getShareUrl().contains(SHARE_URL)) { +// String prefix = entity.getShareUrl().substring(0, entity.getShareUrl().indexOf("#")); +// entity.setShareUrl(prefix + SHARE_FLAG + shareCode); +// } else { +// entity.setShareUrl(entity.getShareUrl() + SHARE_FLAG + shareCode); +// } + + + if (REPORT.equals(entity.getReportType())) { + if (entity.getShareUrl().contains(SHARE_URL)) { + String prefix = entity.getShareUrl().substring(0, entity.getShareUrl().indexOf("#")); + entity.setShareUrl(prefix + SHARE_AJFLAG + shareCode); + }else { + entity.setShareUrl(entity.getShareUrl() + SHARE_AJFLAG + shareCode); + } + }else if (EXCEL.equals(entity.getReportType())) { + if (entity.getShareUrl().contains(SHARE_URL)) { + String prefix = entity.getShareUrl().substring(0, entity.getShareUrl().indexOf("#")); + entity.setShareUrl(prefix + SHARE_ELFLAG + shareCode); + }else { + entity.setShareUrl(entity.getShareUrl() + SHARE_ELFLAG + shareCode); + } + }else { + return; } entity.setShareValidTime(DateUtil.getFutureDateTmdHms(entity.getShareValidType())); diff --git a/report-ui/src/router/index.js b/report-ui/src/router/index.js index cb0dcfec..5ee8db7e 100644 --- a/report-ui/src/router/index.js +++ b/report-ui/src/router/index.js @@ -35,6 +35,11 @@ export const constantRouterMap = [ component: () => import('@/views/bigScreenReport/aj'), hidden: true }, + { + path: '/el/**', + component: () => import('@/views/excelreport/el'), + hidden: true + }, { path: '/index', component: Layout, diff --git a/report-ui/src/views/bigScreenReport/components/share.vue b/report-ui/src/views/bigScreenReport/components/share.vue index 04bf6166..7245e818 100644 --- a/report-ui/src/views/bigScreenReport/components/share.vue +++ b/report-ui/src/views/bigScreenReport/components/share.vue @@ -114,6 +114,13 @@ export default { default: () => { return ""; } + }, + reportType: { + required : true, + type: String, + default: () =>{ + return ""; + } } }, data() { @@ -124,6 +131,7 @@ export default { dialogForm: { shareValidType: 0, reportCode: "", + reportType: "", shareUrl: "", shareCode: "", sharePassword: "", @@ -164,12 +172,11 @@ export default { this.dialogForm.sharePassword = ""; }, async createShare() { + this.dialogForm.reportType = this.reportType; this.dialogForm.reportCode = this.reportCode; this.dialogForm.shareUrl = window.location.href; - // console.log(this.dialogForm) const { code, data } = await reportShareAdd(this.dialogForm); if (code != "200") return; - // console.log(data) this.shareLinkFlag1 = false; this.$message({ message: "创建链接成功!", diff --git a/report-ui/src/views/bigScreenReport/index.vue b/report-ui/src/views/bigScreenReport/index.vue index 430e9715..6f911441 100644 --- a/report-ui/src/views/bigScreenReport/index.vue +++ b/report-ui/src/views/bigScreenReport/index.vue @@ -101,6 +101,7 @@ :visib="visibleForShareDialog" :reportCode="reportCodeForShareDialog" :reportName="reportNameForShareDialog" + :reportType="reportTypeForShareDialog" @handleClose="visibleForShareDialog = false" /> @@ -130,7 +131,8 @@ export default { // 分享 visibleForShareDialog: false, reportCodeForShareDialog: "", - reportNameForShareDialog: "" + reportNameForShareDialog: "", + reportTypeForShareDialog: "", }; }, mounted() {}, @@ -176,6 +178,7 @@ export default { share(val) { this.reportCodeForShareDialog = val.reportCode; this.reportNameForShareDialog = val.reportName; + this.reportTypeForShareDialog = val.reportType; this.visibleForShareDialog = true; }, openDesign(val) { diff --git a/report-ui/src/views/excelreport/components/share.vue b/report-ui/src/views/excelreport/components/share.vue index 2339f6aa..c79a36da 100644 --- a/report-ui/src/views/excelreport/components/share.vue +++ b/report-ui/src/views/excelreport/components/share.vue @@ -110,6 +110,13 @@ export default { default: () => { return ""; } + }, + reportType: { + required : true, + type: String, + default: () =>{ + return ""; + } } }, data() { @@ -120,6 +127,7 @@ export default { dialogForm: { shareValidType: 0, reportCode: "", + reportType: "", shareUrl: "", shareCode: "", sharePassword: "", @@ -160,12 +168,12 @@ export default { this.dialogForm.sharePassword = ""; }, async createShare() { + this.dialogForm.reportType = this.reportType; this.dialogForm.reportCode = this.reportCode; this.dialogForm.shareUrl = window.location.href; - // console.log(this.dialogForm) + console.log(this.dialogForm) const { code, data } = await reportShareAdd(this.dialogForm); if (code != "200") return; - // console.log(data) this.shareLinkFlag1 = false; this.$message({ message: "创建链接成功!", diff --git a/report-ui/src/views/excelreport/el/index.vue b/report-ui/src/views/excelreport/el/index.vue new file mode 100644 index 00000000..457ac387 --- /dev/null +++ b/report-ui/src/views/excelreport/el/index.vue @@ -0,0 +1,85 @@ + + + diff --git a/report-ui/src/views/excelreport/index.vue b/report-ui/src/views/excelreport/index.vue index fe9a9a95..a8ff8aca 100644 --- a/report-ui/src/views/excelreport/index.vue +++ b/report-ui/src/views/excelreport/index.vue @@ -101,6 +101,7 @@ :visib="visibleForShareDialog" :reportCode="reportCodeForShareDialog" :reportName="reportNameForShareDialog" + :reportType="reportTypeForShareDialog" @handleClose="visibleForShareDialog = false" /> @@ -130,7 +131,8 @@ export default { // 分享 visibleForShareDialog: false, reportCodeForShareDialog: "", - reportNameForShareDialog: "" + reportNameForShareDialog: "", + reportTypeForShareDialog: "" }; }, mounted() {}, @@ -174,12 +176,9 @@ export default { }, // 分享 share(val) { - //excel暂不支持 - this.$message.warning("暂不支持excel报表分享"); - return; - this.reportCodeForShareDialog = val.reportCode; this.reportNameForShareDialog = val.reportName; + this.reportTypeForShareDialog = val.reportType; this.visibleForShareDialog = true; }, openDesign(val) {