|
@@ -332,21 +332,27 @@ export default {
|
|
...mapMutations("invigilation", ["setDetailIds", "setSelectedExamId"]),
|
|
...mapMutations("invigilation", ["setDetailIds", "setSelectedExamId"]),
|
|
async initData() {
|
|
async initData() {
|
|
this.dataReady = false;
|
|
this.dataReady = false;
|
|
- await this.getExamBatchList();
|
|
|
|
- if (!this.examBatchs.length) return;
|
|
|
|
- this.updateSelectedExamId({
|
|
|
|
- exams: this.examBatchs,
|
|
|
|
- selectedExamId: this.selectedExamId,
|
|
|
|
- });
|
|
|
|
- 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 || {};
|
|
|
|
- await this.getExamActivityRoomList();
|
|
|
|
- this.toSearch();
|
|
|
|
- this.dataReady = true;
|
|
|
|
|
|
+ try {
|
|
|
|
+ await this.getExamBatchList();
|
|
|
|
+ if (!this.examBatchs.length) {
|
|
|
|
+ this.dataReady = true;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.updateSelectedExamId({
|
|
|
|
+ exams: this.examBatchs,
|
|
|
|
+ selectedExamId: this.selectedExamId,
|
|
|
|
+ });
|
|
|
|
+ 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 || {};
|
|
|
|
+ await this.getExamActivityRoomList();
|
|
|
|
+ this.toSearch();
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.dataReady = true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|
|
const datas = {
|
|
const datas = {
|