diff --git a/src/api/index.js b/src/api/index.js index 525753d..487fb66 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -19,8 +19,8 @@ const service = axios.create({ // baseURL: 'https://submission.tmrjournals.com/', //正式 记得切换 // baseURL: 'http://www.tougao.com/', //测试本地 记得切换 // baseURL: 'http://192.168.110.110/tougao/public/index.php/', - // baseURL: '/api', //本地 - baseURL: '/', //正式 + baseURL: '/api', //本地 + // baseURL: '/', //正式 }); diff --git a/src/common/js/commonJS.js b/src/common/js/commonJS.js index c3d5abe..011f49c 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -831,26 +831,27 @@ export default { // } // }, - transformHtmlString(inputHtml, type) { - + transformHtmlString(inputHtml, type, options = {}) { + const { keepBr = false } = options; + if (!keepBr) { + inputHtml = inputHtml.replace(//g, ''); + } // inputHtml = inputHtml.replace(/(<[^>]+) style="[^"]*"/g, '$1'); // 移除style属性 // inputHtml = inputHtml.replace(/(<[^>]+) class="[^"]*"/g, '$1'); // 移除class属性 // inputHtml = inputHtml.replace(/<([a-zA-Z0-9]+)[^>]*>/g, '<$1>'); // 删除标签上的所有属性 - inputHtml = inputHtml.replace(/<([a-zA-Z0-9]+)([^>]*)>/g, function (match, tag, attributes) { // 使用正则表达式删除属性(保留 data-latex) let updatedAttributes = attributes.replace(/\s([a-zA-Z0-9-]+)(="[^"]*")?/g, function (attrMatch, attrName) { - // 只保留 data-latex 属性,其他属性删除 + if (attrName === "data-latex") { return attrMatch; } if (type == 'table' && tag == 'img' && (attrName === "src" || attrName === "width" || attrName === "height")) { return attrMatch; } - return ''; // 删除其他属性 + return ''; }); - // 返回标签,保留 data-latex 属性 return `<${tag}${updatedAttributes}>`; }); // 2. 删除所有不需要的标签 (除 `strong`, `em`, `sub`, `sup`, `b`, `i` 外的所有标签) @@ -861,14 +862,11 @@ export default { } - // 3. 删除所有 `
` 标签 - inputHtml = inputHtml.replace(//g, ''); // 删除
标签 - // 3. 如果有 `` 和 `` 标签,去掉内部样式并保留内容 + // 去掉样式 inputHtml = inputHtml.replace(/]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签 inputHtml = inputHtml.replace(//g, '').replace(/<\/strong>/g, ''); // 将 `strong` 替换成 `b` inputHtml = inputHtml.replace(//g, '').replace(/<\/em>/g, ''); // 将 `em` 替换成 `i` - - // 4. 合并相同标签(如多个连续的 标签) + // 4. 合并相同标签 inputHtml = inputHtml.replace(/(.*?)<\/b>\s*/g, '$1'); // 合并连续的 标签 inputHtml = inputHtml.replace(/(.*?)<\/i>\s*/g, '$1'); // 合并连续的 标签 diff --git a/src/components/common/common.vue b/src/components/common/common.vue index 2038279..4a59fb9 100644 --- a/src/components/common/common.vue +++ b/src/components/common/common.vue @@ -2,16 +2,16 @@ //记得切换 //正式 -const mediaUrl = '/public/'; -const baseUrl = '/'; +// const mediaUrl = '/public/'; +// const baseUrl = '/'; // const mediaUrl = 'https://submission.tmrjournals.com/public/'; // // const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; // const baseUrl = '/api' -// const mediaUrl = 'http://tougaotest.tmrjournals.com/public/'; -// // const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; -// const baseUrl = '/api'; +const mediaUrl = 'http://tougaotest.tmrjournals.com/public/'; +// const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; +const baseUrl = '/api'; //本地(正式环境 ) diff --git a/src/components/page/GenerateCharts.vue b/src/components/page/GenerateCharts.vue index 149a4a1..eb7c8d6 100644 --- a/src/components/page/GenerateCharts.vue +++ b/src/components/page/GenerateCharts.vue @@ -225,7 +225,9 @@ * Table: + { - console.log('res at line 191:', res); + if (res.code == 0) { this.article_pay_info = { fee: res.data.article ? res.data.article.fee : 0, @@ -1049,34 +1049,7 @@ export default { return e.stage_year + ' Vol.' + e.stage_vol + ' issue.' + e.stage_no + e.stage_pagename + e.stage_page; }, - // 1----保存稿件信息 - ZsSaveMes() { - if (this.detailMes.journal_stage_id == 0) { - this.$message.error('Please select an installment!'); - return; - } - this.$refs.Mes_Form.validate((valid) => { - if (valid) { - this.$api - .post('api/Production/editProduction', this.detailMes) - .then((res) => { - if (res.code == 0) { - this.$message.success(`Successfully save the article!`); - this.getData(); - } else { - this.$message.error(res.msg); - } - }) - .catch((err) => { - this.$message.error(err); - }); - } else { - this.$message.error('Please complete Essential Information first!'); - this.jumpTab(0, this.tabsList[0]); - return false; - } - }); - }, + // 2----添加作者操作 add_Authorclick(index, row) { diff --git a/src/components/page/PreIngestedEditorProduce.vue b/src/components/page/PreIngestedEditorProduce.vue index a8e5998..397596a 100644 --- a/src/components/page/PreIngestedEditorProduce.vue +++ b/src/components/page/PreIngestedEditorProduce.vue @@ -831,7 +831,7 @@ export default { article_id: this.article_id }) .then((res) => { - console.log('res at line 191:', res); + if (res.code == 0) { this.feeStatus=res.data.state this.isShowCommit=res.data.state==1?true:false @@ -1146,34 +1146,7 @@ export default { return e.stage_year + ' Vol.' + e.stage_vol + ' issue.' + e.stage_no + e.stage_pagename + e.stage_page; }, - // 1----保存稿件信息 - ZsSaveMes() { - if (this.detailMes.journal_stage_id == 0) { - this.$message.error('Please select an installment!'); - return; - } - this.$refs.Mes_Form.validate((valid) => { - if (valid) { - this.$api - .post('api/Production/editProduction', this.detailMes) - .then((res) => { - if (res.code == 0) { - this.$message.success(`Successfully save the article!`); - this.getData(); - } else { - this.$message.error(res.msg); - } - }) - .catch((err) => { - this.$message.error(err); - }); - } else { - this.$message.error('Please complete Essential Information first!'); - this.jumpTab(0, this.tabsList[0]); - return false; - } - }); - }, + // 2----添加作者操作 add_Authorclick(index, row) { diff --git a/src/components/page/articleAdd.vue b/src/components/page/articleAdd.vue index cfe264a..496c84a 100644 --- a/src/components/page/articleAdd.vue +++ b/src/components/page/articleAdd.vue @@ -2084,7 +2084,7 @@ export default { restaurants[i].value = restaurants[i].email + ' | ' + restaurants[i].firstname + restaurants[i].lastname; } var results = value ? restaurants.filter(this.createMata(value)) : restaurants; - console.log('🚀 ~ .then ~ results177:', results); + // 调用 callback 返回建议列表的数据 cb(results); // this.form.authorList[num].load = false; diff --git a/src/components/page/articleListEditor_B1.vue b/src/components/page/articleListEditor_B1.vue index 282129e..4d005f2 100644 --- a/src/components/page/articleListEditor_B1.vue +++ b/src/components/page/articleListEditor_B1.vue @@ -11,7 +11,12 @@ > Detailed for MS -
+
{{ index + 1 }} {{ item.name }} @@ -103,10 +108,66 @@ - + + + - + + + + + @@ -118,6 +179,7 @@ + @@ -133,7 +195,7 @@ :wordStyle="`p{font-size: 13px;}`" :isAutomaticUpdate="true" @getContent="getContent" - @updateChange="updateChange" + @updateChange="(content) => updateChange('abstract',content)" :value="abstract" class="paste-area text-container" :toolbar="[ @@ -150,6 +212,9 @@ + + +
@@ -997,6 +1062,8 @@ export default { journal_special_id: 'None' }, abstract: '', + tradition: '', + mhooStr: '', opInstal: [], // opMedical: [ // { @@ -1358,6 +1425,18 @@ export default { message: 'Please enter mechanism', trigger: 'blur' } + ], + executive_editor: [ + { + required: true, + message: 'Please enter the executive editor', + trigger: 'blur' + }, + { + pattern: /^[^\u4e00-\u9fa5]*$/, + message: 'Please use English characters only', + trigger: 'blur' + } ] } }; @@ -1381,7 +1460,7 @@ export default { // article_id: 6075 }) .then((res) => { - console.log('res at line 1460:', res); + if (res.status == 1) { this.finalReview = res.data; } else { @@ -1389,15 +1468,17 @@ export default { } }); }, - updateChange(content) { - this.abstract = content; + updateChange(type, content) { + + this[type] = content; }, + getTinymceContent(type) { + this.$refs.tinymceChild1.getContent(type); }, getContent(type, content) { - console.log('content at line 1449:', content); - console.log('type at line 1449:', type); + }, // 跳转文章详情 showdetaileditor(data) { @@ -1459,12 +1540,24 @@ export default { .then((res) => { if (res.code == 0) { this.detailMes = res.data.production; - this.abstract = res.data.production.abstract; + this.abstract = res.data.production.abstract?res.data.production.abstract:''; + this.tradition = res.data.production.tradition?res.data.production.tradition:''; + this.mhooStr = res.data.production.mhoo?res.data.production.mhoo:''; if (this.abstract != '') { this.$nextTick(() => { this.$refs.tinymceChild1.setContent(this.abstract); }); } + if (this.tradition != '') { + this.$nextTick(() => { + this.$refs.tinymceChild2.setContent(this.tradition); + }); + } + if (this.mhooStr != '') { + this.$nextTick(() => { + this.$refs.tinymceChild3.setContent(this.mhooStr); + }); + } this.UpTyFIle = res.data.production.file_pdf; this.getArticleFinal(res.data.production.article_id); if (res.data.production.icon != '') { @@ -1753,23 +1846,17 @@ export default { return e.stage_year + ' Vol.' + e.stage_vol + ' issue.' + e.stage_no + e.stage_pagename + e.stage_page; }, async abstractFormat(content) { - content = this.$commonJS.transformHtmlString(content); + content = this.$commonJS.transformHtmlString(content,'content',{keepBr:true}); var div = document.createElement('div'); div.innerHTML = content; - - // 1. 剔除所有 img 标签 var imgTags = div.getElementsByTagName('img'); for (var i = imgTags.length - 1; i >= 0; i--) { imgTags[i].parentNode.removeChild(imgTags[i]); } - - // 2. 新增:剔除所有 table 相关标签(table、tr、td) var tableTags = div.getElementsByTagName('table'); for (var i = tableTags.length - 1; i >= 0; i--) { tableTags[i].parentNode.removeChild(tableTags[i]); } - - // 3. 替换 strong → b、em → i(原有逻辑) var strongTags = div.getElementsByTagName('strong'); for (var i = 0; i < strongTags.length; i++) { var bTag = document.createElement('b'); @@ -1782,32 +1869,43 @@ export default { iTag.innerHTML = emTags[i].innerHTML; emTags[i].parentNode.replaceChild(iTag, emTags[i]); } - // 处理 p 标签 + 解码 content = div.innerHTML; + content = content.replace(/^

\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 @@