| | |
| | | :style="{ |
| | | fontSize: fontSize ? fontSize + 'px' : '16px', |
| | | transform: `scale(${pageZoom ? pageZoom : 1})`, |
| | | transformOrigin: 'center top' |
| | | transformOrigin: 'center top', |
| | | }" |
| | | > |
| | | <pageHeader |
| | |
| | | }, |
| | | pageZoom() { |
| | | return this.$store.state.qiankun.scale / 100; |
| | | } |
| | | }, |
| | | }, |
| | | watch: { |
| | | showCatalogList: { |
| | |
| | | ) { |
| | | // 调用父层方法 |
| | | this.$store.state.qiankun.catalogChange({ |
| | | showCatalogList: newVal |
| | | showCatalogList: newVal, |
| | | }); |
| | | } |
| | | // 启动页码观察 |
| | |
| | | this.initObservation(); |
| | | this.initThemeColor(); |
| | | }, 500); |
| | | } |
| | | }, |
| | | }, |
| | | loadPageList: { |
| | | handler(newVal, oldVal) { |
| | |
| | | this.initSwiper(); |
| | | this.initViewer(); |
| | | }, 200); |
| | | } |
| | | }, |
| | | }, |
| | | pageZoom: { |
| | | handler(newVal, oldVal) { |
| | |
| | | this.container ? this.container : document |
| | | ).querySelector(".page-main"); |
| | | scrollBox.scrollTop = (scrollBox.scrollTop / oldVal) * newVal; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | |
| | | // 跳转检索结果位置 |
| | | jumpSearchItem: (data) => { |
| | | this.searchItemLocation(data); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | |
| | | this.observer = new IntersectionObserver(this.pageChangeCallback, { |
| | | root: null, // 指定根元素,这里设为 null,表示选取整个视窗作为根元素。 |
| | | rootMargin: "0px", // 指定根元素的边界,这里设为 "0px",表示根元素的边界和视窗的边界重合 |
| | | threshold: 0.5 // 指定交叉比例,这里设为 0.5,表示当目标元素一半或更多显示在视窗中时触发回调函数。 |
| | | threshold: 0.5, // 指定交叉比例,这里设为 0.5,表示当目标元素一半或更多显示在视窗中时触发回调函数。 |
| | | }); |
| | | |
| | | this.loadPageObserver = new IntersectionObserver(this.loadPageCallback, { |
| | | root: null, // 指定根元素,这里设为 null,表示选取整个视窗作为根元素。 |
| | | rootMargin: "0px", // 指定根元素的边界,这里设为 "0px",表示根元素的边界和视窗的边界重合 |
| | | threshold: 0 // 指定交叉比例,这里设为 0.5,表示当目标元素一半或更多显示在视窗中时触发回调函数。 |
| | | threshold: 0, // 指定交叉比例,这里设为 0.5,表示当目标元素一半或更多显示在视窗中时触发回调函数。 |
| | | }); |
| | | |
| | | // 启动页码观察 |
| | |
| | | // .querySelector("#app") |
| | | // .querySelectorAll(".page-box"); |
| | | // 检索 |
| | | // console.log(this.searchTextByPage("儿童"), "searchTextByPage"); |
| | | // console.log(this.searchTextByPage("保护内脏器官"), "searchTextByPage"); |
| | | // 检索跳转 |
| | | // this.searchItemLocation({ |
| | | // catalog: 2, |
| | |
| | | this.showCatalogList = [ |
| | | this.catalogLength - 2, |
| | | this.catalogLength - 1, |
| | | this.catalogLength |
| | | this.catalogLength, |
| | | ]; |
| | | } else { |
| | | this.showCatalogList = [catalog - 1, catalog, catalog + 1]; |
| | |
| | | this.container ? this.container : document |
| | | ).querySelector(`[page="${data.page}"]`); |
| | | // 创建 createTreeWalker 迭代器,用于遍历文本节点,保存到一个数组 |
| | | const treeWalker = document.createTreeWalker( |
| | | pageDom, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | const treeWalker = document.createTreeWalker(pageDom, NodeFilter.SHOW_TEXT); |
| | | const allTextNodes = []; |
| | | let currentNode = treeWalker.nextNode(); |
| | | while (currentNode) { |
| | |
| | | this.$store.state.qiankun.pageChange({ |
| | | page: page, |
| | | catalog: catalog, |
| | | text |
| | | text, |
| | | }); |
| | | // const sections = Array.from(document.querySelectorAll(".section")); |
| | | //sections:获取所有具有 .section 类名的元素,并转换为数组。 |
| | |
| | | ); |
| | | 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; |
| | | } |
| | |
| | | // 高亮行 |
| | | setTimeout(() => { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker( |
| | | target, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | autoplay: { |
| | | //自动开始 |
| | | delay: 3000, //时间间隔 |
| | | disableOnInteraction: false //*手动操作轮播图后不会暂停* |
| | | disableOnInteraction: false, //*手动操作轮播图后不会暂停* |
| | | }, |
| | | paginationClickable: true, |
| | | slidesPerView: 1, // 一组三个 |
| | |
| | | ), |
| | | prevEl: (this.container ? this.container : document).querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | ), |
| | | }, |
| | | // 窗口变化,重新init,针对F11全屏和放大缩小,必须加 |
| | | observer: true, |
| | | observeParents: true |
| | | observeParents: true, |
| | | // // 如果需要分页器 |
| | | // pagination: { |
| | | // el: (this.container ? this.container : document).querySelector( |
| | |
| | | ), |
| | | prevEl: (this.container ? this.container : document).querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | ), |
| | | }, |
| | | // 窗口变化,重新init,针对F11全屏和放大缩小,必须加 |
| | | observer: true, |
| | |
| | | var paginationInfoEl = dom.querySelector(".pageBox"); |
| | | if (paginationInfoEl) |
| | | paginationInfoEl.textContent = currentPage + "/" + totalPages; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | : "body", |
| | | navbar: true, // 显示导航栏 |
| | | toolbar: true, // 显示工具栏 |
| | | title: true // 显示标题 |
| | | title: true, // 显示标题 |
| | | }); |
| | | } |
| | | }, |
| | |
| | | chapterTen, |
| | | chapterEleven, |
| | | chapterTwelve, |
| | | chapterThirteen |
| | | chapterThirteen, |
| | | }; |
| | | // 遍历所有章节文件 |
| | | for (const key in pageData) { |
| | |
| | | pageExample = new pageComponent({ |
| | | propsData: { |
| | | showPageList: [], |
| | | questionData: {} |
| | | } |
| | | questionData: {}, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | | (this.container ? this.container : document).querySelector( |
| | |
| | | pageExample = new pageComponent({ |
| | | propsData: { |
| | | showPageList: [pageNum], |
| | | questionData: {} |
| | | } |
| | | questionData: {}, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | | (this.container ? this.container : document).querySelector( |
| | |
| | | .querySelector(`[page="${pageNum}"]`); |
| | | if (thisPageDom) { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker( |
| | | thisPageDom, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | const pageTextList = document.createTreeWalker(thisPageDom, NodeFilter.SHOW_TEXT); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | page: pageNum, |
| | | catalog: catalogIndex, |
| | | txt: textDom.textContent, |
| | | txtIndex: txtIndex |
| | | txtIndex: txtIndex, |
| | | }); |
| | | } |
| | | } |
| | |
| | | this.highlightData = data; |
| | | // 跳转 |
| | | this.gotoPage(data.catalog, data.page, () => {}); |
| | | } |
| | | }, |
| | | }, |
| | | components: { |
| | | pageHeader, |
| | |
| | | chapterTen, |
| | | chapterEleven, |
| | | chapterTwelve, |
| | | chapterThirteen |
| | | } |
| | | chapterThirteen, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleMouseUp(e) { |
| | | const selection = ( |
| | | this.container ? this.container : window |
| | |
| | | <ChapterOne |
| | | v-if="showCatalogList.indexOf(2) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterTwo |
| | | v-if="showCatalogList.indexOf(3) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterThree |
| | | v-if="showCatalogList.indexOf(4) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterFour |
| | | v-if="showCatalogList.indexOf(5) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <ChapterFive |
| | | v-if="showCatalogList.indexOf(6) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | @Upload_initViewer="changeDomViewer" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <chapterSix |
| | | v-if="showCatalogList.indexOf(7) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <chapterSeven |
| | | v-if="showCatalogList.indexOf(8) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | @eventSwdt="swdtChange" |
| | | @Upload_initViewer="changeDomViewer" |
| | | :isSearch="isSearch" |
| | |
| | | <chapterEight |
| | | v-if="showCatalogList.indexOf(9) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <chapterNine |
| | | v-if="showCatalogList.indexOf(10) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionData" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | /> |
| | | <chapter010 |
| | |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | | this.showCatalogList = [1]; |
| | | this.showCatalogList = [6]; |
| | | // 滚动监听节流 |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | |
| | | this.initViewer(); |
| | | }, 500); |
| | | }, |
| | | |
| | | // 滚动监听 |
| | | scrollFun(event) { |
| | | // 判断向上滚动还是向下滚动 |
| | |
| | | |
| | | // 处理标记数据 |
| | | handelSignData(type, data) { |
| | | if (this.loadPageList.indexOf(Number(data.page)) > -1) { |
| | | // 立即渲染 |
| | | this.renderSign(type, data); |
| | | } |
| | | |
| | | // 储存数据 |
| | | if (!this.renderSignMap[type]) this.renderSignMap[type] = {}; |
| | | if (!this.renderSignMap[type][data.page]) |
| | | this.renderSignMap[type][data.page] = []; |
| | |
| | | |
| | | // 渲染标记 |
| | | renderSign(type, data) { |
| | | // 父层设置禁止渲染标记时不再进行渲染 |
| | | if (this.$store.state.qiankun.disableSign) { |
| | | return false; |
| | | } |
| | | const existence = ( |
| | | this.container ? this.container : document |
| | | ).querySelector(`[dataid="${data.id}"]`); |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 删除标记渲染 |
| | | delSign({ ids, type }) { |
| | | if (ids && ids.length) { |
| | |
| | | }); |
| | | }, |
| | | |
| | | getParentWithClass(element, className) { |
| | | while (element.parentElement) { |
| | | element = element.parentElement; |
| | | if (element.classList.contains(className)) { |
| | | return element; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | pageChangeCallback(entries, observer) { |
| | | //entries:代表观察到的目标元素的集合。 observer:代表观察者对象。 |
| | | entries.forEach((entry) => { |
| | |
| | | ); |
| | | 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]) { |
| | |
| | | } |
| | | this.questionDataMap[page] = obj; |
| | | } |
| | | // console.log("题目", this.questionDataMap); |
| | | console.log("题目", this.questionDataMap); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 高亮行 |
| | | setTimeout(() => { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); |
| | | const pageTextList = document.createTreeWalker( |
| | | target, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | } |
| | | }, |
| | | |
| | | getParentWithClass(element, className) { |
| | | // console.log(element, className, "element, className"); |
| | | while (element.parentElement) { |
| | | element = element.parentElement; |
| | | if (element.classList.contains(className)) { |
| | | return element; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleMouseUp(e) { |
| | | const selection = ( |
| | | this.container ? this.container : window |
| | |
| | | y: e.y, |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | swdtChange(data) { |
| | | if (this.$store.state.qiankun && this.$store.state.qiankun.chooseWords) { |
| | | this.$store.state.qiankun.chooseWords({ |
| | | type: data, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | } |
| | | // 输出搜索结果 |
| | | console.log(searchResult); |
| | | // console.log(searchResult); |
| | | return searchResult; |
| | | }, |
| | | |
| | |
| | | <!-- eslint-disable no-irregular-whitespace --> |
| | | <template> |
| | | <div class="chapter" num="3"> |
| | | <div class="page-box" page="19"> |
| | |
| | | index == 0 || |
| | | index == chapter002.headersData.length - 2 || |
| | | index == chapter002.headersData.length - 1 |
| | | ? '100px' |
| | | : '', |
| | | ? '120px' |
| | | : '40px', |
| | | }" |
| | | v-for="(header, index) in chapter002.headersData" |
| | | :key="index" |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter002.tableData121[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter002.tableData121[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | :readonly="cellIndex == 0" |
| | | type="text" |
| | | :value="chapter002.tableData121[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | :contenteditable="cellIndex != 0" |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter002.tableData121[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | <table class="table111 table122"> |
| | | <thead> |
| | | <tr> |
| | | <th rowspan="3">日期</th> |
| | | <th rowspan="3">姓名</th> |
| | | <th rowspan="3" style="width: 55px">日期</th> |
| | | <th rowspan="3" style="width: 55px">姓名</th> |
| | | <th colspan="3">晨间检查情况</th> |
| | | <th colspan="8">全日观察情况</th> |
| | | <th colspan="2">交班</th> |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | :value="chapter002.tableData122[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell122(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell122(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter002.tableData122[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | type="text" |
| | | :value="chapter002.tableData122[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell122(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell122(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter002.tableData122[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter002.tableData123[rowIndex][cellIndex]" |
| | | <div |
| | | contenteditable |
| | | @blur=" |
| | | updateCell123(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | > |
| | | {{ chapter002.tableData123[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | type="text" |
| | | :value="cell" |
| | | <div |
| | | contenteditable |
| | | @blur=" |
| | | updateCell123(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | > |
| | | {{ cell }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | this.chapter002.isInspectOpen = !this.chapter002.isInspectOpen; |
| | | localStorage.setItem("chapter002", JSON.stringify(this.chapter002)); |
| | | }, |
| | | updateCell(rowIndex, cellIndex, value) { |
| | | updateCell(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.tableData121[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.tableData121[rowIndex], |
| | | cellIndex, |
| | | e.target.innerText |
| | | ); |
| | | localStorage.setItem("chapter002", JSON.stringify(this.chapter002)); |
| | | }, |
| | | updateCell122(rowIndex, cellIndex, value) { |
| | | updateCell122(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.tableData122[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.tableData122[rowIndex], |
| | | cellIndex, |
| | | e.target.innerText |
| | | ); |
| | | localStorage.setItem("chapter002", JSON.stringify(this.chapter002)); |
| | | }, |
| | | updateCell123(rowIndex, cellIndex, value) { |
| | | updateCell123(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.tableData123[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.tableData123[rowIndex], |
| | | cellIndex, |
| | | e.target.innerText |
| | | ); |
| | | localStorage.setItem("chapter002", JSON.stringify(this.chapter002)); |
| | | }, |
| | | updateCellGroup(rowIndex, cellIndex, value) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.groupData[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.groupData[rowIndex], |
| | | cellIndex, |
| | | value |
| | | ); |
| | | if (cellIndex == 4) { |
| | | this.$set( |
| | | this.chapter002.groupData[rowIndex], |
| | |
| | | }, |
| | | updateCellDesign(rowIndex, cellIndex, value) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.designData[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.designData[rowIndex], |
| | | cellIndex, |
| | | value |
| | | ); |
| | | if (cellIndex == 4) { |
| | | this.$set( |
| | | this.chapter002.designData[rowIndex], |
| | |
| | | }, |
| | | updateCellInspect(rowIndex, cellIndex, value) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter002.inspectData[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter002.inspectData[rowIndex], |
| | | cellIndex, |
| | | value |
| | | ); |
| | | if (cellIndex == 4) { |
| | | this.$set( |
| | | this.chapter002.inspectData[rowIndex], |
| | |
| | | :style="{ |
| | | width: |
| | | index == 0 || |
| | | index == chapter005.tableData151.length - 1 |
| | | ? '100px' |
| | | index == chapter005.headersData.length - 1 |
| | | ? '150px' |
| | | : '', |
| | | }" |
| | | v-for="(header, index) in chapter005.headersData" |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter005.tableData151[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData151[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | :readonly="cellIndex == 0" |
| | | type="text" |
| | | :value="chapter005.tableData151[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | :contenteditable="cellIndex != 0" |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData151[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter005.tableData155[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell155( |
| | | rowIndex, |
| | | cellIndex, |
| | | $event.target.value |
| | | ) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell155(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData155[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | type="text" |
| | | :value="chapter005.tableData155[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell155( |
| | | rowIndex, |
| | | cellIndex, |
| | | $event.target.value |
| | | ) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell155(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData155[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | } |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell(rowIndex, cellIndex, value) { |
| | | updateCell(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter005.tableData151[rowIndex], cellIndex, value); |
| | | this.$set(this.chapter005.tableData151[rowIndex], cellIndex, e.target.innerText); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell152(rowIndex, cellIndex, value) { |
| | |
| | | this.$set(this.chapter005.tableData154[rowIndex], cellIndex, value); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell155(rowIndex, cellIndex, value) { |
| | | updateCell155(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter005.tableData155[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter005.tableData155[rowIndex], |
| | | cellIndex, |
| | | e.target.innerText |
| | | ); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell156(rowIndex, cellIndex, value) { |