上传、下载影像
parent
736a4eea18
commit
e3ab23f20c
|
@ -245,6 +245,10 @@ export default {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -253,6 +257,7 @@ export default {
|
||||||
dicomList: [], // 上传的文件列表
|
dicomList: [], // 上传的文件列表
|
||||||
requestNum: 6,
|
requestNum: 6,
|
||||||
hasOtherStudy: false, // 是否上传文件检查与列表不一致
|
hasOtherStudy: false, // 是否上传文件检查与列表不一致
|
||||||
|
isClose: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -332,6 +337,7 @@ export default {
|
||||||
this.dicomList = [];
|
this.dicomList = [];
|
||||||
this.hasOtherStudy = false;
|
this.hasOtherStudy = false;
|
||||||
for (var i = 0; i < files.length; ++i) {
|
for (var i = 0; i < files.length; ++i) {
|
||||||
|
if (files[i].name.indexOf("DICOMDIR") >= 0) continue;
|
||||||
let dicom = await parseDicom(files[i]);
|
let dicom = await parseDicom(files[i]);
|
||||||
if (!dicom) continue;
|
if (!dicom) continue;
|
||||||
let has = this.dicomList.some(
|
let has = this.dicomList.some(
|
||||||
|
@ -478,6 +484,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 并发上传
|
// 并发上传
|
||||||
async handleUploadTask(arr, index) {
|
async handleUploadTask(arr, index) {
|
||||||
|
if (this.isClose) return false;
|
||||||
arr[index].isUpload = 1;
|
arr[index].isUpload = 1;
|
||||||
let path = `/${arr[index].params.TrialId}/TaskImage/${
|
let path = `/${arr[index].params.TrialId}/TaskImage/${
|
||||||
arr[index].params.SubjectId
|
arr[index].params.SubjectId
|
||||||
|
@ -494,7 +501,7 @@ export default {
|
||||||
(item) => item.StudyInstanceUid === arr[index].StudyInstanceUid
|
(item) => item.StudyInstanceUid === arr[index].StudyInstanceUid
|
||||||
)[0];
|
)[0];
|
||||||
let res = await dicomToOSS(arr[index].file, path);
|
let res = await dicomToOSS(arr[index].file, path);
|
||||||
if (res && index < 20) {
|
if (res) {
|
||||||
arr[index].path = res;
|
arr[index].path = res;
|
||||||
uploadDicom.successCount++;
|
uploadDicom.successCount++;
|
||||||
arr[index].isUpload = 2;
|
arr[index].isUpload = 2;
|
||||||
|
@ -738,6 +745,9 @@ export default {
|
||||||
return studyTime;
|
return studyTime;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.isClose = true;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -72,7 +72,7 @@ let defaultKey = ['Rows', 'Columns', 'SliceLocation', 'NumberOfFrames'];
|
||||||
let pormatParseKey = ['PatientName', 'SeriesDescription', 'StudyDescription'];
|
let pormatParseKey = ['PatientName', 'SeriesDescription', 'StudyDescription'];
|
||||||
// 解析dicom文件
|
// 解析dicom文件
|
||||||
export const parseDicom = (file, name = false) => {
|
export const parseDicom = (file, name = false) => {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve) {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
reader.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
try {
|
try {
|
||||||
|
@ -94,7 +94,8 @@ export const parseDicom = (file, name = false) => {
|
||||||
res[name] = data.intString(dicom[name])
|
res[name] = data.intString(dicom[name])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
reject("name is inexistence");
|
console.log("name is inexistence");
|
||||||
|
resolve(false)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Object.keys(dicom).forEach((key) => {
|
Object.keys(dicom).forEach((key) => {
|
||||||
|
@ -125,11 +126,13 @@ export const parseDicom = (file, name = false) => {
|
||||||
})
|
})
|
||||||
resolve(res);
|
resolve(res);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
reject(error);
|
console.log(error)
|
||||||
|
resolve(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
reader.onerror = function (e) {
|
reader.onerror = function (e) {
|
||||||
reject(e);
|
console.log(e)
|
||||||
|
resolve(false);
|
||||||
};
|
};
|
||||||
reader.readAsArrayBuffer(file);
|
reader.readAsArrayBuffer(file);
|
||||||
});
|
});
|
||||||
|
|
|
@ -936,7 +936,6 @@ export default {
|
||||||
},
|
},
|
||||||
handleSetModality() {
|
handleSetModality() {
|
||||||
this.modalityListVisible = true;
|
this.modalityListVisible = true;
|
||||||
console.log(this.form.ModalityList);
|
|
||||||
var a = this.$d.Modality.filter((v) => {
|
var a = this.$d.Modality.filter((v) => {
|
||||||
return !!this.form.ModalityList.find((v1) => {
|
return !!this.form.ModalityList.find((v1) => {
|
||||||
return v1 === v.value;
|
return v1 === v.value;
|
||||||
|
|
Loading…
Reference in New Issue