From 3b2e6425d6fc732a221c9ef9ec9e8dc849e11148 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 07 六月 2024 14:53:14 +0800
Subject: [PATCH] 学前儿童保存--input事件

---
 src/books/childHealth/view/content/index.vue |   42 +++++++++++++++++++++++++++++-------------
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue
index cfac6ed..a3f04c0 100644
--- a/src/books/childHealth/view/content/index.vue
+++ b/src/books/childHealth/view/content/index.vue
@@ -21,51 +21,61 @@
         v-if="showCatalogList.indexOf(2) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterOne>
       <chapterTwo
         v-if="showCatalogList.indexOf(3) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterTwo>
       <chapterThree
         v-if="showCatalogList.indexOf(4) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterThree>
       <chapterFour
         v-if="showCatalogList.indexOf(5) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterFour>
       <chapterFive
         v-if="showCatalogList.indexOf(6) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterFive>
       <chapterSix
         v-if="showCatalogList.indexOf(7) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterSix>
       <chapterSeven
         v-if="showCatalogList.indexOf(8) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterSeven>
       <chapterEight
         v-if="showCatalogList.indexOf(9) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterEight>
       <chapterNine
         v-if="showCatalogList.indexOf(10) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterNine>
       <chapterTen
         v-if="showCatalogList.indexOf(11) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
+        :isSearch="isSearch"
       ></chapterTen>
       <chapterEleven
         v-if="showCatalogList.indexOf(12) > -1"
@@ -123,6 +133,7 @@
       questionDataMap: {},
       renderSignMap: {},
       highlightData: null,
+      isSearch:false
     };
   },
   computed: {
@@ -171,7 +182,7 @@
   },
   mounted() {
     // 榛樿鍔犺浇绔犺妭
-    this.showCatalogList = [3];
+    this.showCatalogList = [1];
     // 婊氬姩鐩戝惉鑺傛祦
     this.throttledScrollHandler = _.throttle(
       this.scrollFun,
@@ -247,9 +258,9 @@
     // const pageDom = (this.container ? this.container : document)
     //   .querySelector("#app")
     //   .querySelectorAll(".page-box");
-    // 妫�绱�
+    // // 妫�绱�
     // console.log(this.searchTextByPage("淇濇姢鍐呰剰鍣ㄥ畼"), "searchTextByPage");
-    // 妫�绱㈣烦杞�
+    // // 妫�绱㈣烦杞�
     // this.searchItemLocation({
     //   catalog: 2,
     //   page: 10,
@@ -605,22 +616,27 @@
             );
             const catalog = catalogDom.getAttribute("num");
             if (!this.questionDataMap[page]) {
+              const token = localStorage.getItem(this.config.tokenKey)
               if (testData && testData[catalog]) {
                 if (testData[catalog][page]) {
                   if (Array.isArray(testData[catalog][page])) {
-                    this.questionDataMap[page] = await getQuestionList(
-                      page,
-                      testData[catalog][page],
-                      this.config.activeBook
-                    );
+                    if(token) {
+                      this.questionDataMap[page] = await getQuestionList(
+                        page,
+                        testData[catalog][page],
+                        this.config.activeBook
+                      );
+                    }
                   } else {
                     const obj = {};
                     for (let key in testData[catalog][page]) {
-                      obj[key] = await getQuestionList(
-                        [],
-                        testData[catalog][page][key],
-                        this.config.activeBook
-                      );
+                      if(token) {
+                          obj[key] = await getQuestionList(
+                          [],
+                          testData[catalog][page][key],
+                          this.config.activeBook
+                        );
+                      }
                     }
                     this.questionDataMap[page] = obj;
                   }

--
Gitblit v1.9.1