diff --git a/src/utils/uploadZip.js b/src/utils/uploadZip.js index 2844e3da..45e3063a 100644 --- a/src/utils/uploadZip.js +++ b/src/utils/uploadZip.js @@ -7,7 +7,7 @@ import { } from "@/api/load.js"; let flag = {}; export const downloadImage = async (id, id2, IsDicom = true) => { - if (flag[`${id2}_${IsDicom}`]) return + if (flag[`${id2}_${IsDicom}`]) return Vue.prototype.$message.warning(Vue.prototype.$t('trials:upload:tip:uploading')); flag[`${id2}_${IsDicom}`] = true try { let params = { @@ -16,16 +16,16 @@ export const downloadImage = async (id, id2, IsDicom = true) => { IsDicom: IsDicom } let res = await requestPackageAndAnonymizImage(params); - flag[`${id2}_${IsDicom}`] = false; if (res.IsSuccess) { if (!res.Result) { Vue.prototype.$message.warning(Vue.prototype.$t("trials:upload:message:not")) return 1; } - let a = document.createElement("a"); + Vue.prototype.$message.success(Vue.prototype.$t("trials:upload:message:startUpload")); let href = Vue.prototype.OSSclientConfig.basePath + res.Result; - download(href, res.OtherInfo.FileName) + download(href, res.OtherInfo.FileName, { id2, IsDicom }) return 2; + // let a = document.createElement("a"); // // let fileName = // // res.Result.split("/")[res.Result.split("/").length - 1]; // a.download = res.OtherInfo.FileName; @@ -39,6 +39,7 @@ export const downloadImage = async (id, id2, IsDicom = true) => { // }, 500) // return 2; } else { + flag[`${id2}_${IsDicom}`] = false; return false; } } catch (err) { @@ -145,8 +146,9 @@ export const fileDownload = (content, filename) => { eleLink.click(); document.body.removeChild(eleLink); }; -let download = async (downloadUrl, downloadFileName) => { +let download = async (downloadUrl, downloadFileName, res) => { const blob = await getBlob(downloadUrl); + flag[`${res.id2}_${res.IsDicom}`] = false; saveAsB(blob, downloadFileName); }