| | |
| | | <front001 |
| | | v-if="showCatalogList.indexOf(1) > -1" |
| | | :showPageList="loadPageList" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterOne |
| | | v-if="showCatalogList.indexOf(2) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterTwo |
| | | v-if="showCatalogList.indexOf(3) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterThree |
| | | v-if="showCatalogList.indexOf(4) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterFour |
| | | <!-- <ChapterFour |
| | | v-if="showCatalogList.indexOf(5) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | /> --> |
| | | <!-- <ChapterFive |
| | | v-if="showCatalogList.indexOf(6) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | @Upload_initViewer="changeDomViewer" |
| | | :isSearch="isSearch" |
| | | /> --> |
| | | <!-- <chapterSix |
| | | v-if="showCatalogList.indexOf(7) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> --> |
| | | <!-- <chapterSeven |
| | | v-if="showCatalogList.indexOf(8) > -1" |
| | |
| | | :questionData="questionDataMap" |
| | | @eventSwdt="swdtChange" |
| | | @Upload_initViewer="changeDomViewer" |
| | | :isSearch="isSearch" |
| | | /> --> |
| | | <!-- <chapterEight |
| | | v-if="showCatalogList.indexOf(9) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> --> |
| | | <!-- <chapterNine |
| | | v-if="showCatalogList.indexOf(10) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> --> |
| | | <!-- <chapter010 |
| | | v-if="showCatalogList.indexOf(11) > -1" |
| | |
| | | <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"; |
| | |
| | | questionDataMap: {}, |
| | | renderSignMap: {}, |
| | | highlightData: null, |
| | | isSearch: false, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | | this.showCatalogList = [3]; |
| | | this.showCatalogList = [1]; |
| | | // 滚动监听节流 |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | |
| | | }, |
| | | methods: { |
| | | changeDomViewer() { |
| | | setTimeout(() => { |
| | | this.initViewer(); |
| | | }, 500); |
| | | this.initViewer(); |
| | | }, |
| | | |
| | | // 滚动监听 |
| | | scrollFun(event) { |
| | | // 判断向上滚动还是向下滚动 |
| | |
| | | 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; |
| | | } |
| | |
| | | // 高亮行 |
| | | setTimeout(() => { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); |
| | | const pageTextList = document.createTreeWalker( |
| | | target, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | ChapterOne, |
| | | ChapterTwo, |
| | | ChapterThree, |
| | | ChapterFour, |
| | | // ChapterFour, |
| | | // ChapterFive, |
| | | // chapterSix, |
| | | // chapterSeven, |
| | |
| | | propsData: { |
| | | showPageList: [], |
| | | questionData: {}, |
| | | isSearch: true, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | |
| | | propsData: { |
| | | showPageList: [pageNum], |
| | | questionData: {}, |
| | | isSearch: true, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | |
| | | ChapterOne, |
| | | ChapterTwo, |
| | | ChapterThree, |
| | | ChapterFour, |
| | | // ChapterFour, |
| | | // ChapterFive, |
| | | // chapterSix, |
| | | // chapterSeven, |