Эх сурвалжийг харах

fiex:新增学时审核多人操作提示

Tang 3 жил өмнө
parent
commit
bae9d52396

+ 35 - 5
src/views/education/classManageMent/classHoursReview/studyTimes.vue

@@ -1098,6 +1098,7 @@ export default {
       tableSetChild: [],
       copyDatas: {}, //记录点击信息
       statusPop: "", //1单个2批量
+      setTimeDOM: null, //定时器
       rules: {
         cheating_reason: [
           {
@@ -1147,11 +1148,32 @@ export default {
     },
   },
   created() {
-    this.getSetTime();
-    // 每10秒调用一次 锁定页面
-    setInterval(() => {
-      this.getSetTime();
-    }, 10000);
+    this.$api
+      .inquireGradegradelockPeriodStatus({
+        gradeId: Number(this.$route.query.id),
+        userId: Number(this.$route.query.userId),
+        goodsId: Number(this.$route.query.goodsId),
+      })
+      .then((res) => {
+        if (res.msg) {
+          this.$alert(`${res.msg}正在操作该页面,请关闭当前页`, "提示", {
+            dangerouslyUseHTMLString: true,
+            showClose: false,
+          }).then((result) => {
+            this.$store
+              .dispatch("tagsView/delView", this.$route)
+              .then((results) => {
+                this.$router.go(-1)
+              });
+          });
+        } else {
+          this.getSetTime();
+          // 每10秒调用一次 锁定页面
+          this.setTimeDOM = setInterval(() => {
+            this.getSetTime();
+          }, 10000);
+        }
+      });
   },
   async mounted() {
     await this.getUserInfo();
@@ -1749,6 +1771,14 @@ export default {
         checkedCount > 0 && checkedCount < this.getAllList.length;
     },
   },
+  /**
+   * 离开页面前销毁定时器
+   */
+  beforeDestroy() {
+    if (this.setTimeDOM) {
+      clearInterval(this.setTimeDOM);
+    }
+  },
 };
 </script>