|
@@ -175,6 +175,15 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <div v-if="IS_ADMIN" class="part-filter-form-action">
|
|
|
+ <el-button
|
|
|
+ :type="curExamIsOver ? 'success' : 'danger'"
|
|
|
+ icon="icon icon-over"
|
|
|
+ :disabled="!filter.examId"
|
|
|
+ @click="finishInvigilationExam"
|
|
|
+ >{{ curExamIsOver ? "恢复监考" : "结束监考" }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="part-filter-info">
|
|
@@ -248,6 +257,7 @@ import {
|
|
|
examActivityRoomList,
|
|
|
invigilationHistoryList,
|
|
|
exportInvigilationHistory,
|
|
|
+ invigilateExamFinish,
|
|
|
} from "@/api/invigilation";
|
|
|
import { downloadBlob } from "@/utils/utils";
|
|
|
import {
|
|
@@ -278,6 +288,7 @@ export default {
|
|
|
maxWarningCount: undefined,
|
|
|
minWarningCount: undefined,
|
|
|
},
|
|
|
+ curExamBatch: {},
|
|
|
STUDENT_FINISH_EXAM_TYPE,
|
|
|
STUDENT_ONLINE_STATUS,
|
|
|
STUDENT_BEHAVIOR_STATUS,
|
|
@@ -291,6 +302,7 @@ export default {
|
|
|
examCourses: [],
|
|
|
dataList: [],
|
|
|
isDownload: false,
|
|
|
+ IS_ADMIN: this.$store.state.user.roleCodes.includes("ADMIN"),
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -301,6 +313,9 @@ export default {
|
|
|
IS_INVIGILATE() {
|
|
|
return this.user.roleCodes.includes("INVIGILATE");
|
|
|
},
|
|
|
+ curExamIsOver() {
|
|
|
+ return this.curExamBatch && this.curExamBatch.monitorStatus === "END";
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initData();
|
|
@@ -317,6 +332,10 @@ export default {
|
|
|
});
|
|
|
this.filter.examId = this.selectedExamId;
|
|
|
// this.filter.examId = this.examBatchs[0] && this.examBatchs[0].id;
|
|
|
+ const curExamBatch = this.examBatchs.find(
|
|
|
+ (item) => item.id === this.filter.examId
|
|
|
+ );
|
|
|
+ this.curExamBatch = curExamBatch || {};
|
|
|
this.toSearch();
|
|
|
this.getExamActivityRoomList();
|
|
|
},
|
|
@@ -378,6 +397,11 @@ export default {
|
|
|
this.examCourses = res.data.data.examCourses;
|
|
|
},
|
|
|
examChange() {
|
|
|
+ const curExamBatch = this.examBatchs.find(
|
|
|
+ (item) => item.id === this.filter.examId
|
|
|
+ );
|
|
|
+ this.curExamBatch = curExamBatch || {};
|
|
|
+
|
|
|
this.filter.examActivityId = null;
|
|
|
this.filter.roomCode = null;
|
|
|
this.filter.courseCode = null;
|
|
@@ -403,6 +427,24 @@ export default {
|
|
|
params: { examRecordId: row.examRecordId },
|
|
|
});
|
|
|
},
|
|
|
+ async finishInvigilationExam() {
|
|
|
+ const actionName = this.curExamIsOver ? "恢复监考" : "结束监考";
|
|
|
+ const result = await this.$confirm(`确定要${actionName}吗?`, "确认提醒", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ iconClass: "el-icon-warning",
|
|
|
+ customClass: "el-message-box__error",
|
|
|
+ }).catch(() => {});
|
|
|
+
|
|
|
+ if (!result) return;
|
|
|
+
|
|
|
+ await invigilateExamFinish(this.filter.examId);
|
|
|
+ this.$refs.ExamBatchDialog.getExamList();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!",
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|