\s*(.*?)\s*<\/p>$/, '$1').trim(); + content = await this.$commonJS.decodeHtml(content); + content = content.replace(/ |\u00A0/g, ' '); + return content; }, // 1----保存稿件信息 async ZsSaveMes() { + var abstractStr = ''; + var mhooStr = ''; + var traditionStr = ''; if (this.detailMes.journal_stage_id == 0) { this.$message.error('Please select an installment!'); return; + } if (this.tradition!='') { + traditionStr = await this.abstractFormat(this.tradition); + } + if (this.mhooStr!='') { + mhooStr = await this.abstractFormat(this.mhooStr); } + if (this.abstract == '') { this.$message.error('Please input abstract!'); - return; + return false; } else { abstractStr = await this.abstractFormat(this.abstract); } - console.log('abstractStr at line 1820:', abstractStr); - + this.$refs.Mes_Form.validate((valid) => { if (valid) { this.$api - .post('api/Production/editProduction', { ...this.detailMes, abstract: abstractStr }) + .post('api/Production/editProduction', { ...this.detailMes, abstract: abstractStr, mhoo: mhooStr, tradition: traditionStr }) .then((res) => { if (res.code == 0) { this.$message.success(`Successfully save the article!`); @@ -2904,30 +3002,30 @@ export default { }, onScroll(e) { - const scrollContainer = e.target; - const scrollItems = document.querySelectorAll('.scroll-item'); - - // 遍历所有滚动项,找到“当前在可视区域内”的项 - for (let i = 0; i < scrollItems.length; i++) { - const item = scrollItems[i]; - // 计算项相对于滚动容器的位置(顶部距离) - const itemTop = item.offsetTop - scrollContainer.offsetTop; - // 计算项的底部距离 - const itemBottom = itemTop + item.offsetHeight; + const scrollContainer = e.target; + const scrollItems = document.querySelectorAll('.scroll-item'); - // 判断:项的顶部 <= 滚动距离,且项的底部 >= 滚动距离(即项在可视区域内) - const isInView = (itemTop <= scrollContainer.scrollTop) && (itemBottom >= scrollContainer.scrollTop); - - if (isInView) { - this.tabIndex = i.toString(); - // 先判断tabsList是否存在对应索引,避免报错 - if (this.tabsList[i]) { - this.tabName = this.tabsList[i].refName; + // 遍历所有滚动项,找到“当前在可视区域内”的项 + for (let i = 0; i < scrollItems.length; i++) { + const item = scrollItems[i]; + // 计算项相对于滚动容器的位置(顶部距离) + const itemTop = item.offsetTop - scrollContainer.offsetTop; + // 计算项的底部距离 + const itemBottom = itemTop + item.offsetHeight; + + // 判断:项的顶部 <= 滚动距离,且项的底部 >= 滚动距离(即项在可视区域内) + const isInView = itemTop <= scrollContainer.scrollTop && itemBottom >= scrollContainer.scrollTop; + + if (isInView) { + this.tabIndex = i.toString(); + // 先判断tabsList是否存在对应索引,避免报错 + if (this.tabsList[i]) { + this.tabName = this.tabsList[i].refName; + } + break; // 找到第一个匹配的项就停止 + } } - break; // 找到第一个匹配的项就停止 - } - } -}, + }, getHight() { this.contentStyleObj.height = window.innerHeight - 60 + 'px'; @@ -2969,9 +3067,9 @@ export default { font-size: 14px !important; padding: 6px 10px !important; } -.tab_item{ -height: 6vh; -min-height: 60px; +.tab_item { + height: 6vh; + min-height: 60px; } diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue index 0fecb1f..e563ec7 100644 --- a/src/components/page/components/Tinymce/index.vue +++ b/src/components/page/components/Tinymce/index.vue @@ -5,14 +5,19 @@