From aebe98c68aeafef67a4417597d0f2ecae970cbd1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 18 Aug 2022 11:40:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=A7=86=E5=9B=BE=E6=98=8E=E7=BB=86excel,?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E7=B1=BB=E5=9E=8B=E6=8C=89=E7=85=A7=E5=8E=9F?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/panel/PanelViewDetailsRequest.java | 3 +++ .../service/panel/PanelGroupService.java | 16 ++++++++++++++-- .../canvas/custom-component/UserViewDialog.vue | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java b/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java index 44fba1de45..841ff36e8b 100644 --- a/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java +++ b/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java @@ -16,6 +16,8 @@ public class PanelViewDetailsRequest { private String[] header; + private Integer[] excelTypes; + private List details; private String snapshot; @@ -25,4 +27,5 @@ public class PanelViewDetailsRequest { private int snapshotHeight; + } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 91ceb1f0fa..4f5832dddf 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -8,7 +8,6 @@ import io.dataease.controller.request.authModel.VAuthModelRequest; import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.panel.PanelGroupBaseInfoRequest; import io.dataease.controller.request.panel.PanelGroupRequest; -import io.dataease.controller.request.panel.PanelTemplateRequest; import io.dataease.controller.request.panel.PanelViewDetailsRequest; import io.dataease.dto.PanelGroupExtendDataDTO; import io.dataease.dto.SysLogDTO; @@ -24,6 +23,7 @@ import io.dataease.i18n.Translator; import io.dataease.listener.util.CacheUtils; import io.dataease.plugins.common.base.domain.*; import io.dataease.plugins.common.base.mapper.*; +import io.dataease.plugins.common.constants.DeTypeConstants; import io.dataease.service.chart.ChartViewService; import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.staticResource.StaticResourceService; @@ -549,6 +549,7 @@ public class PanelGroupService { try { String snapshot = request.getSnapshot(); List details = request.getDetails(); + Integer[] excelTypes = request.getExcelTypes(); details.add(0, request.getHeader()); HSSFWorkbook wb = new HSSFWorkbook(); //明细sheet @@ -575,11 +576,22 @@ public class PanelGroupService { if (rowData != null) { for (int j = 0; j < rowData.length; j++) { HSSFCell cell = row.createCell(j); - cell.setCellValue(rowData[j]); if (i == 0) {// 头部 + cell.setCellValue(rowData[j]); cell.setCellStyle(cellStyle); //设置列的宽度 detailsSheet.setColumnWidth(j, 255 * 20); + }else{ + // with DataType + if((excelTypes[j]== DeTypeConstants.DE_INT || excelTypes[j]== DeTypeConstants.DE_FLOAT)&& StringUtils.isNotEmpty(rowData[j])){ + try{ + cell.setCellValue(Double.valueOf(rowData[j])); + }catch (Exception e){ + LogUtil.warn("export excel data transform error"); + } + }else{ + cell.setCellValue(rowData[j]); + } } } } diff --git a/frontend/src/components/canvas/custom-component/UserViewDialog.vue b/frontend/src/components/canvas/custom-component/UserViewDialog.vue index 1f7b522301..5905c74d75 100644 --- a/frontend/src/components/canvas/custom-component/UserViewDialog.vue +++ b/frontend/src/components/canvas/custom-component/UserViewDialog.vue @@ -182,6 +182,7 @@ export default { }, exportExcelDownload(snapshot, width, height) { const excelHeader = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.name) + const excelTypes = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.deType) const excelHeaderKeys = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.dataeaseName) const excelData = JSON.parse(JSON.stringify(this.chart.data.tableRow)).map(item => excelHeaderKeys.map(i => item[i])) const excelName = this.chart.name @@ -189,6 +190,7 @@ export default { viewName: excelName, header: excelHeader, details: excelData, + excelTypes: excelTypes, snapshot: snapshot, snapshotWidth: width, snapshotHeight: height From 9c5904e1bf2c0bc9c254326fa934772a677cf1e5 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 18 Aug 2022 12:04:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?style(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BB=E9=A2=98=E6=97=B6=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue index 3227f02b54..cd3859855c 100644 --- a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue +++ b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue @@ -261,7 +261,8 @@ export default { this.$confirm(this.$t('panel.theme_change_tips'), this.$t('panel.theme_change_warn'), { confirmButtonText: this.$t('commons.confirm'), cancelButtonText: this.$t('commons.cancel'), - type: 'warning' + type: 'warning', + showClose: false }).then(() => { this.$store.commit('setCanvasStyle', JSON.parse(this.subjectItem.details)) this.$store.commit('recordSnapshot', 'subjectChange') From 94d9c537b70fed297bcf8ef0794be0708ec4e522 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 18 Aug 2022 00:12:17 -0400 Subject: [PATCH 3/3] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86):=20pc=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E8=AE=B0=E5=BD=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?-=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/panel/panel.js | 9 +++++++++ frontend/src/views/panel/GrantAuth/shareTree.vue | 12 ++++++++---- frontend/src/views/panel/enshrine/index.vue | 6 ++++-- frontend/src/views/panel/list/PanelList.vue | 8 +++++--- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js index e5e92583e7..acb749adcf 100644 --- a/frontend/src/api/panel/panel.js +++ b/frontend/src/api/panel/panel.js @@ -90,6 +90,15 @@ export function findOne(id) { }) } +export function viewPanelLog(data) { + return request({ + url: 'panel/group/viewLog', + method: 'post', + loading: true, + data + }) +} + export function getTable(id) { return request({ url: '/panel/table/get/' + id, diff --git a/frontend/src/views/panel/GrantAuth/shareTree.vue b/frontend/src/views/panel/GrantAuth/shareTree.vue index 052819a17a..e601263560 100644 --- a/frontend/src/views/panel/GrantAuth/shareTree.vue +++ b/frontend/src/views/panel/GrantAuth/shareTree.vue @@ -71,7 +71,7 @@