zhangjie 1 maand geleden
bovenliggende
commit
ed99deef12
1 gewijzigde bestanden met toevoegingen van 23 en 3 verwijderingen
  1. 23 3
      src/modules/mark/components/markParam/ModifyMarkParams.vue

+ 23 - 3
src/modules/mark/components/markParam/ModifyMarkParams.vue

@@ -121,11 +121,12 @@ export default {
       curStepIndex: 0,
       finishedSteps: [],
       questionSubmit: false,
+      openClassReading: true,
     };
   },
   computed: {
     currentComponent() {
-      return `mark-param-${this.curStep.val}`;
+      return `mark-param-${this.curStep?.val || "structure"}`;
     },
     curStep() {
       return this.steps[this.curStepIndex];
@@ -140,6 +141,13 @@ export default {
       return this.steps.length - 1;
     },
   },
+  created() {
+    this.openClassReading = this.checkPrivilege(
+      "button",
+      "OpenClassReading",
+      "MarkSetting"
+    );
+  },
   methods: {
     ...mapMutations("markParam", [
       "setBasicInfo",
@@ -215,6 +223,10 @@ export default {
       }
 
       this.steps = steps.map((step, index) => {
+        if (!this.openClassReading && index === 2) {
+          step.disabled = true;
+          return step;
+        }
         step.status =
           index < this.curStepIndex
             ? "success"
@@ -250,7 +262,11 @@ export default {
         return;
       }
 
-      const nextStepIndex = this.curStepIndex + step;
+      let nextStepIndex = this.curStepIndex + step;
+      // 关闭分班阅,直接跳过
+      if (!this.openClassReading && nextStepIndex === 2) {
+        nextStepIndex += 1;
+      }
       if (nextStepIndex > this.lastStep) return;
       this.steps[this.curStepIndex].status = "success";
       if (!this.finishedSteps.includes(this.curStepIndex)) {
@@ -265,7 +281,11 @@ export default {
     },
     prevHandler(step = 1) {
       if (this.isFirstStep) return;
-      const prevStepIndex = this.curStepIndex - step;
+      let prevStepIndex = this.curStepIndex - step;
+      // 关闭分班阅,直接跳过
+      if (!this.openClassReading && prevStepIndex === 2) {
+        prevStepIndex -= 1;
+      }
       if (prevStepIndex < 0) return;
 
       this.steps[this.curStepIndex].status = this.finishedSteps.includes(