From 0885aa811a94cae8d7473c9b2957a447110c9b1d Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期五, 18 四月 2025 11:17:08 +0800 Subject: [PATCH] 网分仪数采20% --- src/views/CNAS/process/method/standardMethodsChange/component/calibrationsFileDia.vue | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/views/CNAS/process/method/standardMethodsChange/component/calibrationsFileDia.vue b/src/views/CNAS/process/method/standardMethodsChange/component/calibrationsFileDia.vue index 0f43503..41174ef 100644 --- a/src/views/CNAS/process/method/standardMethodsChange/component/calibrationsFileDia.vue +++ b/src/views/CNAS/process/method/standardMethodsChange/component/calibrationsFileDia.vue @@ -103,16 +103,28 @@ }, // 涓嬭浇 upload (row) { - let url = ''; - if(row.type==1){ - url = this.javaApi+'/img/'+row.fileUrl - file.downloadIamge(url,row.fileName) - }else{ - url = this.javaApi+'/word/'+row.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + const fileName = row.fileName; + const fileUrl = row.fileUrl; + try { + const response = axios({ + method: 'get', + url: `${Vue.prototype.javaApi}/common/downloadMinio`, + params: { + fileUrl, + fileName + }, + responseType: 'blob', + headers: { Authorization: 'Bearer ' + getToken() } + }); + + if (blobValidate(response.data)) { + saveAs(new Blob([response.data]), fileName); + Message.success("涓嬭浇鎴愬姛"); + } else { + this.printErrMsg(response.data); + } + } catch (error) { + Message.error("涓嬭浇澶辫触锛�" + error.message); } }, } -- Gitblit v1.9.3