From c4e24bcff51ea690775ed351b12c5db70c73d50c Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 13 Jun 2024 17:22:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E5=87=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A4=B1=E8=B4=A5=E6=97=B6=EF=BC=8C=E7=BB=99?= =?UTF-8?q?=E5=87=BA=E5=A4=B1=E8=B4=A5=E5=8E=9F=E5=9B=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E6=96=B9=E4=BE=BF=E9=97=AE=E9=A2=98=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/auto/entity/CoreExportTask.java | 16 ++++++++++++- .../dao/auto/mapper/CoreExportTaskMapper.java | 2 +- .../manage/ExportCenterManage.java | 5 +--- .../visualized/data/dataset/ExportExcel.vue | 23 ++++++++++++++++++- .../api/exportCenter/vo/ExportTaskDTO.java | 2 ++ 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/entity/CoreExportTask.java b/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/entity/CoreExportTask.java index b3aaf07412..0ae560d6e0 100644 --- a/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/entity/CoreExportTask.java +++ b/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/entity/CoreExportTask.java @@ -9,7 +9,7 @@ import java.io.Serializable; *

* * @author fit2cloud - * @since 2024-05-23 + * @since 2024-06-12 */ @TableName("core_export_task") public class CoreExportTask implements Serializable { @@ -43,6 +43,11 @@ public class CoreExportTask implements Serializable { */ private String params; + /** + * 错误信息 + */ + private String msg; + public String getId() { return id; } @@ -139,6 +144,14 @@ public class CoreExportTask implements Serializable { this.params = params; } + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + @Override public String toString() { return "CoreExportTask{" + @@ -154,6 +167,7 @@ public class CoreExportTask implements Serializable { ", exportProgress = " + exportProgress + ", exportMachineName = " + exportMachineName + ", params = " + params + + ", msg = " + msg + "}"; } } diff --git a/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/mapper/CoreExportTaskMapper.java b/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/mapper/CoreExportTaskMapper.java index a9d7a4ba26..336295366f 100644 --- a/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/mapper/CoreExportTaskMapper.java +++ b/core/core-backend/src/main/java/io/dataease/exportCenter/dao/auto/mapper/CoreExportTaskMapper.java @@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper; *

* * @author fit2cloud - * @since 2024-05-23 + * @since 2024-06-12 */ @Mapper public interface CoreExportTaskMapper extends BaseMapper { diff --git a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java index b49d49084d..43b1ea247c 100644 --- a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java +++ b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java @@ -293,19 +293,16 @@ public class ExportCenterManage { ChartDataServer.setExcelData(detailsSheet, cellStyle, header, details, detailFields, excelTypes); } } - - try (FileOutputStream outputStream = new FileOutputStream(dataPath + "/" + request.getViewName() + ".xlsx")) { wb.write(outputStream); outputStream.flush(); } wb.close(); - exportTask.setExportProgress("100"); exportTask.setExportStatus("SUCCESS"); setFileSize(dataPath + "/" + request.getViewName() + ".xlsx", exportTask); } catch (Exception e) { - e.printStackTrace(); + exportTask.setMsg(e.getMessage()); LogUtil.error("Failed to export data", e); exportTask.setExportStatus("FAILED"); } finally { diff --git a/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue b/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue index fef42fd26e..64b755038b 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue @@ -19,6 +19,8 @@ const { t } = useI18n() const tableData = ref([]) const drawerLoading = ref(false) const drawer = ref(false) +const msgDialogVisible = ref(false) +const msg = ref('') const exportDatasetLoading = ref(false) const activeName = ref('ALL') const multipleSelection = ref([]) @@ -224,6 +226,11 @@ const downLoadAll = () => { }) }) } +const showMsg = item => { + msg.value = '' + msg.value = item.msg + msgDialogVisible.value = true +} const timestampFormatDate = value => { if (!value) { return '-' @@ -383,7 +390,11 @@ defineExpose({
{{ scope.row.fileName }}
-
+
{{ $t('data_export.export_failed') }}
@@ -444,6 +455,15 @@ defineExpose({
+ + + {{ msg }} + +