错误重传
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
4ea73a455e
commit
e8ddecfc68
|
@ -257,14 +257,56 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isLoad() {
|
isLoad() {
|
||||||
|
console.log(this.isLoad);
|
||||||
if (!this.isLoad) {
|
if (!this.isLoad) {
|
||||||
this.$refs.file.value = null;
|
this.$refs.file.value = null;
|
||||||
if (this.dicomList.some((item) => item.isUpload === 3)) {
|
if (this.dicomList.some((item) => item.isUpload === 3)) {
|
||||||
|
this.$confirm(this.$t("trials:uploadImage:confirm:failUpload"), {
|
||||||
|
type: "warning",
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: this.$t("common:button:confirm"),
|
||||||
|
cancelButtonText: this.$t("common:button:cancel"),
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.againUpload();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 失败重传
|
||||||
|
againUpload() {
|
||||||
|
for (let i = 0; i < this.uploadList.length; i++) {
|
||||||
|
let item = this.uploadList[i];
|
||||||
|
if (item.status > 2) continue;
|
||||||
|
item.status = 0;
|
||||||
|
item.failCount = 0;
|
||||||
|
item.schedule = Math.floor(
|
||||||
|
((item.successCount + item.failCount) / item.count) * 100
|
||||||
|
);
|
||||||
|
let arr = this.dicomList.filter(
|
||||||
|
(dicom) =>
|
||||||
|
dicom.StudyInstanceUid === item.StudyInstanceUid &&
|
||||||
|
dicom.isUpload === 3
|
||||||
|
);
|
||||||
|
arr.forEach((item) => (item.isUpload = 0));
|
||||||
|
this.setUploadTask(arr);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async setUploadTask(arr) {
|
||||||
|
let num = arr.length > this.requestNum ? this.requestNum : arr.length;
|
||||||
|
let funArr = [];
|
||||||
|
for (let i = 0; i < num; i++) {
|
||||||
|
funArr.push(this.handleUploadTask(arr, i));
|
||||||
|
}
|
||||||
|
if (funArr.length > 0) {
|
||||||
|
let res = await Promise.all(funArr);
|
||||||
|
}
|
||||||
|
},
|
||||||
// 预上传
|
// 预上传
|
||||||
async preArchiveDicomStudy(post, index) {
|
async preArchiveDicomStudy(post, index) {
|
||||||
try {
|
try {
|
||||||
|
@ -275,14 +317,7 @@ export default {
|
||||||
let arr = this.dicomList.filter(
|
let arr = this.dicomList.filter(
|
||||||
(dicom) => dicom.StudyInstanceUid === item.StudyInstanceUid
|
(dicom) => dicom.StudyInstanceUid === item.StudyInstanceUid
|
||||||
);
|
);
|
||||||
let num = arr.length > this.requestNum ? this.requestNum : arr.length;
|
this.setUploadTask(arr);
|
||||||
let funArr = [];
|
|
||||||
for (let i = 0; i < num; i++) {
|
|
||||||
funArr.push(this.handleUploadTask(arr, i));
|
|
||||||
}
|
|
||||||
if (funArr.length > 0) {
|
|
||||||
let res = await Promise.all(funArr);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +368,6 @@ export default {
|
||||||
uploadData.schedule = 0;
|
uploadData.schedule = 0;
|
||||||
uploadData.status = 0;
|
uploadData.status = 0;
|
||||||
uploadData.FileSize = dicom.file.size;
|
uploadData.FileSize = dicom.file.size;
|
||||||
uploadData.IsDicomReUpload = false;
|
|
||||||
uploadData.SeriesInstanceUidList = [
|
uploadData.SeriesInstanceUidList = [
|
||||||
dicom.SeriesInstanceUid,
|
dicom.SeriesInstanceUid,
|
||||||
];
|
];
|
||||||
|
@ -461,7 +495,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) {
|
if (res && index < 20) {
|
||||||
arr[index].path = res;
|
arr[index].path = res;
|
||||||
uploadDicom.successCount++;
|
uploadDicom.successCount++;
|
||||||
arr[index].isUpload = 2;
|
arr[index].isUpload = 2;
|
||||||
|
@ -475,15 +509,16 @@ export default {
|
||||||
uploadDicom.count) *
|
uploadDicom.count) *
|
||||||
100
|
100
|
||||||
);
|
);
|
||||||
if (
|
if (uploadDicom.schedule >= 100) {
|
||||||
uploadDicom.schedule >= 100 &&
|
if (uploadDicom.successCount === uploadDicom.count) {
|
||||||
uploadDicom.successCount === uploadDicom.count
|
uploadDicom.status = 1;
|
||||||
) {
|
if (!uploadDicom.Study) {
|
||||||
uploadDicom.status = 1;
|
let res = await this.formatDicom(arr, arr[index].StudyInstanceUid);
|
||||||
let res = await this.formatDicom(arr, arr[index].StudyInstanceUid);
|
if (res) {
|
||||||
if (res) {
|
uploadDicom.Study = res[arr[index].StudyId];
|
||||||
uploadDicom.Study = res[arr[index].StudyId];
|
uploadDicom.status = 3;
|
||||||
uploadDicom.status = 3;
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
res = await addOrUpdateArchiveTaskStudy(uploadDicom);
|
res = await addOrUpdateArchiveTaskStudy(uploadDicom);
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
|
@ -496,13 +531,19 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
uploadDicom.status = 5;
|
uploadDicom.status = 5;
|
||||||
}
|
}
|
||||||
let flag = this.uploadList.every((item) => item.status > 3);
|
let flag = this.dicomList.every((item) => item.isUpload > 1);
|
||||||
if (flag) this.isLoad = false;
|
if (flag) this.isLoad = false;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uploadDicom.status = 5;
|
uploadDicom.status = 5;
|
||||||
let flag = this.uploadList.every((item) => item.status > 3);
|
let flag = this.dicomList.every((item) => item.isUpload > 1);
|
||||||
if (flag) this.isLoad = false;
|
if (flag) this.isLoad = false;
|
||||||
}
|
}
|
||||||
|
} else if (
|
||||||
|
uploadDicom.count ===
|
||||||
|
uploadDicom.successCount + uploadDicom.failCount
|
||||||
|
) {
|
||||||
|
let flag = this.dicomList.every((item) => item.isUpload > 1);
|
||||||
|
if (flag) this.isLoad = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let ind = arr.findIndex((item) => !item.isUpload);
|
let ind = arr.findIndex((item) => !item.isUpload);
|
||||||
|
|
Loading…
Reference in New Issue