Forráskód Böngészése

菜单tips数量获取调整

zhangjie 1 éve
szülő
commit
9d90f94faa

+ 5 - 0
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoring.vue

@@ -601,6 +601,11 @@ export default {
     async toSearch() {
       this.current = 1;
       await this.getList();
+      this.setCacheExamActivity({
+        examId: this.filter.examId,
+        examActivityId: this.filter.examActivityId,
+      });
+      this.$parent.$parent.timerUpdatePage();
     },
     async getMonitorCallCount() {
       if (!this.filter.examId) return;

+ 4 - 0
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoringFull.vue

@@ -200,6 +200,10 @@ export default {
       this.filter = Object.assign(this.filter, filter);
       this.curExamMonitorStatus = filter.monitorStatus;
       this.getList();
+      this.setCacheExamActivity({
+        examId: this.filter.examId,
+        examActivityId: this.filter.examActivityId,
+      });
     },
 
     /** 查询视频列表 */

+ 9 - 1
src/features/invigilation/WarningManage/WarningManage.vue

@@ -299,7 +299,10 @@ export default {
       "updateSelectedExamId",
       "fetchWarningManageCount",
     ]),
-    ...mapMutations("invigilation", ["setSelectedExamId"]),
+    ...mapMutations("invigilation", [
+      "setSelectedExamId",
+      "setCacheExamActivity",
+    ]),
     async initData() {
       this.dataReady = false;
       try {
@@ -342,6 +345,11 @@ export default {
       this.setSelectedExamId(this.filter.examId);
       this.current = 1;
       await this.getList();
+      this.setCacheExamActivity({
+        examId: this.filter.examId,
+        examActivityId: this.filter.examActivityId,
+      });
+      this.$parent.$parent.timerUpdatePage();
     },
     async getExamBatchList() {
       const userId = this.IS_INVIGILATE ? this.user.id : null;

+ 7 - 0
src/store/modules/invigilation.js

@@ -20,6 +20,10 @@ const state = {
       classes: "nav-item-tips-num",
     },
   },
+  cacheExamActivity: {
+    examId: "",
+    examActivityId: "",
+  },
   detailIds: [],
   detailFilterData: {},
   detailFilterFunc: null,
@@ -39,6 +43,9 @@ const mutations = {
   setReexamPending(state, val) {
     state.navTips.ReexamPending.val = val;
   },
+  setCacheExamActivity(state, cacheExamActivity) {
+    state.cacheExamActivity = cacheExamActivity;
+  },
   setDetailIds(state, detailIds) {
     state.detailIds = detailIds;
   },

+ 17 - 2
src/views/Layout/Layout.vue

@@ -17,7 +17,7 @@ import NavBar from "./components/NavBar.vue";
 import { sysMenu } from "@/api/system-user";
 import localMenu from "./components/menu";
 import { deepCopy } from "@/utils/utils";
-import { mapActions } from "vuex";
+import { mapState, mapActions } from "vuex";
 
 export default {
   name: "Layout",
@@ -38,6 +38,9 @@ export default {
       loopRunning: false,
     };
   },
+  computed: {
+    ...mapState("invigilation", ["cacheExamActivity"]),
+  },
   created() {
     // 禁止通过非session共享的方式打开系统页面
     if (!this.$store.state.user || !this.$store.state.user["id"]) {
@@ -152,10 +155,22 @@ export default {
       this.clearLoopSetTs();
       if (!this.loopRunning) return;
 
+      if (
+        !this.cacheExamActivity.examId ||
+        !this.cacheExamActivity.examActivityId
+      ) {
+        this.loopSetTs.push(
+          setTimeout(() => {
+            this.timerUpdatePage();
+          }, 10 * 1000)
+        );
+      }
+
       const user = this.$store.state.user;
-      const datas = user.roleCodes.includes("INVIGILATE")
+      let datas = user.roleCodes.includes("INVIGILATE")
         ? { userId: user.id }
         : {};
+      datas = { ...datas, ...this.cacheExamActivity };
 
       const fetchAll = this.loopFuncList.map((item) => item.call(this, datas));
       await Promise.all(fetchAll).catch(() => {});