上传、下载影像

uat_us
wangxiaoshuang 2024-06-14 15:14:03 +08:00
parent 736a4eea18
commit e3ab23f20c
3 changed files with 18 additions and 6 deletions

View File

@ -245,6 +245,10 @@ export default {
return [];
},
},
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
@ -253,6 +257,7 @@ export default {
dicomList: [], //
requestNum: 6,
hasOtherStudy: false, //
isClose: false,
};
},
watch: {
@ -332,6 +337,7 @@ export default {
this.dicomList = [];
this.hasOtherStudy = false;
for (var i = 0; i < files.length; ++i) {
if (files[i].name.indexOf("DICOMDIR") >= 0) continue;
let dicom = await parseDicom(files[i]);
if (!dicom) continue;
let has = this.dicomList.some(
@ -478,6 +484,7 @@ export default {
},
//
async handleUploadTask(arr, index) {
if (this.isClose) return false;
arr[index].isUpload = 1;
let path = `/${arr[index].params.TrialId}/TaskImage/${
arr[index].params.SubjectId
@ -494,7 +501,7 @@ export default {
(item) => item.StudyInstanceUid === arr[index].StudyInstanceUid
)[0];
let res = await dicomToOSS(arr[index].file, path);
if (res && index < 20) {
if (res) {
arr[index].path = res;
uploadDicom.successCount++;
arr[index].isUpload = 2;
@ -738,6 +745,9 @@ export default {
return studyTime;
},
},
beforeDestroy() {
this.isClose = true;
},
};
</script>
<style lang="scss" scoped>

View File

@ -72,7 +72,7 @@ let defaultKey = ['Rows', 'Columns', 'SliceLocation', 'NumberOfFrames'];
let pormatParseKey = ['PatientName', 'SeriesDescription', 'StudyDescription'];
// 解析dicom文件
export const parseDicom = (file, name = false) => {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
let reader = new FileReader();
reader.onload = function (e) {
try {
@ -94,7 +94,8 @@ export const parseDicom = (file, name = false) => {
res[name] = data.intString(dicom[name])
}
} else {
reject("name is inexistence");
console.log("name is inexistence");
resolve(false)
}
} else {
Object.keys(dicom).forEach((key) => {
@ -125,11 +126,13 @@ export const parseDicom = (file, name = false) => {
})
resolve(res);
} catch (error) {
reject(error);
console.log(error)
resolve(false);
}
};
reader.onerror = function (e) {
reject(e);
console.log(e)
resolve(false);
};
reader.readAsArrayBuffer(file);
});

View File

@ -936,7 +936,6 @@ export default {
},
handleSetModality() {
this.modalityListVisible = true;
console.log(this.form.ModalityList);
var a = this.$d.Modality.filter((v) => {
return !!this.form.ModalityList.find((v1) => {
return v1 === v.value;