From 8eb8ca5b2d8838c8abb544c44af49c2427c9e325 Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期五, 03 一月 2025 17:43:26 +0800
Subject: [PATCH] ceshi1

---
 src/books/aviationEtiquette/view/components/chapter003.vue |   64 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/src/books/aviationEtiquette/view/components/chapter003.vue b/src/books/aviationEtiquette/view/components/chapter003.vue
index dfc5e2a..dcdf01b 100644
--- a/src/books/aviationEtiquette/view/components/chapter003.vue
+++ b/src/books/aviationEtiquette/view/components/chapter003.vue
@@ -465,7 +465,7 @@
               value="1"
               id="1"
               :disabled="evaluation.isComplete"
-              v-model="evaluation.evaluationThreeValue.Two"
+              v-model="evaluation.evaluationThreeValue.two"
               @change="setEvaluation"
             />A.鐩存帴鍐插埌閭d釜鍚屼簨闈㈠墠锛屽拰浠栧ぇ鍚典竴椤�</p>
           <p class="block"><input
@@ -474,7 +474,7 @@
               value="2"
               id="1"
               :disabled="evaluation.isComplete"
-              v-model="evaluation.evaluationThreeValue.Two"
+              v-model="evaluation.evaluationThreeValue.two"
               @change="setEvaluation"
             />B.鍚戦瀵艰鏄庢儏鍐碉紝璇烽瀵艰皟鏌ョ湡鐩�</p>
           <p class="block"><input
@@ -483,7 +483,7 @@
               value="3"
               id="1"
               :disabled="evaluation.isComplete"
-              v-model="evaluation.evaluationThreeValue.Two"
+              v-model="evaluation.evaluationThreeValue.two"
               @change="setEvaluation"
             />C.娓呰�呰嚜娓咃紝涓嶅幓鐞嗙潿锛屽拰浠ュ墠涓�鏍峰共濂藉伐浣�</p>
           <p class="block">3.濡傛灉鐖舵瘝鎬ф牸涓嶅悎锛岀粡甯稿惖鏋讹紝浣犱細鎬庝箞鍔烇紵</p>
@@ -2276,9 +2276,9 @@
           twelve: "",
         }, //娴嬭瘎绛旀
       },
-      evaluatioThreeResults: 0, //娴嬭瘎缁撴灉
-      evaluationFourResults: 0, //娴嬭瘎缁撴灉
-      evaluationFiveResults: 0, //娴嬭瘎缁撴灉
+      evaluatioThreeResults: '', //娴嬭瘎缁撴灉
+      evaluationFourResults: '', //娴嬭瘎缁撴灉
+      evaluationFiveResults: '', //娴嬭瘎缁撴灉
       
     };
   },
@@ -2292,6 +2292,12 @@
     }
 
     //娴嬭瘯
+    const evaluationData = localStorage.getItem(
+      "aviationEtiquette-book-evaluation-chapter003"
+    );
+    if (evaluationData) {
+      this.evaluation = JSON.parse(evaluationData);
+    }
     const evaluationThreeData = localStorage.getItem(
       "aviationEtiquette-book-evaluation-three"
     );
@@ -2333,59 +2339,93 @@
 
     goCheckThree(){
       let obj = 0
+      let index = 0
       for (let key in this.evaluation.evaluationThreeValue) {
-        if (this.evaluation.evaluationThreeValue[key] != '') {
+        if (this.evaluation.evaluationThreeValue[key] !== '') {
           let cont = Number(this.evaluation.evaluationThreeValue[key])
           obj = obj + cont
+        }else{
+          index ++ 
         }
       }
-      if(obj){
+      console.log(index,this.evaluation.evaluationThreeValue)
+      if(index > 0 || Object.keys(this.evaluation.evaluationThreeValue).length < 10) {
+        this.$message({
+            message: "鎮ㄨ繕鏈夐鐩湭閫夋嫨绛旀",
+            type: "warning"
+          });
+          return;
+      }else{
         this.evaluatioThreeResults = obj
         this.evaluation.showCheckAnswerThree = true
+        localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
         localStorage.setItem("aviationEtiquette-book-evaluation-three",this.evaluatioThreeResults);
       }
     },
     changeCheckThree(){
       this.evaluatioThreeResults = ''
       this.evaluation.evaluationThreeValue = {}
+      localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
       localStorage.removeItem("aviationEtiquette-book-evaluation-three");
     },
     goCheckFour(){
       let obj = 0
+      let index = 0
       for (let key in this.evaluation.evaluationFourValue) {
-        if (this.evaluation.evaluationFourValue[key] != '') {
+        if (this.evaluation.evaluationFourValue[key] !== '') {
           let cont = Number(this.evaluation.evaluationFourValue[key])
           obj = obj + cont
+        }else{
+          index++
         }
       }
-      if(obj){
+      if(index > 0 || Object.keys(this.evaluation.evaluationFourValue).length < 6) {
+        this.$message({
+            message: "鎮ㄨ繕鏈夐鐩湭閫夋嫨绛旀",
+            type: "warning"
+          });
+          return;
+      }else{
         this.evaluationFourResults = obj
         this.evaluation.showCheckAnswerFour = true
+        localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
         localStorage.setItem("aviationEtiquette-book-evaluation-four",this.evaluationFourResults);
       }
     },
     changeCheckFour(){
       this.evaluationFourResults = ''
       this.evaluation.evaluationFourValue = {}
+      localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
       localStorage.removeItem("aviationEtiquette-book-evaluation-four");
     },
     goCheckFive(){
       let obj = 0
+      let index = 0
       for (let key in this.evaluation.evaluationFiveValue) {
-        if (this.evaluation.evaluationFiveValue[key] != '') {
+        if (this.evaluation.evaluationFiveValue[key] !== '') {
           let cont = Number(this.evaluation.evaluationFiveValue[key])
           obj = obj + cont
+        }else{
+          index++
         }
       }
-      if(obj){
+      if(index > 0 || Object.keys(this.evaluation.evaluationFiveValue).length < 12) {
+        this.$message({
+            message: "鎮ㄨ繕鏈夐鐩湭閫夋嫨绛旀",
+            type: "warning"
+          });
+          return;
+      }else{
         this.evaluationFiveResults = obj
         this.evaluation.showCheckAnswerFive = true
+        localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
         localStorage.setItem("aviationEtiquette-book-evaluation-five",this.evaluationFiveResults);
       }
     },
     changeCheckFive(){
       this.evaluationFiveResults = ''
       this.evaluation.evaluationFiveValue = {}
+      localStorage.setItem("aviationEtiquette-book-evaluation-chapter003",JSON.stringify(this.evaluation));
       localStorage.removeItem("aviationEtiquette-book-evaluation-five");
     },
 

--
Gitblit v1.9.1