zhangjie 4 yıl önce
ebeveyn
işleme
16a54e8504

+ 24 - 2
src/components/common/ImagePreview/ImagePreview.vue

@@ -161,8 +161,27 @@ export default {
       this.curFileChange(this.curIndex);
     },
     visibleChange(visible) {
-      if (!visible) return;
-      this.initData();
+      if (visible) {
+        this.initData();
+      } else {
+        this.curFile = { name: "", imgSrc: null };
+        this.curIndex = 0;
+        this.styles = {
+          width: "",
+          height: "",
+          top: "",
+          left: "",
+          transform: ""
+        };
+        this.transform = {
+          scale: 1,
+          rotate: 0
+        };
+        this.preLoadFiles = [];
+        this.loading = false;
+        clearTimeout(this.loadingSetT);
+        this.nosition = false;
+      }
     },
     curFileChange(val) {
       this.$emit("on-paper-change", val);
@@ -355,6 +374,9 @@ export default {
         }, 200);
       }
     }
+  },
+  beforeDestroy() {
+    if (this.loadingSetT) clearTimeout(this.loadingSetT);
   }
 };
 </script>

+ 11 - 3
src/modules/grading/Grading.vue

@@ -5,7 +5,7 @@
         <div class="grading-title">
           <h1>{{ curSubject.name }}</h1>
           <span>当前阶段:{{ stepName }}</span
-          ><span v-if="!IS_SCORE">进度:{{ stepProgress }}</span>
+          ><span>进度:{{ stepProgress }}</span>
         </div>
         <div class="home-navs">
           <ul>
@@ -78,7 +78,6 @@ export default {
       curSubject: { name: "" },
       SUBJECT_STAGE,
       IS_ADMIN: true,
-      IS_SCORE: false,
       stepName: "",
       stepProgress: ""
     };
@@ -99,7 +98,16 @@ export default {
     async initData() {
       if (this.IS_ADMIN) {
         this.curSubject = await subjectDetail(this.subjectId);
-        this.IS_SCORE = this.curSubject.stage === "SCORE";
+        if (this.curSubject.stage === "SCORE") {
+          this.$router.replace({
+            name: "Mark",
+            params: {
+              workId: this.subjectId.split("-")[0],
+              subjectId: this.subjectId
+            }
+          });
+          return;
+        }
         this.getProgressDetail();
         this.stepName =
           this.curSubject.test === 2

+ 7 - 1
src/modules/grading/components/ModifyLeaderGrading.vue

@@ -26,7 +26,10 @@
           >
         </div>
       </RadioGroup>
-      <div class="leader-markers" v-if="actionType === 'reject'">
+      <div
+        class="leader-markers"
+        v-if="actionType === 'reject' && !noneedLevelOrReject"
+      >
         <CheckboxGroup v-model="selectedMarkers">
           <Checkbox
             v-for="marker in markers"
@@ -95,6 +98,9 @@ export default {
     visibleChange(visible) {
       if (visible) {
         this.initData(this.instance);
+      } else {
+        this.isSubmit = false;
+        this.actionType = null;
       }
     },
     cancel() {

+ 1 - 0
src/modules/main/StudentManage.vue

@@ -116,6 +116,7 @@
             size="small"
             class="btn-form-search"
             type="primary"
+            :disabled="!filter.areaCode || !filter.school || !filter.examRoom"
             @click="toPage(1)"
             >查询</Button
           >

+ 10 - 0
src/modules/mark/MarkHome.vue

@@ -94,6 +94,16 @@ export default {
   methods: {
     async initData() {
       this.curSubject = await subjectDetail(this.subjectId);
+      if (this.curSubject.stage === "LEVEL") {
+        this.$router.replace({
+          name: "Grading",
+          params: {
+            workId: this.subjectId.split("-")[0],
+            subjectId: this.subjectId
+          }
+        });
+        return;
+      }
       this.buildNavs();
       this.actSubNav();
     },

+ 19 - 2
src/plugins/axios.js

@@ -1,8 +1,11 @@
 import axios from "axios";
 import qs from "qs";
 import ViewUI from "view-design";
-// import router from "../routers";
-// import Vue from "vue";
+import router from "../routers";
+import Vue from "vue";
+
+// 防止鉴权失效之后多次弹窗。
+let unauthMsgBoxIsShow = false;
 
 /**
  * errorCallback 请求失败的回调
@@ -13,6 +16,20 @@ const errorCallback = error => {
   if (error.response) {
     content =
       (error.response.data && error.response.data.message) || "服务错误";
+
+    if (error.response.status === 401) {
+      if (unauthMsgBoxIsShow) return error;
+      unauthMsgBoxIsShow = true;
+      ViewUI.Modal.error({
+        content: "身份验证失效,请重新登录!",
+        onOk: () => {
+          unauthMsgBoxIsShow = false;
+          Vue.ls.clear();
+          router.push({ name: "Login" });
+        }
+      });
+      return error;
+    }
   } else if (error.request) {
     content = "请求错误";
     if (error.message.indexOf("timeout") > -1) {