重复下载提示
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-07-17 17:36:52 +08:00
parent 81506cc337
commit bebd4c4aa0
1 changed files with 7 additions and 5 deletions

View File

@ -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);
}