|
@@ -356,6 +356,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.loopRunning = true;
|
|
|
const user = this.$store.state.user;
|
|
|
this.IS_INSPECTION =
|
|
|
user.roleCodes.includes("INSPECTION") &&
|
|
@@ -380,12 +381,14 @@ export default {
|
|
|
this.clearLoopSetTs();
|
|
|
if (!this.loopRunning) return;
|
|
|
|
|
|
- await this.getList().catch(() => {});
|
|
|
- await this.$refs.SummaryLine.initData().catch(() => {});
|
|
|
+ let fetchAll = [this.getList()];
|
|
|
+ if (this.$refs.SummaryLine)
|
|
|
+ fetchAll.push(this.$refs.SummaryLine.initData());
|
|
|
if (!this.IS_INSPECTION) {
|
|
|
- await this.getMonitorCallCount().catch(() => {});
|
|
|
- await this.fetchWarningNotice().catch(() => {});
|
|
|
+ fetchAll.push(this.getMonitorCallCount());
|
|
|
+ fetchAll.push(this.fetchWarningNotice());
|
|
|
}
|
|
|
+ await Promise.all(fetchAll).catch(() => {});
|
|
|
|
|
|
this.loopSetTs.push(
|
|
|
setTimeout(() => {
|
|
@@ -399,7 +402,23 @@ export default {
|
|
|
this.curExamBatch = examBatch;
|
|
|
this.toSearch();
|
|
|
|
|
|
- this.timerUpdatePage();
|
|
|
+ if (!this.IS_INSPECTION) {
|
|
|
+ this.getMonitorCallCount();
|
|
|
+ this.fetchWarningNotice();
|
|
|
+ }
|
|
|
+ // 正在考试的考试,开启定时更新;
|
|
|
+ if (examBatch.isExaming) {
|
|
|
+ this.loopRunning = true;
|
|
|
+ this.clearLoopSetTs();
|
|
|
+ this.loopSetTs.push(
|
|
|
+ setTimeout(() => {
|
|
|
+ this.timerUpdatePage();
|
|
|
+ }, 10 * 1000)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.loopRunning = false;
|
|
|
+ this.clearLoopSetTs();
|
|
|
+ }
|
|
|
},
|
|
|
pageTypeChange(pageType) {
|
|
|
this.pageType = pageType;
|