| | |
| | | // const pageDom = (this.container ? this.container : document) |
| | | // .querySelector("#app") |
| | | // .querySelectorAll(".page-box"); |
| | | // // 检索 |
| | | // 检索 |
| | | // console.log(this.searchTextByPage("保护内脏器官"), "searchTextByPage"); |
| | | // // 检索跳转 |
| | | // 检索跳转 |
| | | // this.searchItemLocation({ |
| | | // catalog: 2, |
| | | // page: 10, |
| | |
| | | const catalog = catalogDom.getAttribute("num"); |
| | | let text = null; |
| | | if (target.querySelector("p")) { |
| | | text = target.querySelector("p").textContent.substring(0, 20); |
| | | text = target.querySelector("p").textContent.substring(0, 50); |
| | | } |
| | | // 返回页码和章节信息 |
| | | if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange) |
| | |
| | | target, |
| | | "chapter" |
| | | ); |
| | | // 添加页码 |
| | | this.loadPageList.push(Number(page)); |
| | | 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])) { |
| | | if(token) { |
| | | this.questionDataMap[page] = await getQuestionList( |
| | | page, |
| | | testData[catalog][page], |
| | | this.config.activeBook |
| | | ); |
| | | } |
| | | } else { |
| | | const obj = {}; |
| | | for (let key in testData[catalog][page]) { |
| | | if(token) { |
| | | obj[key] = await getQuestionList( |
| | | [], |
| | | testData[catalog][page][key], |
| | | this.config.activeBook |
| | | ); |
| | | } |
| | | } |
| | | this.questionDataMap[page] = obj; |
| | | } |
| | | console.log("题目", this.questionDataMap); |
| | | } |
| | | } |
| | | } |
| | | // 添加页码 |
| | | this.loadPageList.push(Number(page)); |
| | | |
| | | // 渲染这一页的标记 |
| | | for (const key in this.renderSignMap) { |
| | | if (this.renderSignMap[key][page]) { |