diff --git a/src/components/downloadDicomAndNonedicom/index.vue b/src/components/downloadDicomAndNonedicom/index.vue index 933f435d..85ce83fc 100644 --- a/src/components/downloadDicomAndNonedicom/index.vue +++ b/src/components/downloadDicomAndNonedicom/index.vue @@ -314,49 +314,52 @@ export default { } }, // 格式化下载文件路径 - formatDownloadFile(data) { + formatDownloadFile(list) { let files = [], - name = `${data.SubjectCode}_${data.VisitName}.zip` - if (data.StudyList && data.StudyList.length > 0) { - let StudyList = data.StudyList - StudyList.forEach((study) => { - if (study.SeriesList.length > 0) { - study.SeriesList.forEach((series) => { - if (series.InstancePathList.length > 0) { - series.InstancePathList.forEach((instance) => { - let fileName = instance.Path.split('/').pop() - let obj = { - name: `${data.SubjectCode}_${data.VisitName}/${this.$fd( - 'IsDicom', - true - )}/${study.StudyCode}/${fileName}`, - url: this.OSSclientConfig.basePath + instance.Path, - } - files.push(obj) - }) - } - }) - } - }) - } - if (data.NoneDicomStudyList && data.NoneDicomStudyList.length > 0) { - let NoneDicomStudyList = data.NoneDicomStudyList - // 多文件 - NoneDicomStudyList.forEach((study) => { - if (study.FileList.length > 0) { - study.FileList.forEach((item) => { - let obj = { - name: `${data.SubjectCode}_${data.VisitName}/${this.$fd( - 'IsDicom', - false - )}/${study.StudyCode}/${item.FileName}`, - url: this.OSSclientConfig.basePath + item.Path, - } - files.push(obj) - }) - } - }) - } + name = `${list[0].SubjectCode}_${new Date().getTime()}.zip` + list.forEach((data) => { + if (data.StudyList && data.StudyList.length > 0) { + let StudyList = data.StudyList + StudyList.forEach((study) => { + if (study.SeriesList.length > 0) { + study.SeriesList.forEach((series) => { + if (series.InstancePathList.length > 0) { + series.InstancePathList.forEach((instance) => { + let fileName = instance.Path.split('/').pop() + let obj = { + name: `${data.SubjectCode}/${data.VisitName}/${this.$fd( + 'IsDicom', + true + )}/${study.StudyCode}/${fileName}`, + url: this.OSSclientConfig.basePath + instance.Path, + } + files.push(obj) + }) + } + }) + } + }) + } + if (data.NoneDicomStudyList && data.NoneDicomStudyList.length > 0) { + let NoneDicomStudyList = data.NoneDicomStudyList + // 多文件 + NoneDicomStudyList.forEach((study) => { + if (study.FileList.length > 0) { + study.FileList.forEach((item) => { + let obj = { + name: `${data.SubjectCode}/${data.VisitName}/${this.$fd( + 'IsDicom', + false + )}/${study.StudyCode}/${item.FileName}`, + url: this.OSSclientConfig.basePath + item.Path, + } + files.push(obj) + }) + } + }) + } + }) + return { files, name } }, handleOpenDialog(item) {