diff --git a/src/components/drawers/ExportAchievement.vue b/src/components/drawers/ExportAchievement.vue index 50a60742..efe4e941 100644 --- a/src/components/drawers/ExportAchievement.vue +++ b/src/components/drawers/ExportAchievement.vue @@ -37,7 +37,7 @@ :showUploadList="false" :data="{ type: type, - targetId: Number(id), + targetId: Number(targetId), chapterId:chapterId, taskId:taskId }" @@ -250,6 +250,7 @@ template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE }); const closeDrawer = () => { + ctx.emit("closeDraw",true); ctx.emit("update:eScorevisibleExternalExternal", false); state.fileList = []; state.uploadpercent = -1; @@ -286,6 +287,13 @@ if (status === "done") { state.fileName = info.file.name; let i = 0; + let timeouts = setTimeout(() => { + clearInterval(timer) + state.addLoading = false; + message.destroy(); + message.error(`文件导入超时`); + }, 30000); + let timer = setInterval(() => { let uid = info.file.response.data; api @@ -306,25 +314,18 @@ state.downloadErrUrl = res.data.data.url; console.log("props.getStudent", props.getStudent); clearInterval(timer); + clearTimeout(timeouts); } - }else{ - state.addLoading = false; - message.destroy(); - message.error(`文件导入超时`); } }) .catch((err) => { state.addLoading = false; clearInterval(timer); + clearTimeout(timeouts); console.log("查询导入状态失败", err); }); }, 500); - setTimeout(() => { - clearInterval(timer) - state.addLoading = false; - message.destroy(); - message.error(`文件导入超时`); - }, 30000); + } else if (status === "error") { state.uploadErr = true; message.error(`${info.file.name}上传失败`); diff --git a/src/components/drawers/project/ProjectExternalExamManage.vue b/src/components/drawers/project/ProjectExternalExamManage.vue index 0c803a56..cdeb5c3d 100644 --- a/src/components/drawers/project/ProjectExternalExamManage.vue +++ b/src/components/drawers/project/ProjectExternalExamManage.vue @@ -116,10 +116,11 @@ @@ -368,6 +369,7 @@ // 获取数据 function getData() { + state.loadingData = true; api.QueryExternalExamManageDetail({ chapterId: props.datasource.stageId, pageNo: state.currentPage, @@ -410,6 +412,11 @@ window.open(`${process.env.VUE_APP_BASE_API}/admin/external/exam/manage/exportExternalExam?chapterId=${props.datasource.stageId}&type=${2}&targetId=${props.datasource.projectId}&taskId=${props.datasource.projectTaskId}`) } + const closeDraw = (e) => { + console.log('我关闭了导入成绩弹框吗', e) + getData(); + } + return { ...toRefs(state), selectProjectName, @@ -422,7 +429,8 @@ searchTableData, reseatTableData, changePaginationStu, - exportData + exportData, + closeDraw }; }, }; diff --git a/src/components/drawers/router/RouterExaminationExternalManage.vue b/src/components/drawers/router/RouterExaminationExternalManage.vue index 6a88cf5b..69c05627 100644 --- a/src/components/drawers/router/RouterExaminationExternalManage.vue +++ b/src/components/drawers/router/RouterExaminationExternalManage.vue @@ -115,10 +115,11 @@ @@ -368,9 +369,14 @@ const clearLine = () => { state.selectedRowKeys = []; }; + const closeDraw = (e) => { + console.log('我关闭了导入成绩弹框吗', e) + getData(); + } // 获取数据 function getData() { + state.loadingData = true; api.QueryExternalExamManageDetail({ chapterId: props.datasource.chapterId, pageNo: state.currentPage, @@ -425,7 +431,8 @@ searchTableData, reseatTableData, changePaginationStu, - exportData + exportData, + closeDraw }; }, };