Kaynağa Gözat

找到分数置为0的原因了

Michael Wang 4 yıl önce
ebeveyn
işleme
312306e2bb

+ 3 - 1
src/features/mark/MarkBody.vue

@@ -432,6 +432,7 @@ export default defineComponent({
     watch(
       () => store.currentMarkResult?.trackList,
       () => {
+        if (store.setting.mode !== ModeEnum.TRACK) return;
         const markResult = findCurrentTaskMarkResult();
         if (markResult && store.currentMarkResult) {
           const scoreGroups = groupBy(
@@ -460,7 +461,8 @@ export default defineComponent({
           //   scoreList
           // );
           const cq = store.currentQuestion;
-          if (cq) {
+          // 当无轨迹时,不更新
+          if (cq && markResult.trackList.length > 0) {
             cq.score =
               markResult.trackList
                 .filter(

+ 3 - 3
src/features/mark/use/autoChooseFirstQuestion.ts

@@ -14,10 +14,10 @@ export function autoChooseFirstQuestion() {
       // FIXME: 此时取到的还是score:null,但是 chooseQuestion之后就变成了score:0
       const firstQuestion = store.currentTask?.questionList[0];
       if (firstQuestion) {
-        const oldScore = firstQuestion.score;
-        console.log(oldScore);
+        // const oldScore = firstQuestion.score;
+        // console.log(oldScore);
         chooseQuestion(firstQuestion);
-        setTimeout(() => (firstQuestion.score = oldScore), 0);
+        // setTimeout(() => (firstQuestion.score = oldScore), 0);
       }
     }
   );