From 8f526fbf0d8fe16d1b396f3fce710b9e7f64e353 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期四, 15 八月 2024 14:27:33 +0800 Subject: [PATCH] 体育与健康pdf修改3 --- src/books/mathBook/view/components/index.vue | 113 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 56 insertions(+), 57 deletions(-) diff --git a/src/books/mathBook/view/components/index.vue b/src/books/mathBook/view/components/index.vue index 0bee8ec..7f749fe 100644 --- a/src/books/mathBook/view/components/index.vue +++ b/src/books/mathBook/view/components/index.vue @@ -3,23 +3,14 @@ <div id="searchDomBox" style="display: none"> <div id="searchContent"></div> </div> - <div - class="page-content" - :style="{ - fontSize: fontSize ? fontSize + 'px' : '16px', - transform: `scale(${pageZoom ? pageZoom : 1})`, - transformOrigin: 'center top', - }" - > - <pageHeader - v-if="showCatalogList.indexOf(1) > -1" - :showPageList="loadPageList" - ></pageHeader> - <chapterOne - v-if="showCatalogList.indexOf(2) > -1" - :showPageList="loadPageList" - :questionData="questionDataMap" - ></chapterOne> + <div class="page-content" :style="{ + fontSize: fontSize ? fontSize + 'px' : '16px', + transform: `scale(${pageZoom ? pageZoom : 1})`, + transformOrigin: 'center top', + }"> + <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> + <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :questionData="questionDataMap"> + </chapterOne> </div> </div> </template> @@ -57,7 +48,7 @@ renderSignMap: {}, highlightData: null, questionId: {}, - collectId:[] + collectId: [] }; }, computed: { @@ -162,36 +153,36 @@ }, 500); // 娴嬭瘯椤甸潰璺宠浆 - // setTimeout(() => { - // this.gotoPage(1, 10); - // setTimeout(() => { - // this.renderSign("Highlight", { - // id: "2ACA9359", - // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", - // page: "10", - // type: "Highlight", - // color: "#F5E12A" - // }); - // setTimeout(() => { - // this.delSign({ - // ids: ["2ACA9359"] - // }); - // }, 2000); - // }, 5000); + setTimeout(() => { + this.gotoPage(1, 9); + // setTimeout(() => { + // this.renderSign("Highlight", { + // id: "2ACA9359", + // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", + // page: "10", + // type: "Highlight", + // color: "#F5E12A" + // }); + // setTimeout(() => { + // this.delSign({ + // ids: ["2ACA9359"] + // }); + // }, 2000); + // }, 5000); - // const pageDom = (this.container ? this.container : document) - // .querySelector("#app") - // .querySelectorAll(".page-box"); - // 妫�绱� - // console.log(this.searchTextByPage("淇濇姢鍐呰剰鍣ㄥ畼"), "searchTextByPage"); - // 妫�绱㈣烦杞� - // this.searchItemLocation({ - // catalog: 2, - // page: 10, - // txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ", - // txtIndex: 57 - // }); - // }, 5000); + // const pageDom = (this.container ? this.container : document) + // .querySelector("#app") + // .querySelectorAll(".page-box"); + // 妫�绱� + // console.log(this.searchTextByPage("淇濇姢鍐呰剰鍣ㄥ畼"), "searchTextByPage"); + // 妫�绱㈣烦杞� + // this.searchItemLocation({ + // catalog: 2, + // page: 10, + // txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ", + // txtIndex: 57 + // }); + }, 500); // 鑾峰彇棰樼洰id鍒楄〃 this.getQuestionId(); @@ -452,8 +443,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.color = themeColor; } @@ -470,8 +461,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.backgroundColor = themeColor; } @@ -488,8 +479,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.borderColor = themeColor; } @@ -804,7 +795,7 @@ // 璁板綍楂樹寒淇℃伅 this.highlightData = data; // 璺宠浆 - this.gotoPage(data.catalog, data.page, () => {}); + this.gotoPage(data.catalog, data.page, () => { }); }, // 鑾峰彇棰樼洰鍒楄〃 getQuestionId() { @@ -826,7 +817,6 @@ const collect = JSON.parse(res[0].value); if (collect.length) { this.collectId = collect.find(item => item.type == 'json').collectList - console.log('鏀惰棌鍒楄〃',this.collectId); } } catch (error) { console.log("鏆傛棤鏁版嵁"); @@ -867,8 +857,16 @@ if (!res.data.data) return []; for (let index = 0; index < res.data.data.length; index++) { const item = res.data.data[index]; - item.isCollect = this.collectId.indexOf(item.id) > -1 ? true :false - console.log(item.id ,this.collectId.indexOf(item.id)); + // 鏁板鍏紡鍔犵被鍚嶅幓淇敼鏍峰紡 + if (item.type && item.type == 'material') { + if (!item.infoList.length) return false + item.infoList.forEach(citem => { + if (citem.answer) citem.answer = citem.answer.replace(/\<math/gi, '<math class="examination-math"') + }) + } else { + if (item.answer) item.answer = item.answer.replace(/\<math/gi, '<math class="examination-math"') + } + item.isCollect = this.collectId.indexOf(item.id) > -1 ? true : false if (this.questionId[num][page].indexOf(item.id) > -1) { if (item.type && item.type == "material") { cardList.push(item); @@ -911,6 +909,7 @@ width: 100%; height: 100%; overflow: auto; + .page-content { max-width: 816px; min-width: 375px; -- Gitblit v1.9.1