瀏覽代碼

feat: 普通阅卷问题卷标记

zhangjie 2 月之前
父節點
當前提交
512e39cc7c

+ 27 - 1
src/features/mark/scoring/MarkBoardKeyBoard.vue

@@ -104,10 +104,10 @@
             >
               <transition-group name="score-number-animation" tag="span">
                 <span v-if="question.problem"> 问题卷 </span>
-                <span v-else-if="!question.selfMark">已评</span>
                 <span v-else-if="isArbitrated(question)">{{
                   getArbitratedStatusName(question)
                 }}</span>
+                <span v-else-if="!question.selfMark">已评</span>
                 <span
                   v-else
                   :key="`${question.mainNumber}_${question.subNumber}_${index}`"
@@ -124,6 +124,19 @@
         </div>
       </template>
     </div>
+    <div
+      v-if="
+        !markStore.historyOpen &&
+        markStore.currentQuestion?.problem &&
+        markStore.currentQuestion?.selfMark
+      "
+      class="board-footer"
+    >
+      <!-- 非回评下自己标记的问题卷才能取消 -->
+      <qm-button class="board-clear" @click="cancelProblem">
+        取消问题卷
+      </qm-button>
+    </div>
   </div>
 </template>
 
@@ -225,6 +238,11 @@ const questionScore = $computed(
 );
 
 function numberKeyListener(event: KeyboardEvent) {
+  if (
+    isDisabledQuestion(markStore.currentQuestion) ||
+    markStore.currentQuestion?.problem
+  )
+    return;
   // 只要修改了分值,就当做已修改
   hasModifyScore.value = true;
 
@@ -349,6 +367,14 @@ watch(
   }
 );
 
+function cancelProblem() {
+  if (!markStore.currentQuestion) return;
+
+  markStore.currentQuestion.problem = false;
+  markStore.currentQuestion.problemType = null;
+  markStore.currentQuestion.problemRemark = "";
+}
+
 function submit() {
   emit("submit");
 }

+ 31 - 12
src/features/mark/scoring/MarkBoardMouse.vue

@@ -82,20 +82,17 @@
                 {{ question.mainNumber }}-{{ question.subNumber }}
               </div>
             </div>
+            <div v-if="question.problem" class="question-score is-problem">
+              问题卷
+            </div>
             <div
-              v-if="isDisabledQuestion(question)"
-              :class="[
-                'question-score',
-                {
-                  'is-problem': question.problem || isArbitrated(question),
-                },
-              ]"
+              v-else-if="isArbitrated(question)"
+              class="question-score is-problem"
             >
-              <span v-if="question.problem"> 问题卷 </span>
-              <span v-else-if="!question.selfMark">已评</span>
-              <span v-else-if="isArbitrated(question)">{{
-                getArbitratedStatusName(question)
-              }}</span>
+              {{ getArbitratedStatusName(question) }}
+            </div>
+            <div v-else-if="!question.selfMark" class="question-score">
+              已评
             </div>
             <div v-else class="board-scores">
               <div
@@ -114,6 +111,20 @@
         </div>
       </template>
     </div>
+
+    <div
+      v-if="
+        !markStore.historyOpen &&
+        markStore.currentQuestion?.problem &&
+        markStore.currentQuestion?.selfMark
+      "
+      class="board-footer"
+    >
+      <!-- 非回评下自己标记的问题卷才能取消 -->
+      <qm-button class="board-clear" @click="cancelProblem">
+        取消问题卷
+      </qm-button>
+    </div>
   </div>
 </template>
 
@@ -195,6 +206,14 @@ function questionScoreSteps(question: Question) {
   return steps;
 }
 
+function cancelProblem() {
+  if (!markStore.currentQuestion) return;
+
+  markStore.currentQuestion.problem = false;
+  markStore.currentQuestion.problemType = null;
+  markStore.currentQuestion.problemRemark = "";
+}
+
 function submit() {
   emit("submit");
 }

+ 6 - 2
src/features/mark/scoring/MarkBoardTrack.vue

@@ -113,10 +113,10 @@
               ]"
             >
               <span v-if="question.problem" key="problem"> 问题卷 </span>
-              <span v-else-if="!question.selfMark">已评</span>
               <span v-else-if="isArbitrated(question)">{{
                 getArbitratedStatusName(question)
               }}</span>
+              <span v-else-if="!question.selfMark">已评</span>
               <span
                 v-else
                 :key="markStore.currentTask?.markResult?.scoreList[index] || 0"
@@ -173,7 +173,11 @@
       </qm-button>
 
       <qm-button
-        v-if="markStore.currentQuestion?.problem"
+        v-if="
+          !markStore.historyOpen &&
+          markStore.currentQuestion?.problem &&
+          markStore.currentQuestion?.selfMark
+        "
         class="board-clear"
         @click="cancelProblem"
       >

+ 16 - 0
src/styles/page.less

@@ -908,6 +908,22 @@
       min-height: 40px;
     }
   }
+
+  &.is-key-board,
+  &.is-mouse-board {
+    .board-footer {
+      flex: 1;
+      position: static;
+      bottom: 0;
+      left: 0;
+      right: 0;
+      padding-top: 16px;
+
+      .ant-btn {
+        margin: 0;
+      }
+    }
+  }
 }
 // mark-body
 .mark-body {