Przeglądaj źródła

feat: 评卷设置页面防抖动调整

zhangjie 2 miesięcy temu
rodzic
commit
e5b362cde8

+ 20 - 2
src/modules/mark/components/markParam/MarkParamGroup.vue

@@ -28,7 +28,7 @@
         <el-table-column label="小题号" prop="subNumber" width="80">
         </el-table-column>
         <el-table-column label="评卷员" min-width="200">
-          <template slot-scope="scope">
+          <template slot-scope="scope" v-if="markerEditValid(scope)">
             <el-tag
               v-for="user in scope.row.markers"
               :key="user.markUserQuestionId"
@@ -205,7 +205,7 @@ export default {
       paperList: [],
       cardPages: [],
       fillQuestionRanges: [],
-      tableHeight: 200,
+      tableHeight: 300,
     };
   },
   computed: {
@@ -311,6 +311,24 @@ export default {
         }
       }
     },
+    markerEditValid({ row, $index }) {
+      if (this.openMergeMarker && row.questionType === 4) {
+        const range = this.fillQuestionRanges.find((item) =>
+          item.includes($index)
+        );
+        if (!range) return;
+        // 填空题大题的第一道试题才显示评卷员设置按钮
+        // 做这个的目的视为了防止表格在合并单元格过程中的页面抖动
+        const firstRow = range.indexOf($index);
+        if (firstRow === $index) {
+          return true;
+        } else {
+          return false;
+        }
+      } else {
+        return true;
+      }
+    },
     getCurrentQuestions(row) {
       let curRowQuestions = [];
       if (this.openMergeMarker && row.questionType === 4) {