|
@@ -19,7 +19,9 @@
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row class="d-flex justify-content-center">
|
|
|
- <el-button type="primary" @click="submitForm">导入</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" :loading="loading"
|
|
|
+ >导入</el-button
|
|
|
+ >
|
|
|
<el-button @click="closeDialog">取消</el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -49,6 +51,7 @@ export default {
|
|
|
fileName: "",
|
|
|
},
|
|
|
rules: {},
|
|
|
+ loading: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -76,15 +79,20 @@ export default {
|
|
|
const ab = await blobToArray(this.form.file);
|
|
|
const md5 = MD5(ab);
|
|
|
|
|
|
- await importExamStudent({
|
|
|
- examId: this.examId,
|
|
|
- file: this.form.file,
|
|
|
- fileName: this.form.fileName,
|
|
|
- md5,
|
|
|
- });
|
|
|
- this.$emit("reload");
|
|
|
- this.$notify({ title: "导入任务已成功启动", type: "success" });
|
|
|
- this.closeDialog();
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ await importExamStudent({
|
|
|
+ examId: this.examId,
|
|
|
+ file: this.form.file,
|
|
|
+ fileName: this.form.fileName,
|
|
|
+ md5,
|
|
|
+ });
|
|
|
+ this.$emit("reload");
|
|
|
+ this.$notify({ title: "导入任务已成功启动", type: "success" });
|
|
|
+ this.closeDialog();
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|