diff --git a/src/api/student.ts b/src/api/student.ts index 51084d8..f1705b8 100644 --- a/src/api/student.ts +++ b/src/api/student.ts @@ -82,3 +82,24 @@ export function PosititonIds(data:any[]) { data }); } +/** + * @description 导入表单 + * @return {object} + */ +export function ImportUpdateStudent(file: File) { + let formData = new FormData(); + formData.append("file", file); + return http.request( + "post", + `Student/ImportUpdateStudent`, + { + data: formData + }, + { + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + responseType: "blob" + } + ); +} \ No newline at end of file diff --git a/src/views/exam/classDetails.vue b/src/views/exam/classDetails.vue index 8644ce0..dec216e 100644 --- a/src/views/exam/classDetails.vue +++ b/src/views/exam/classDetails.vue @@ -117,7 +117,7 @@ const tableData: TableConfig = intTableData({ selectRows: [], }); -async function deleteInfo(o, row, c) { +async function deleteInfo(o, row, baseRefresh) { try { await ElMessageBox.confirm("是否删除考试信息?", "提示", { confirmButtonText: "确定", @@ -125,11 +125,12 @@ async function deleteInfo(o, row, c) { type: "warning", }); await DeleteExamInfo({ examId: row[0].examId, classId: row[0].classId }); + baseRefresh(); } catch (error) { ElMessage.info("取消删除"); } } -async function reloadImportInfo(o, row, c) { +async function reloadImportInfo(o, row, baseRefresh) { try { await ElMessageBox.confirm("是否重新录入考试信息?", "提示", { confirmButtonText: "确定", @@ -138,6 +139,7 @@ async function reloadImportInfo(o, row, c) { }); await DeleteExamInfo({ examId: row[0].examId, classId: row[0].classId }); entryExamInfo(row[0].examId); + baseRefresh(); } catch (error) { ElMessage.info("取消重新录入"); } diff --git a/src/views/student/index.vue b/src/views/student/index.vue index 69c08f0..8bd6b01 100644 --- a/src/views/student/index.vue +++ b/src/views/student/index.vue @@ -42,12 +42,7 @@ - + 导出用户 --> + 使用Excel模板更新用户
@@ -99,26 +97,17 @@