下载问题
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0e766300f0
commit
433064c353
|
@ -243,7 +243,11 @@ export default {
|
|||
}
|
||||
if (type === 'dicom' || type === 'all') {
|
||||
this.list.forEach((item) => {
|
||||
if (item.DicomStudyList && item.DicomStudyList.length > 0) {
|
||||
if (
|
||||
item.IsDicom &&
|
||||
item.DicomStudyList &&
|
||||
item.DicomStudyList.length > 0
|
||||
) {
|
||||
data.SubjectVisitIdList.push(item.SourceSubjectVisitId)
|
||||
let arr = item.DicomStudyList.map((d) => d.Id)
|
||||
data.DicomStudyIdList = [...data.DicomStudyIdList, ...arr]
|
||||
|
@ -253,11 +257,12 @@ export default {
|
|||
if (type === 'noneDicom' || type === 'all') {
|
||||
this.list.forEach((item) => {
|
||||
if (
|
||||
item.NoneDicomStudyIdList &&
|
||||
item.NoneDicomStudyIdList.length > 0
|
||||
!item.IsDicom &&
|
||||
item.NoneDicomStudyList &&
|
||||
item.NoneDicomStudyList.length > 0
|
||||
) {
|
||||
data.SubjectVisitIdList.push(item.SourceSubjectVisitId)
|
||||
let arr = item.NoneDicomStudyIdList.map((d) => d.Id)
|
||||
let arr = item.NoneDicomStudyList.map((d) => d.Id)
|
||||
data.NoneDicomStudyIdList = [...data.NoneDicomStudyIdList, ...arr]
|
||||
}
|
||||
})
|
||||
|
@ -274,11 +279,11 @@ export default {
|
|||
}
|
||||
if (
|
||||
!row.IsDicom &&
|
||||
row.NoneDicomStudyIdList &&
|
||||
row.NoneDicomStudyIdList.length > 0
|
||||
row.NoneDicomStudyList &&
|
||||
row.NoneDicomStudyList.length > 0
|
||||
) {
|
||||
data.SubjectVisitIdList.push(row.SourceSubjectVisitId)
|
||||
let arr = row.NoneDicomStudyIdList.map((d) => d.Id)
|
||||
let arr = row.NoneDicomStudyList.map((d) => d.Id)
|
||||
data.NoneDicomStudyIdList = [...data.NoneDicomStudyIdList, ...arr]
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +324,7 @@ export default {
|
|||
'IsDicom',
|
||||
true
|
||||
)}/${study.StudyCode}/${fileName}`,
|
||||
path: this.OSSclientConfig.basePath + instance.Path,
|
||||
url: this.OSSclientConfig.basePath + instance.Path,
|
||||
}
|
||||
files.push(obj)
|
||||
})
|
||||
|
|
|
@ -15,8 +15,13 @@ function zipFiles(zipName, files) {
|
|||
if (fileInfo.done) {//迭代终止
|
||||
ctrl.close();
|
||||
} else {
|
||||
const { name, url } = fileInfo.value;
|
||||
return fetch(url).then(res => {
|
||||
let { name, url } = fileInfo.value;
|
||||
url = decodeUtf8(url);
|
||||
return fetch(url, {
|
||||
headers: {
|
||||
'Cross-Origin-Embedder-Policy': 'unsafe-none'
|
||||
}
|
||||
}).then(res => {
|
||||
ctrl.enqueue({
|
||||
name,
|
||||
stream: () => res.body
|
||||
|
@ -40,7 +45,12 @@ async function updateFile(file, name) {
|
|||
try {
|
||||
store.dispatch('trials/setUnLock', true)
|
||||
const fileOutputStream = streamSaver.createWriteStream(name);
|
||||
let res = await fetch(file);
|
||||
file = decodeUtf8(file);
|
||||
let res = await fetch(file, {
|
||||
headers: {
|
||||
'Cross-Origin-Embedder-Policy': 'unsafe-none'
|
||||
}
|
||||
});
|
||||
res.body.pipeTo(fileOutputStream).then(() => {
|
||||
store.dispatch('trials/setUnLock', true)
|
||||
});
|
||||
|
@ -48,6 +58,15 @@ async function updateFile(file, name) {
|
|||
console.log(err)
|
||||
}
|
||||
}
|
||||
function decodeUtf8(bytes) {
|
||||
let str = bytes.split('?');
|
||||
let str2 = str[0].split('/');
|
||||
let name = str2[str2.length - 1];
|
||||
name = encodeURIComponent(name);
|
||||
str.shift();
|
||||
str2.pop();
|
||||
return str2.join("/") + '/' + name;
|
||||
}
|
||||
export function downLoadFile(file, name, type = 'file') {
|
||||
if (type === 'zip') return zipFiles(name, file);
|
||||
return updateFile(file, name)
|
||||
|
|
|
@ -1470,7 +1470,7 @@ export default {
|
|||
)}/${study.StudyCode}_${study.StudyTime}_${
|
||||
series.Modality
|
||||
}/${fileName}`,
|
||||
path: this.OSSclientConfig.basePath + instance.Path,
|
||||
url: this.OSSclientConfig.basePath + instance.Path,
|
||||
}
|
||||
files.push(obj)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue