fix:外部考试导入成绩参数调整

This commit is contained in:
wyx
2023-02-10 17:07:33 +08:00
parent 63641d55b7
commit 962f55dee5
3 changed files with 31 additions and 15 deletions

View File

@@ -37,7 +37,7 @@
:showUploadList="false" :showUploadList="false"
:data="{ :data="{
type: type, type: type,
targetId: Number(id), targetId: Number(targetId),
chapterId:chapterId, chapterId:chapterId,
taskId:taskId taskId:taskId
}" }"
@@ -250,6 +250,7 @@
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("closeDraw",true);
ctx.emit("update:eScorevisibleExternalExternal", false); ctx.emit("update:eScorevisibleExternalExternal", false);
state.fileList = []; state.fileList = [];
state.uploadpercent = -1; state.uploadpercent = -1;
@@ -286,6 +287,13 @@
if (status === "done") { if (status === "done") {
state.fileName = info.file.name; state.fileName = info.file.name;
let i = 0; let i = 0;
let timeouts = setTimeout(() => {
clearInterval(timer)
state.addLoading = false;
message.destroy();
message.error(`文件导入超时`);
}, 30000);
let timer = setInterval(() => { let timer = setInterval(() => {
let uid = info.file.response.data; let uid = info.file.response.data;
api api
@@ -306,25 +314,18 @@
state.downloadErrUrl = res.data.data.url; state.downloadErrUrl = res.data.data.url;
console.log("props.getStudent", props.getStudent); console.log("props.getStudent", props.getStudent);
clearInterval(timer); clearInterval(timer);
clearTimeout(timeouts);
} }
}else{
state.addLoading = false;
message.destroy();
message.error(`文件导入超时`);
} }
}) })
.catch((err) => { .catch((err) => {
state.addLoading = false; state.addLoading = false;
clearInterval(timer); clearInterval(timer);
clearTimeout(timeouts);
console.log("查询导入状态失败", err); console.log("查询导入状态失败", err);
}); });
}, 500); }, 500);
setTimeout(() => {
clearInterval(timer)
state.addLoading = false;
message.destroy();
message.error(`文件导入超时`);
}, 30000);
} else if (status === "error") { } else if (status === "error") {
state.uploadErr = true; state.uploadErr = true;
message.error(`${info.file.name}上传失败`); message.error(`${info.file.name}上传失败`);

View File

@@ -116,10 +116,11 @@
</div> </div>
<!-- 导出成绩抽屉 --> <!-- 导出成绩抽屉 -->
<ExportAchievement <ExportAchievement
@closeDraw="closeDraw"
v-model:eScorevisibleExternalExternal="eScorevisibleExternalExternal" v-model:eScorevisibleExternalExternal="eScorevisibleExternalExternal"
:type="2" :type="2"
:targetId="datasource.projectId" :targetId="datasource.projectId"
:taskId="datasource.projectTaskId" :taskId="datasource.courseId"
:chapterId="datasource.stageId" /> :chapterId="datasource.stageId" />
</a-drawer> </a-drawer>
</template> </template>
@@ -368,6 +369,7 @@
// 获取数据 // 获取数据
function getData() { function getData() {
state.loadingData = true;
api.QueryExternalExamManageDetail({ api.QueryExternalExamManageDetail({
chapterId: props.datasource.stageId, chapterId: props.datasource.stageId,
pageNo: state.currentPage, 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}`) 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 { return {
...toRefs(state), ...toRefs(state),
selectProjectName, selectProjectName,
@@ -422,7 +429,8 @@
searchTableData, searchTableData,
reseatTableData, reseatTableData,
changePaginationStu, changePaginationStu,
exportData exportData,
closeDraw
}; };
}, },
}; };

View File

@@ -115,10 +115,11 @@
</div> </div>
<!-- 导出成绩抽屉 --> <!-- 导出成绩抽屉 -->
<ExportAchievement <ExportAchievement
@closeDraw="closeDraw"
v-model:eScorevisibleExternalExternal="eScorevisibleExternalExternal" v-model:eScorevisibleExternalExternal="eScorevisibleExternalExternal"
:type="1" :type="1"
:targetId="datasource.routerId" :targetId="datasource.routerId"
:taskId="datasource.routerTaskId" :taskId="datasource.courseId"
:chapterId="datasource.chapterId" /> :chapterId="datasource.chapterId" />
</a-drawer> </a-drawer>
</template> </template>
@@ -368,9 +369,14 @@
const clearLine = () => { const clearLine = () => {
state.selectedRowKeys = []; state.selectedRowKeys = [];
}; };
const closeDraw = (e) => {
console.log('我关闭了导入成绩弹框吗', e)
getData();
}
// 获取数据 // 获取数据
function getData() { function getData() {
state.loadingData = true;
api.QueryExternalExamManageDetail({ api.QueryExternalExamManageDetail({
chapterId: props.datasource.chapterId, chapterId: props.datasource.chapterId,
pageNo: state.currentPage, pageNo: state.currentPage,
@@ -425,7 +431,8 @@
searchTableData, searchTableData,
reseatTableData, reseatTableData,
changePaginationStu, changePaginationStu,
exportData exportData,
closeDraw
}; };
}, },
}; };