From 2631f43623ad867177c68ca65375589caddd27b6 Mon Sep 17 00:00:00 2001 From: guanj Date: Fri, 7 Nov 2025 14:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SagTraceResult_WX/components/bdMap.vue | 4 +- .../SagTraceResult_WX/components/plan.vue | 2 +- .../VoltageSag_BJ/components/reportForms.vue | 43 ++++++++++++------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/views/SagTraceResult_WX/components/bdMap.vue b/src/views/SagTraceResult_WX/components/bdMap.vue index fe6e60d..92c3b88 100644 --- a/src/views/SagTraceResult_WX/components/bdMap.vue +++ b/src/views/SagTraceResult_WX/components/bdMap.vue @@ -11,7 +11,7 @@ 监测点 --> -
+
- 返回
diff --git a/src/views/VoltageSag_BJ/components/reportForms.vue b/src/views/VoltageSag_BJ/components/reportForms.vue index 664f588..d8749a6 100644 --- a/src/views/VoltageSag_BJ/components/reportForms.vue +++ b/src/views/VoltageSag_BJ/components/reportForms.vue @@ -63,7 +63,12 @@
@@ -81,6 +86,7 @@ const machineVisible = ref(false); const title = ref("报表导出"); const timeValue = ref([]); const deptLists = ref(); +const loading = ref(false); //form表单校验规则 const emit = defineEmits(["flushed"]); const checkAll = ref(false); @@ -157,22 +163,27 @@ const save = () => { (form.value.searchBeginTime = timeValue.value[0]), (form.value.searchEndTime = timeValue.value[1]); - exportForms(form.value).then((res: any) => { - let blob = new Blob([res], { - type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8", + exportForms(form.value) + .then((res: any) => { + let blob = new Blob([res], { + type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8", + }); + + // createObjectURL(blob); //创建下载的链接 + const url = window.URL.createObjectURL(blob); + const link = document.createElement("a"); // 创建a标签 + link.href = url; + link.download = "导出报表.docx"; // 设置下载的文件名 + document.body.appendChild(link); + link.click(); //执行下载 + document.body.removeChild(link); + + machineVisible.value = false; + loading.value = false; + }) + .catch((err) => { + loading.value = false; }); - - // createObjectURL(blob); //创建下载的链接 - const url = window.URL.createObjectURL(blob); - const link = document.createElement("a"); // 创建a标签 - link.href = url; - link.download = "导出报表.docx"; // 设置下载的文件名 - document.body.appendChild(link); - link.click(); //执行下载 - document.body.removeChild(link); - - machineVisible.value = false; - }); }; const isFutureDate = (time: any) => {