Ver Fonte

feat: 评卷参数设置-试卷结构及分组

zhangjie há 1 ano atrás
pai
commit
c394e8f77c

+ 1 - 1
src/modules/mark/components/markParam/MarkParamGroup.vue

@@ -11,9 +11,9 @@
         <p class="tips-info tips-error">3.开始阅卷后不允许删除评卷分组!</p>
       </div>
       <div>
-        <span>分班阅卷</span>
         <el-switch
           v-model="markClassIsOpen"
+          active-text="分班阅卷"
           @change="markClassChange"
         ></el-switch>
         <el-button class="ml-2" type="primary" @click="toAdd">新增</el-button>

+ 7 - 6
src/modules/mark/components/markParam/MarkParamStructure.vue

@@ -12,8 +12,7 @@
       </div>
 
       <div v-if="checkPrivilege('link', 'EditPaperStruct')">
-        <span>开启编辑:</span>
-        <el-switch v-model="editOpen" style="margin-top: -4px"></el-switch>
+        <el-switch v-model="editOpen" active-text="开启编辑"></el-switch>
       </div>
     </div>
 
@@ -226,7 +225,7 @@
 </template>
 
 <script>
-import { calcSum } from "@/plugins/utils";
+import { calcSum, maxNum } from "@/plugins/utils";
 import { QUESTION_TYPE_LIST } from "@/constants/enumerate";
 import { mapState, mapMutations } from "vuex";
 import { markStructureSave } from "../../api";
@@ -365,22 +364,25 @@ export default {
       }
       if (nextMainStartPos === null) return this.tableData.length;
     },
+    getNewMainNumber() {
+      return maxNum(this.tableData.map((item) => item.mainNumber)) + 1;
+    },
     toAddMain(row) {
       const startPos = this.tableData.findIndex((item) => item.key === row.key);
       const nextMainStartPos = this.getNextMainStartPos(startPos, row.mainId);
+
       this.tableData.splice(
         nextMainStartPos,
         0,
         this.getNewRow({
           mainId: this.$randomCode(),
-          mainNumber: row.mainNumber + 1,
+          mainNumber: this.getNewMainNumber(),
           totalScore: row.totalScore,
           questionType: row.questionType,
           objective: row.objective,
         })
       );
       this.$set(this.intervalScorePerTopic, row.mainId, undefined);
-      this.updateMainData();
     },
     updateMainData() {
       let curMainNumber = 0,
@@ -438,7 +440,6 @@ export default {
           item.mainFirstSub = !index;
         });
       this.updateSubData(row.mainId);
-      this.updateMainData();
     },
     switchExpandSub(row) {
       row.expandSub = !row.expandSub;

+ 6 - 1
src/modules/mark/components/markParam/ModifyMarkGroup.vue

@@ -168,7 +168,11 @@
                     ></el-checkbox>
                   </div>
                   <div
-                    v-if="mainItem.children && mainItem.children.length"
+                    v-if="
+                      mainItem.children &&
+                      mainItem.children.length &&
+                      mainItem.questionType !== 4
+                    "
                     class="struct-questions"
                   >
                     <template v-if="canSelectQuestion">
@@ -550,6 +554,7 @@ export default {
           struct = {
             mainTitle: item.mainTitle,
             mainNumber: item.mainNumber,
+            questionType: item.questionType,
             selected: false,
             children: [],
           };