From c0e4157169e151fe4ada71d3abbd82aa78c4d71e Mon Sep 17 00:00:00 2001
From: unknown <qq1940665526@163.com>
Date: 星期四, 13 六月 2024 14:11:35 +0800
Subject: [PATCH] 优化

---
 src/books/sportsAndHealth/view/components/index.vue |   53 +++++++++++++++++++++++++----------------------------
 1 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/src/books/sportsAndHealth/view/components/index.vue b/src/books/sportsAndHealth/view/components/index.vue
index c8e9ca8..209dd7e 100644
--- a/src/books/sportsAndHealth/view/components/index.vue
+++ b/src/books/sportsAndHealth/view/components/index.vue
@@ -18,23 +18,20 @@
       <ChapterOne
         v-if="showCatalogList.indexOf(2) > -1"
         :showPageList="loadPageList"
-        :questionData="questionDataMap"
       />
       <ChapterTwo
         v-if="showCatalogList.indexOf(3) > -1"
         :showPageList="loadPageList"
-        :questionData="questionDataMap"
       />
       <ChapterThree
         v-if="showCatalogList.indexOf(4) > -1"
         :showPageList="loadPageList"
-        :questionData="questionDataMap"
       />
-      <ChapterFour
+      <!-- <ChapterFour
         v-if="showCatalogList.indexOf(5) > -1"
         :showPageList="loadPageList"
         :questionData="questionDataMap"
-      />
+      /> -->
       <!-- <ChapterFive
         v-if="showCatalogList.indexOf(6) > -1"
         :showPageList="loadPageList"
@@ -106,9 +103,9 @@
 <script>
 import front001 from "./front001";
 import ChapterOne from "./chapter001";
-import ChapterTwo from "./chapter002";
-import ChapterThree from "./testDynaicTable";
-import ChapterFour from "./testPp";
+import ChapterTwo from "./testDynaicTable";
+import ChapterThree from "./testPp";
+// import ChapterFour from "./testPp";
 // import ChapterFive from "./chapter005";
 // import chapterSix from "./chapter006";
 // import chapterSeven from "./chapter007";
@@ -191,7 +188,7 @@
   },
   mounted() {
     // 榛樿鍔犺浇绔犺妭
-    this.showCatalogList = [1];
+    this.showCatalogList = [4];
     // 婊氬姩鐩戝惉鑺傛祦
     this.throttledScrollHandler = _.throttle(
       this.scrollFun,
@@ -267,11 +264,8 @@
   },
   methods: {
     changeDomViewer() {
-      setTimeout(() => {
-        this.initViewer();
-      }, 500);
+      this.initViewer();
     },
-
     // 婊氬姩鐩戝惉
     scrollFun(event) {
       // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩
@@ -608,19 +602,19 @@
               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
-                      );
+                    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
-                        );
+                      obj[key] = await getQuestionList(
+                        [],
+                        testData[catalog][page][key],
+                        this.config.activeBook
+                      );
                     }
                     this.questionDataMap[page] = obj;
                   }
@@ -641,7 +635,10 @@
               // 楂樹寒琛�
               setTimeout(() => {
                 // 鑾峰彇椤甸潰鎵�鏈塼ext鑺傜偣
-                const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT);
+                const pageTextList = document.createTreeWalker(
+                  target,
+                  NodeFilter.SHOW_TEXT
+                );
                 // 鍖归厤鍏抽敭瀛�
                 const allPageTextNodes = [];
                 let currentNode = pageTextList.nextNode();
@@ -791,7 +788,7 @@
         ChapterOne,
         ChapterTwo,
         ChapterThree,
-        ChapterFour,
+        // ChapterFour,
         // ChapterFive,
         // chapterSix,
         // chapterSeven,
@@ -817,7 +814,7 @@
           propsData: {
             showPageList: [],
             questionData: {},
-            isSearch: true
+            isSearch: true,
           },
         });
         pageExample.$mount(
@@ -849,7 +846,7 @@
               propsData: {
                 showPageList: [pageNum],
                 questionData: {},
-                isSearch: true
+                isSearch: true,
               },
             });
             pageExample.$mount(
@@ -914,7 +911,7 @@
     ChapterOne,
     ChapterTwo,
     ChapterThree,
-    ChapterFour,
+    // ChapterFour,
     // ChapterFive,
     // chapterSix,
     // chapterSeven,

--
Gitblit v1.9.1