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