Просмотр исходного кода

feat: 答案识别区设置逻辑调整

zhangjie 8 месяцев назад
Родитель
Сommit
f074df0b1a

+ 1 - 1
src/modules/client/api.js

@@ -34,5 +34,5 @@ export const getLevelList = examId => {
   return $get(`/api/level/${examId}`);
 };
 export const checkAdminPwd = password => {
-  return $post(`/api/level`, { password });
+  return $post(`/api/validAdminPassword`, { password });
 };

+ 38 - 31
src/modules/client/components/ScanAreaSteps.vue

@@ -31,6 +31,7 @@
 </template>
 
 <script>
+import { mapState } from "vuex";
 import CodeArea from "./steps/CodeArea.vue";
 import CoverArea from "./steps/CoverArea.vue";
 import ImageOrientation from "./steps/ImageOrientation.vue";
@@ -39,33 +40,6 @@ import TailorTailorArea from "./steps/TailorTailorArea.vue";
 import AnswerCheckArea from "./steps/AnswerCheckArea.vue";
 import { deepCopy, objTypeOf } from "../../../plugins/utils";
 
-const STEPS_LIST = [
-  {
-    name: "code-area",
-    title: "条形码区域"
-  },
-  {
-    name: "cover-area",
-    title: "信息覆盖区域设置"
-  },
-  {
-    name: "origin-tailor-area",
-    title: "原图切图设置"
-  },
-  {
-    name: "tailor-tailor-area",
-    title: "阅卷图切图设置"
-  },
-  {
-    name: "answer-check-area",
-    title: "是否作答检测区域"
-  },
-  {
-    name: "image-orientation",
-    title: "图片方向设置"
-  }
-];
-
 export default {
   name: "scan-area-steps",
   components: {
@@ -90,7 +64,7 @@ export default {
   },
   data() {
     return {
-      STEPS_LIST,
+      stepList: [],
       current: 0,
       nextHolder: true,
       dataReady: true,
@@ -98,14 +72,16 @@ export default {
     };
   },
   created() {
+    this.getSteps();
     this.newSetting = deepCopy(this.curSetting);
   },
   computed: {
+    ...mapState("client", ["clientConfig"]),
     currentComponent() {
-      return this.STEPS_LIST[this.current].name;
+      return this.stepList[this.current].name;
     },
     currentComponentTitle() {
-      return this.STEPS_LIST[this.current].title;
+      return this.stepList[this.current].title;
     },
     isFirstStep() {
       return this.current === 0;
@@ -114,10 +90,41 @@ export default {
       return this.current === this.lastStep;
     },
     lastStep() {
-      return this.STEPS_LIST.length - 1;
+      return this.stepList.length - 1;
     }
   },
   methods: {
+    getSteps() {
+      const steps = [
+        {
+          name: "code-area",
+          title: "条形码区域"
+        },
+        {
+          name: "cover-area",
+          title: "信息覆盖区域设置"
+        },
+        {
+          name: "origin-tailor-area",
+          title: "原图切图设置"
+        },
+        {
+          name: "tailor-tailor-area",
+          title: "阅卷图切图设置"
+        },
+        {
+          name: "answer-check-area",
+          title: "是否作答检测区域"
+        },
+        {
+          name: "image-orientation",
+          title: "图片方向设置"
+        }
+      ];
+      this.stepList = this.clientConfig.packageScan
+        ? steps.splice(4, 1)
+        : steps;
+    },
     prevStep() {
       if (this.isFirstStep) return;
       this.current -= 1;

+ 10 - 4
src/modules/client/views/Camera.vue

@@ -66,7 +66,7 @@ export default {
     };
   },
   computed: {
-    ...mapState("client", ["curSubject"])
+    ...mapState("client", ["curSubject", "clientConfig"])
   },
   methods: {
     ...mapMutations("client", ["setCamera"]),
@@ -83,9 +83,15 @@ export default {
 
       this.setCamera(this.modalForm.camera);
 
-      const routerName = this.curSubject.collectConfig
-        ? "ScanWait"
-        : "ScanArea";
+      let routerName = "ScanWait";
+      if (
+        !this.curSubject.collectConfig ||
+        (this.clientConfig.packageScan &&
+          !this.curSubject.collectConfig["answerCheckArea"])
+      ) {
+        routerName = "ScanArea";
+      }
+
       this.$router.push({ name: routerName });
     }
   }

+ 2 - 2
src/modules/client/views/ScanWait.vue

@@ -3,7 +3,7 @@
     <div class="action-list">
       <ul>
         <li @click="resetConfig">重新设置采集信息</li>
-        <li @click="tocCheckEncrypt">
+        <li @click="toCheckEncrypt">
           <Icon
             v-if="loading"
             class="ivu-load-loop mr-1"
@@ -56,7 +56,7 @@ export default {
 
       this.$router.push({ name: routerName });
     },
-    tocCheckEncrypt() {
+    toCheckEncrypt() {
       if (this.loading) return;
       this.exceptionIsConfirm = true;
       this.loading = true;