Browse Source

文件下载

psj 3 months ago
parent
commit
749c6e9f93

+ 18 - 1
src/view/other/c-views/data-handle/data-safe/check-report/CheckReport.vue

@@ -40,6 +40,9 @@ import {safeCheckReportHomeTableData} from "@/service/zsk/check-report";
 import {handleMes} from "@/unit/element-ui/tip";
 import {baseUrl} from "@/service/config";
 import {useRootStore} from "@/stores/useStore";
+import {
+  getExportFile
+} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
 
 export default {
   name: "CheckReport",
@@ -53,7 +56,21 @@ export default {
       })
     }
     function exportReportD(data) {
-      window.open(baseUrl +`/ptjkInterface/exportSafeTemplateWord?appkey=${useRootStore().userInfo.ptjk_userkeycode}&UUID=${data.UUID}`,'_blank')
+      getExportFile({
+        url:"/ptjkInterface/exportSafeTemplateWord",
+        "UUID":data.UUID
+      }).then(response =>{
+        const url = window.URL.createObjectURL(new Blob([response]));
+        const link = document.createElement('a');
+        link.href = url;
+        link.setAttribute('download', 'file.docx'); // 替换为实际的文件名
+        document.body.appendChild(link);
+        link.click();
+        link.remove();
+
+      })
+
+      // window.open(baseUrl +`/ptjkInterface/exportSafeTemplateWord?appkey=${useRootStore().userInfo.ptjk_userkeycode}&UUID=${data.UUID}`,'_blank')
 
     }
     function getTableList() {

+ 17 - 1
src/view/other/c-views/data-handle/data-safe/safe-report/SafeReport.vue

@@ -32,6 +32,9 @@ import {getSafeCheckHomeT} from "@/service/zsk/safe-check";
 import {getSafeReportTableData} from "@/service/zsk/safe-report";
 import {baseUrl} from "@/service/config";
 import {useRootStore} from "@/stores/useStore";
+import {
+  getExportFile
+} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
 
 export default {
   name: "SafeReport",
@@ -49,7 +52,20 @@ export default {
       })
     }
     function exportE(it) {
-      window.open(baseUrl +`/ptjkInterface/exportSafeTaskTemplateWord?appkey=${useRootStore().userInfo.ptjk_userkeycode}&UUID=${it.UUID}`,'_blank')
+      getExportFile({
+        url:"/ptjkInterface/exportSafeTaskTemplateWord",
+        "UUID":it.UUID
+      }).then(response =>{
+        const url = window.URL.createObjectURL(new Blob([response]));
+        const link = document.createElement('a');
+        link.href = url;
+        link.setAttribute('download', 'file.docx'); // 替换为实际的文件名
+        document.body.appendChild(link);
+        link.click();
+        link.remove();
+
+      })
+      // window.open(baseUrl +`/ptjkInterface/exportSafeTaskTemplateWord?appkey=${useRootStore().userInfo.ptjk_userkeycode}&UUID=${it.UUID}`,'_blank')
     }
     const layoutRef = ref(null)
     return {

+ 29 - 2
src/view/other/c-views/data-handle/zsk/base-rule/tabs/LabelType.vue

@@ -74,6 +74,9 @@ import {elAlert, handleMes, showConfirm, showMessage} from "@/unit/element-ui/ti
 import LabelTypeDialog from "@/view/other/c-views/data-handle/zsk/base-rule/tabs/LabelTypeDialog.vue";
 import {useDetailOrEdit} from "@/unit/use-method/usePagination";
 import {delSyncRule} from "@/service/zsk/sync-rule";
+import {
+  getExportFile
+} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
 
 export default {
   name: "LabelType",
@@ -142,10 +145,34 @@ export default {
     const isLabelTypeDialogIsShow =ref(false)
     function exportFile() {
       if (tabType.value ==='theme'){
-        window.open(baseUrl+'/ptjkInterface/exportZt_Label?appkey='+useRootStore().userInfo.ptjk_userkeycode,'_blank')
+        getExportFile({
+          url:"/ptjkInterface/exportZt_Label"
+        }).then(response =>{
+          const url = window.URL.createObjectURL(new Blob([response]));
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', 'file.xls'); // 替换为实际的文件名
+          document.body.appendChild(link);
+          link.click();
+          link.remove();
+
+        })
+        // window.open(baseUrl+'/ptjkInterface/exportZt_Label?appkey='+useRootStore().userInfo.ptjk_userkeycode,'_blank')
 
       }else {
-        window.open(baseUrl+'/DataLabelDetailDownload/ExcelDownload?appkey='+useRootStore().userInfo.ptjk_userkeycode,'_blank')
+        // window.open(baseUrl+'/DataLabelDetailDownload/ExcelDownload?appkey='+useRootStore().userInfo.ptjk_userkeycode,'_blank')
+        getExportFile({
+          url:"/DataLabelDetailDownload/ExcelDownload"
+        }).then(response =>{
+          const url = window.URL.createObjectURL(new Blob([response]));
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', 'file.xls'); // 替换为实际的文件名
+          document.body.appendChild(link);
+          link.click();
+          link.remove();
+
+        })
       }
     }
     function importF(res,res2) {