|
@@ -25,6 +25,7 @@
|
|
v-model:open="showProgressDialog"
|
|
v-model:open="showProgressDialog"
|
|
title="考生导入进度"
|
|
title="考生导入进度"
|
|
@cancel="progressClose"
|
|
@cancel="progressClose"
|
|
|
|
+ @ok="closeSubModal"
|
|
>
|
|
>
|
|
<p>{{ curFileName }}</p>
|
|
<p>{{ curFileName }}</p>
|
|
<a-progress :percent="progress" :status="progressStatus" />
|
|
<a-progress :percent="progress" :status="progressStatus" />
|
|
@@ -80,19 +81,19 @@ const submitHandle = () => {
|
|
const watchProgress = (obj: { taskId: string }) => {
|
|
const watchProgress = (obj: { taskId: string }) => {
|
|
if (!showProgressDialog.value) return;
|
|
if (!showProgressDialog.value) return;
|
|
importStuProgress(obj).then((res: any) => {
|
|
importStuProgress(obj).then((res: any) => {
|
|
- if (res?.progress == 100 && res?.success) {
|
|
|
|
|
|
+ progress.value = res.progress || 0;
|
|
|
|
+ if (res?.progress == 100 && res?.status === "SUCCESS") {
|
|
progressStatus.value = "success";
|
|
progressStatus.value = "success";
|
|
errMsg.value = "";
|
|
errMsg.value = "";
|
|
window.$message.success("导入成功");
|
|
window.$message.success("导入成功");
|
|
|
|
+ } else if (res?.status === "FAILED") {
|
|
|
|
+ progressStatus.value = "exception";
|
|
|
|
+ errMsg.value = res?.errMsg || "";
|
|
} else {
|
|
} else {
|
|
- if (res?.errMsg) {
|
|
|
|
- progressStatus.value = "exception";
|
|
|
|
- errMsg.value = res?.errMsg;
|
|
|
|
- } else {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- watchProgress(obj);
|
|
|
|
- }, 3000);
|
|
|
|
- }
|
|
|
|
|
|
+ progressStatus.value = "active";
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ watchProgress(obj);
|
|
|
|
+ }, 3000);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -104,5 +105,10 @@ const progressClose = () => {
|
|
const downloadTpl = () => {
|
|
const downloadTpl = () => {
|
|
exportStu({ examId: userStore.curExam?.id });
|
|
exportStu({ examId: userStore.curExam?.id });
|
|
};
|
|
};
|
|
|
|
+const closeSubModal = () => {
|
|
|
|
+ if (progressStatus.value === "success") {
|
|
|
|
+ visible.value = false;
|
|
|
|
+ }
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped></style>
|
|
<style lang="less" scoped></style>
|