影像汇总文件下载
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
68fa0edfe5
commit
bdca45a505
|
|
@ -204,16 +204,16 @@ export default {
|
||||||
}
|
}
|
||||||
let res = await getExportSubjectVisitImageList(data)
|
let res = await getExportSubjectVisitImageList(data)
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.downLoad(IsKeyImage, res.Result)
|
this.downLoad(IsKeyImage, res.Result, IsExportReading)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 下载
|
// 下载
|
||||||
async downLoad(IsKeyImage = false, row) {
|
async downLoad(IsKeyImage = false, row, IsExportReading = false) {
|
||||||
try {
|
try {
|
||||||
let { files, name } = this.formatDownloadFile(IsKeyImage, row)
|
let { files, name } = this.formatDownloadFile(IsKeyImage, row, IsExportReading)
|
||||||
let res = await downLoadFile(files, name, 'zip')
|
let res = await downLoadFile(files, name, 'zip')
|
||||||
// }
|
// }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -221,24 +221,44 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 格式化下载文件路径
|
// 格式化下载文件路径
|
||||||
formatDownloadFile(IsKeyImage = false, row) {
|
formatDownloadFile(IsKeyImage = false, row, IsExportReading = false) {
|
||||||
let files = [],
|
let files = [],
|
||||||
name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:dicom')}_${Date.now()}.zip`;
|
name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:dicom')}_${Date.now()}.zip`;
|
||||||
|
if (IsExportReading) {
|
||||||
|
name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:readingDicom')}_${Date.now()}.zip`;
|
||||||
|
}
|
||||||
if (!IsKeyImage) {
|
if (!IsKeyImage) {
|
||||||
//中心ID/受试者ID/访视名/Study ID_Study Date_Modality/文件
|
//中心ID/受试者ID/访视名/Study ID_Study Date_Modality/文件
|
||||||
row.VisitList.forEach(visit => {
|
row.VisitList.forEach(visit => {
|
||||||
if (visit.StudyList && visit.StudyList.length > 0) {
|
if (visit.StudyList && visit.StudyList.length > 0) {
|
||||||
visit.StudyList.forEach(study => {
|
visit.StudyList.forEach(study => {
|
||||||
|
let arr = []
|
||||||
|
study.SeriesList.forEach(item => {
|
||||||
|
if (!arr.includes(item.Modality)) {
|
||||||
|
arr.push(item.Modality)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let str = arr.join('_')
|
||||||
|
let time = study.StudyTime.split(' ')[0]
|
||||||
|
if (study.StudyDIRPath && !study.dirHas) {
|
||||||
|
study.dirHas = true
|
||||||
|
let obj = {
|
||||||
|
name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${str}/DICOMDIR`,
|
||||||
|
url: this.OSSclientConfig.basePath + study.StudyDIRPath,
|
||||||
|
}
|
||||||
|
files.push(obj)
|
||||||
|
}
|
||||||
if (study.SeriesList && study.SeriesList.length > 0) {
|
if (study.SeriesList && study.SeriesList.length > 0) {
|
||||||
study.SeriesList.forEach(serie => {
|
study.SeriesList.forEach(serie => {
|
||||||
if (serie.InstancePathList && serie.InstancePathList.length > 0) {
|
|
||||||
serie.InstancePathList.forEach(instance => {
|
if (serie.InstanceList && serie.InstanceList.length > 0) {
|
||||||
|
serie.InstanceList.forEach(instance => {
|
||||||
let instanceArr = instance.Path.split("/")
|
let instanceArr = instance.Path.split("/")
|
||||||
let fileName = instanceArr[instanceArr.length - 1]
|
let fileName = instance.FileName || instanceArr[instanceArr.length - 1]
|
||||||
let time = study.StudyTime.split(' ')[0]
|
|
||||||
let obj = {
|
let obj = {
|
||||||
name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${serie.Modality}/IMAGE/${fileName}`,
|
name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${str}/IMAGE/${fileName}`,
|
||||||
url: this.OSSclientConfig.basePath + instance.Path,
|
url: this.OSSclientConfig.basePath + instance.Path,
|
||||||
|
IsEncapsulated: instance.IsEncapsulated
|
||||||
}
|
}
|
||||||
files.push(obj)
|
files.push(obj)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue