diff --git a/src/common/js/commonJS.js b/src/common/js/commonJS.js index 9a515a2..7b859a4 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -73,15 +73,15 @@ export default { getJournalTypeName(value) { - + var list = JSON.parse(localStorage.getItem('journalTypeDataAll')); - if(list&&list.length>0){ - const type = list.find(item => item.value === value); - return type ? type.name : 'OTHERS'; - }else{ + if (list && list.length > 0) { + const type = list.find(item => item.value === value); + return type ? type.name : 'OTHERS'; + } else { return '' } - + }, @@ -119,7 +119,7 @@ export default { - + extractLatexFromMathJax() { @@ -245,7 +245,7 @@ export default { const content = match.slice(1, match.length - 1); // 去掉方括号 // 这个需要程序去判断所以需要告诉我满足哪些条件的标蓝 // 上标中 只有 * # & 纯数字 纯数字逗号 纯数字逗号和空格 ỻ 标蓝 - + // 判断是否符合条件,纯数字、逗号后有空格、连字符 if (/^\d+$/.test(content) || /, ?/.test(content) || /–/.test(content)) { return `${match}`; // 如果符合条件则加上蓝色标签 @@ -412,10 +412,10 @@ export default { if (!vMergeVal || vMergeVal === "continue") { if (rowspan < maxRowspan) { // 限制 rowspan 最大值 rowspan++; - + nextRowIdx++; } else { - + break; } } else if (vMergeVal === "restart") { @@ -556,10 +556,8 @@ export default { const target = rel.getAttribute('Target'); rels[id] = target; }); - const imageInfoMap = {}; const blips = docDom.getElementsByTagName('a:blip'); - Array.from(blips).forEach((blip) => { const embedId = blip.getAttribute('r:embed'); const extent = findExtentElement(blip); @@ -573,7 +571,6 @@ export default { } } }); - mammoth.convertToHtml({ arrayBuffer }, { convertImage: mammoth.images.inline(async function (image) { console.log('image at line 163:', image) @@ -834,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` 外的所有标签) @@ -864,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'); // 合并连续的 标签 @@ -1204,9 +1199,9 @@ export default { // 遍历行 table.forEach((row) => { tableHtml += ``; -if(row&&row.length>0){ - row.forEach((cell) => { - tableHtml += ` + if (row && row.length > 0) { + row.forEach((cell) => { + tableHtml += ` 0){ ${cell.text} `; - }); -}else{ - tableHtml+=`` -} + }); + } else { + tableHtml += `` + } // 遍历单元格 - + tableHtml += ``; }); @@ -2111,41 +2106,41 @@ if(row&&row.length>0){ - + // 全部大写按钮(按钮文本:A) -ed.ui.registry.addButton('myuppercase', { - text: 'A', // 按钮文本(大写标识) - onAction: function () { - // 获取选中的文本(保留 HTML 格式,确保空格等内容不丢失) - var selectedText = ed.selection.getContent({ format: 'html' }); + ed.ui.registry.addButton('myuppercase', { + text: 'A', // 按钮文本(大写标识) + onAction: function () { + // 获取选中的文本(保留 HTML 格式,确保空格等内容不丢失) + var selectedText = ed.selection.getContent({ format: 'html' }); - // 校验:非空且仅含字母、数字、空格(可根据需求调整正则) - // if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) { - // 直接将选中的所有内容转为大写(无需正则,整体转换) - var allUppercaseText = selectedText.toUpperCase(); - // 替换选中的文本 - ed.selection.setContent(allUppercaseText); - // } else { - // vueInstance.$message.error(vueInstance.$t('commonTable.selectWord')); - // } - } -}); + // 校验:非空且仅含字母、数字、空格(可根据需求调整正则) + // if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) { + // 直接将选中的所有内容转为大写(无需正则,整体转换) + var allUppercaseText = selectedText.toUpperCase(); + // 替换选中的文本 + ed.selection.setContent(allUppercaseText); + // } else { + // vueInstance.$message.error(vueInstance.$t('commonTable.selectWord')); + // } + } + }); -// 全部小写按钮(按钮文本:a) -ed.ui.registry.addButton('myuppercasea', { - text: 'a', // 按钮文本(小写标识) - onAction: function () { - var selectedText = ed.selection.getContent({ format: 'html' }); + // 全部小写按钮(按钮文本:a) + ed.ui.registry.addButton('myuppercasea', { + text: 'a', // 按钮文本(小写标识) + onAction: function () { + var selectedText = ed.selection.getContent({ format: 'html' }); - // if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) { - // 直接将选中的所有内容转为小写(整体转换) - var allLowercaseText = selectedText.toLowerCase(); - ed.selection.setContent(allLowercaseText); - // } else { - // vueInstance.$message.error(vueInstance.$t('commonTable.selectWord')); - // } - } -}); + // if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) { + // 直接将选中的所有内容转为小写(整体转换) + var allLowercaseText = selectedText.toLowerCase(); + ed.selection.setContent(allLowercaseText); + // } else { + // vueInstance.$message.error(vueInstance.$t('commonTable.selectWord')); + // } + } + }); ed.ui.registry.addButton('Line', { text: '–', // 按钮文本 onAction: function () { diff --git a/src/components/common/Redirect.vue b/src/components/common/Redirect.vue new file mode 100644 index 0000000..5af66d5 --- /dev/null +++ b/src/components/common/Redirect.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/components/common/Tags.vue b/src/components/common/Tags.vue index 7150c40..43e64b3 100644 --- a/src/components/common/Tags.vue +++ b/src/components/common/Tags.vue @@ -65,6 +65,9 @@ if(this.tagsList.length >= 8){ this.tagsList.shift(); } + if(route.meta.hideInTags){ + return false; + } this.tagsList.push({ title: route.meta.title, path: route.fullPath, @@ -90,7 +93,9 @@ created(){ this.setTags(this.$route); // 监听关闭当前页面的标签页 + bus.$on('close_current_tags', () => { + console.log('出发关闭当前标签页'); for (let i = 0, len = this.tagsList.length; i < len; i++) { const item = this.tagsList[i]; if(item.path === this.$route.fullPath){ @@ -106,7 +111,11 @@ } } }) - } + }, +// beforeDestroy() { +// // 销毁监听,防止内存泄漏 +// this.$bus.$off('close_current_tags'); +// } } 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 283d8a3..496c84a 100644 --- a/src/components/page/articleAdd.vue +++ b/src/components/page/articleAdd.vue @@ -1067,6 +1067,7 @@ 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 @@