影像汇总文件下载
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-12-23 16:36:22 +08:00
parent 68fa0edfe5
commit bdca45a505
1 changed files with 29 additions and 9 deletions

View File

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