diff --git a/dist.zip b/dist.zip deleted file mode 100644 index d7d0f8a..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/node_modules.zip b/node_modules.zip new file mode 100644 index 0000000..5849144 Binary files /dev/null and b/node_modules.zip differ 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 2f22c63..82a0f0d 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -241,24 +241,28 @@ export default { str = capitalizeFirstLetter(str); // 添加蓝色标签 - const regex = /\[(\d+(?:–\d+)?(?:, ?\d+(?:–\d+)?)*)\]/g; + // 1. 修改正则,只匹配不在 标签内的 [数字] +// 这里的思路是:匹配 [内容],但通过逻辑过滤掉已经被包裹的情况 +const regex = /\[(\d+(?:–\d+)?(?:, ?\d+(?:–\d+)?)*)\]/g; - str = str.replace(//g, '').replace(/<\/blue>/g, ''); // 先去掉所有的 标签 +// 注意:不要在最上面执行 str.replace(//g, ''),否则之前的标记就全白做了 - if (regex.test(str)) { - str = str.replace(regex, function (match) { - // 提取出方括号中的内容,并进行匹配 - const content = match.slice(1, match.length - 1); // 去掉方括号 - // 这个需要程序去判断所以需要告诉我满足哪些条件的标蓝 - // 上标中 只有 * # & 纯数字 纯数字逗号 纯数字逗号和空格 ỻ 标蓝 +str = str.replace(regex, function (match, content, offset, fullString) { + // 【关键判断】:检查匹配位置的前后,是否已经存在 + const prefix = fullString.substring(offset - 6, offset); // 是 6 位 + const suffix = fullString.substring(offset + match.length, offset + match.length + 7); // 是 7 位 - // 判断是否符合条件,纯数字、逗号后有空格、连字符 - if (/^\d+$/.test(content) || /, ?/.test(content) || /–/.test(content)) { - return `${match}`; // 如果符合条件则加上蓝色标签 - } - return match; // 如果不符合条件,则保持原样 - }); - } + if (prefix === '' && suffix === '') { + return match; // 如果已经有标签了,原样返回,不重复标记 + } + + // 判断逻辑:纯数字、逗号空格、连字符 + if (/^\d+$/.test(content) || /, ?/.test(content) || /–/.test(content)) { + return `${match}`; + } + + return match; +}); @@ -907,9 +911,9 @@ export default { }); // 2. 删除所有不需要的标签 (除 `strong`, `em`, `sub`, `sup`, `b`, `i` 外的所有标签) if (type == 'table') { - inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|img|myfigure|mytable))[^>]+>/g, ''); // 删除不需要的标签 + inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|img|myfigure|mytable|myh3))[^>]+>/g, ''); // 删除不需要的标签 } else { - inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|myfigure|mytable))[^>]+>/g, ''); // 删除不需要的标签 + inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|myfigure|mytable|myh3))[^>]+>/g, ''); // 删除不需要的标签 } @@ -963,14 +967,11 @@ export default { return parsedData; - } - - - - , + }, async parseTableToArray(tableString, callback) { + const parser = new DOMParser(); const doc = parser.parseFromString(tableString, 'text/html'); const rows = doc.querySelectorAll('table tr'); // 获取所有的行() @@ -993,6 +994,8 @@ export default { ); callback(result) + + // 返回处理后的数组 }, diff --git a/src/components/common/langs/en.js b/src/components/common/langs/en.js index 8e357f8..237e068 100644 --- a/src/components/common/langs/en.js +++ b/src/components/common/langs/en.js @@ -426,6 +426,7 @@ const en = { jump: 'Locate', editAssociation: 'Edit Association', UnbindAssociation: 'Unbind Association', + selectContent: 'Please select the content to operate first', }, pendingPayment: { title: 'Title', diff --git a/src/components/common/langs/zh.js b/src/components/common/langs/zh.js index 4890c3b..40ce74e 100644 --- a/src/components/common/langs/zh.js +++ b/src/components/common/langs/zh.js @@ -412,6 +412,7 @@ const zh = { jump: '定位', editAssociation: '编辑关联', UnbindAssociation: '取消关联', + selectContent: '请先选择需要操作的内容', }, pendingPayment: { title: 'Title', diff --git a/src/components/page/GenerateCharts.vue b/src/components/page/GenerateCharts.vue index ab070ba..67e1a05 100644 --- a/src/components/page/GenerateCharts.vue +++ b/src/components/page/GenerateCharts.vue @@ -88,7 +88,6 @@
- * Content : + { - // 获取用户选中的文本 - const selection = document.getSelection().toString(); - - // 你可以修改剪贴板内容 - // event.clipboardData.setData('text/plain', selection + '\n---来自我的系统---'); - - console.log('用户复制了内容:', selection); - // 阻止默认行为(如果需要自定义复制逻辑的话) - // event.preventDefault(); -}); + // 获取用户选中的文本 + const selection = document.getSelection().toString(); + + // 你可以修改剪贴板内容 + // event.clipboardData.setData('text/plain', selection + '\n---来自我的系统---'); + + console.log('用户复制了内容:', selection); + // 阻止默认行为(如果需要自定义复制逻辑的话) + // event.preventDefault(); + }); }, async activated() { - this.isShowEditComment(); this.getDate(); this.getCommentList(); @@ -624,9 +621,9 @@ export default { methods: { openAddTable(content) { - this.editVisible = false; - this.threeVisible = true; - this.$forceUpdate(); + this.editVisible = false; + this.threeVisible = true; + this.$forceUpdate(); }, async copyArray(data) { try { @@ -690,6 +687,7 @@ export default { async getContent(type, content) { if (type == 'content') { content = this.$commonJS.transformHtmlString(content); + var div = document.createElement('div'); div.innerHTML = content; // 将 HTML 字符串加载到 div 中 // 替换所有 @@ -709,7 +707,7 @@ export default { // 获取最终修改后的 HTML content = div.innerHTML; - + this.saveContent(content, this.currentContent.am_id); } else if (type == 'addcontent') { var hasTable = /[\s\S]*?<\/table>/i.test(content); @@ -722,7 +720,7 @@ export default { return false; } var list = this.$commonJS.cleanAndParseWordContent(content); - console.log('list at line 569:', list); + this.saveContentList(list, this.currentId); } else if (type == 'table') { @@ -771,6 +769,8 @@ export default { }, async saveContent(content, am_id) { + + const loading = this.$loading({ lock: true, text: 'Loading...', @@ -780,8 +780,11 @@ export default { var that = this; var str = content.replace(/^

\s*(.*?)\s*<\/p>$/, '$1').trim(); + if (str.replace(//gi, '').trim() === '') { + str = ''; + } str = await that.$commonJS.decodeHtml(str); - + await that.$api .post(that.urlList.editContent, { am_id: am_id, @@ -816,6 +819,14 @@ export default { spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); + + content = content.map((str) => { + // 逻辑:去掉所有换行符后,如果剩下的内容是空的 + if (str.replace(//gi, '').trim() === '') { + return ''; // 变成真正的空字符串 + } + return str; // 如果有文字,保留原样 + }); await this.$api .post('api/Preaccept/addMoreRow', { article_id: this.articleId, @@ -846,7 +857,6 @@ export default { return rowIndex < head[0].rowspan; // 假设前两行是表头 }, deleteComment(comment, index) { - console.log('comment at line 480:', comment); if (this.isEditComment) { this.$confirm(this.$t('commonTable.removeAnnotations'), 'Prompt', { confirmButtonText: 'Submit', @@ -872,45 +882,45 @@ export default { } }, saveLateX(data) { - console.log('data at line 735:', data); - // 1. 从 data 中解构出 wrap (或者你命名的模式变量) - const { editorId, wmathId, latex, wrap } = data; - const newLatex = latex ? latex.trim() : ''; - - if (!editorId || !wmathId) return; - - const targetEditor = tinymce.get(editorId); - if (!targetEditor) return; - - // 2. 找到编辑器中现有的 wmath 标签 - const targetWmath = targetEditor.dom.select(`wmath[data-id="${wmathId}"]`, targetEditor.getBody())[0]; - - if (targetWmath) { - if (!newLatex) { - // ❌ 删除公式 - targetEditor.dom.remove(targetWmath); - } else { - // ✅ 更新公式 - // 保持属性纯净:同时更新 latex 内容和 wrap 属性 - targetWmath.setAttribute('data-latex', newLatex); - - // 如果 data 中传了 wrap 模式就更新它,否则可以保留原样或设为默认 - if (wrap) { - targetWmath.setAttribute('data-wrap', wrap); - } - - // 内部只放纯 latex 文本,不包裹 $ 符号 - targetWmath.innerHTML = newLatex; + + // 1. 从 data 中解构出 wrap (或者你命名的模式变量) + const { editorId, wmathId, latex, wrap } = data; + const newLatex = latex ? latex.trim() : ''; - setTimeout(() => { - if (typeof renderMathJax === 'function') { - // 重新渲染该编辑器内的数学公式 - renderMathJax(editorId); + if (!editorId || !wmathId) return; + + const targetEditor = tinymce.get(editorId); + if (!targetEditor) return; + + // 2. 找到编辑器中现有的 wmath 标签 + const targetWmath = targetEditor.dom.select(`wmath[data-id="${wmathId}"]`, targetEditor.getBody())[0]; + + if (targetWmath) { + if (!newLatex) { + // ❌ 删除公式 + targetEditor.dom.remove(targetWmath); + } else { + // ✅ 更新公式 + // 保持属性纯净:同时更新 latex 内容和 wrap 属性 + targetWmath.setAttribute('data-latex', newLatex); + + // 如果 data 中传了 wrap 模式就更新它,否则可以保留原样或设为默认 + if (wrap) { + targetWmath.setAttribute('data-wrap', wrap); + } + + // 内部只放纯 latex 文本,不包裹 $ 符号 + targetWmath.innerHTML = newLatex; + + setTimeout(() => { + if (typeof renderMathJax === 'function') { + // 重新渲染该编辑器内的数学公式 + renderMathJax(editorId); + } + }, 10); } - }, 10); - } - } -}, + } + }, async huifu(id) { var that = this; await this.$confirm(this.$t('commonTable.reContent'), 'Prompt', { @@ -987,7 +997,7 @@ export default { var that = this; var dataInfo = this.Main_List.find((item) => item.am_id == dataId); var dataIndex = this.Main_List.indexOf(dataInfo); - + var type = ''; if (dataInfo.type == 1) { type = 'img'; @@ -1094,18 +1104,15 @@ export default { }); }, async changeSort(type, id) { - var that = this; const index = this.Main_List.findIndex((item) => item.am_id == id); - if(type=='up'&&index==0){ - - return - } - if(type=='down'&&index==this.Main_List.length-1){ - - return - } - const load = this.$loading({ + if (type == 'up' && index == 0) { + return; + } + if (type == 'down' && index == this.Main_List.length - 1) { + return; + } + const load = this.$loading({ lock: true, text: 'Loading...', spinner: 'el-icon-loading', @@ -1131,7 +1138,7 @@ export default { }); }, async addCommentSetting(content) { - console.log('content at line 602:', content); + await this.$api .post(this.urlList.addComment, { am_id: content.am_id, @@ -1154,7 +1161,7 @@ export default { }); }, async addComment(content) { - console.log('content at line 603:', this.commentForm); + var str = content.replace(/^

(.*?)<\/p>$/, '$1') ? content.replace(/^

(.*?)<\/p>$/, '$1') : ''; if (str == '') { this.$message({ @@ -1237,13 +1244,13 @@ export default { this.getCommentList(); }, editComment(comment, type) { - console.log('comment at line 813:', comment); + this.commentForm = { ...comment, type: type, remark: type == 'user' ? comment.author_remark : comment.remark }; - console.log('this.commentForm at line 815:', this.commentForm); + this.commentVisible = true; }, async onAddComment(data) { @@ -1288,7 +1295,6 @@ export default { break; } - console.log('data at line 739:', data); await this.$api .post(url, { am_id: data.mainId @@ -1330,21 +1336,19 @@ export default { return; } if (index !== -1 && resData) { - var newData = Array.isArray(resData) ? resData : (resData ? [resData] : []); - const updatedItems= newData.map((item) => ({ - ...item, - checked: false, - getnum: 0, - - })); + var newData = Array.isArray(resData) ? resData : resData ? [resData] : []; + const updatedItems = newData.map((item) => ({ + ...item, + checked: false, + getnum: 0 + })); if (type == 'addRow') { this.Main_List.splice(index + 1, 0, updatedItems[0]); } else if (type == 'addMoreRow') { this.Main_List.splice(index + 1, 0, ...updatedItems); - }else if(type=='positioningImg'||type=='positioningTable'){ + } else if (type == 'positioningImg' || type == 'positioningTable') { this.Main_List.splice(index + 1, 0, ...updatedItems); - } - else { + } else { this.$set(this.Main_List, index, updatedItems[0]); } } else { @@ -1366,7 +1370,7 @@ export default { }); // 处理文件上传并传递回调函数 this.$commonJS.handleFileUpload(event, function (tables) { - console.log('tables at line 1138:', tables); + if (tables.length == 0) { loading.close(); that.$message({ @@ -1614,8 +1618,7 @@ export default { } }, updateChange(content, type) { - // console.log('content at line 1154:', content); - // console.log('content at line 976:', content); + var str = this.$commonJS.transformHtmlString(content); if (type == 'imgNote') { this.picStyle1.note = str; @@ -1685,28 +1688,29 @@ export default { const draggedImage = JSON.parse(event.dataTransfer.getData('image')); const draggedImageIndex = JSON.parse(event.dataTransfer.getData('imageIndex')); this.$nextTick(async () => { - await this.$api .post(this.urlList.setPositioningImage, { am_id: dataId, ami_id: draggedImage.ami_id }) .then(async (res) => { - if (res.code == 0) {loading.close() - this.refreshCurrentContent('positioningImg',dataId, res.data); + if (res.code == 0) { + loading.close(); + this.refreshCurrentContent('positioningImg', dataId, res.data); this.$nextTick(() => { this.$refs.commonWordHtmlTypeSetting.refresh('positioningImg', res.data); }); this.$forceUpdate(); - } else {loading.close() + } else { + loading.close(); this.$message.error(res.msg); } }) - .catch((err) => {loading.close() + .catch((err) => { + loading.close(); this.$message.error(err.msg); }); }); - } else { const draggedtable = JSON.parse(event.dataTransfer.getData('table')); @@ -1717,27 +1721,24 @@ export default { amt_id: draggedtable.amt_id }) .then(async (res) => { - if (res.code == 0) {loading.close() - this.refreshCurrentContent('positioningTable',dataId, res.data); + if (res.code == 0) { + loading.close(); + this.refreshCurrentContent('positioningTable', dataId, res.data); this.$nextTick(() => { this.$refs.commonWordHtmlTypeSetting.refresh('positioningTable', res.data); }); this.$forceUpdate(); } else { - loading.close() + loading.close(); this.$message.error(res.msg); } }) .catch((err) => { - loading.close() + loading.close(); this.$message.error(err.msg); }); }); - - } - - }, getCommentList() { this.$api @@ -1912,8 +1913,11 @@ export default { loading.close(); this.$message.success('Successfully edit Figure!'); this.pictVisible = false; - this.$refs.commonWordHtmlTypeSetting.refresh('editImg', res.data.image?{...res.data.image,has_selected:1}:res.data); - this.refreshCurrentContent('editImg',res.data.am_id, res.data); + this.$refs.commonWordHtmlTypeSetting.refresh( + 'editImg', + res.data.image ? { ...res.data.image, has_selected: 1 } : res.data + ); + this.refreshCurrentContent('editImg', res.data.am_id, res.data); this.$nextTick(() => { this.getCommentList(); this.$forceUpdate(); @@ -1942,7 +1946,6 @@ export default { this.pictVisible = false; this.$refs.commonWordHtmlTypeSetting.refresh('addImg', res.data); - } else { loading.close(); this.$message.error(res.msg); @@ -2026,8 +2029,11 @@ export default { this.$message.success('Successfully edit Table!'); this.threeVisible = false; setTimeout(() => { - this.$refs.commonWordHtmlTypeSetting.refresh('editTable', res.data.table?{...res.data.table,has_selected:1}:res.data); - this.refreshCurrentContent('editTable',res.data.am_id, res.data); + this.$refs.commonWordHtmlTypeSetting.refresh( + 'editTable', + res.data.table ? { ...res.data.table, has_selected: 1 } : res.data + ); + this.refreshCurrentContent('editTable', res.data.am_id, res.data); this.getCommentList(); }); } else { @@ -2571,9 +2577,8 @@ export default { background-color: #0066990d; /* display: block !important; */ } -wmath[data-wrap="inline"] { +wmath[data-wrap='inline'] { display: inline-block !important; width: auto !important; - } diff --git a/src/components/page/OnlineProofreading.vue b/src/components/page/OnlineProofreading.vue index bca82ff..0b477bc 100644 --- a/src/components/page/OnlineProofreading.vue +++ b/src/components/page/OnlineProofreading.vue @@ -721,7 +721,7 @@ export default { return false; } var list = this.$commonJS.cleanAndParseWordContent(content); - console.log('list at line 569:', list); + this.saveContentList(list, this.currentId); } else if (type == 'table') { @@ -1162,7 +1162,7 @@ export default { break; } - console.log('data at line 739:', data); + await this.$api .post(url, { am_id: data.mainId diff --git a/src/components/page/articleDetailEditor.vue b/src/components/page/articleDetailEditor.vue index 4640379..694d4b0 100644 --- a/src/components/page/articleDetailEditor.vue +++ b/src/components/page/articleDetailEditor.vue @@ -1881,8 +1881,37 @@ export default { .catch(() => {}); }, handleClickFinal(data) { - this.finalDecisionData = { ...data }; + console.log("🚀 ~ handleClickFinal ~ data:", data); + + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)', + zIndex: 9999 // 设置一个足够高的层级 + }); + this.$api + .post('api/Finalreview/getById', { + record_id: data.id, + reviewer_id:data.reviewer_id, + }) + .then((res) => { + if (res.status == 1) { + loading.close() + this.finalDecisionData = { ...res.data,reviewer_company : res.data.company,reviewer_email:res.data.email} + this.FinalDecisionVisible = true; + + } else { + loading.close() + this.$message.error(res.msg); + } + }) + .catch((err) => { + loading.close() + console.log(err); + }); + }, handleClickRemark() { this.expanded = !this.expanded; diff --git a/src/components/page/articleListEditor_B1.vue b/src/components/page/articleListEditor_B1.vue index 643f1f1..7e422d1 100644 --- a/src/components/page/articleListEditor_B1.vue +++ b/src/components/page/articleListEditor_B1.vue @@ -2982,11 +2982,12 @@ export default { // 获取文章信息 this.$api .post('api/Preaccept/getArticleMains', { - p_article_id: this.p_article_id + + article_id: this.detailMes.article_id }) .then((res) => { if (res.code == 0) { - this.deMesYul.htmlList = res.data.mains; + this.deMesYul.htmlList = res.data.list; this.preArtVisible = true; } else { this.$message.error(res.msg); diff --git a/src/components/page/comArtHtmlCreatNew.vue b/src/components/page/comArtHtmlCreatNew.vue index 81857ac..3ae2f88 100644 --- a/src/components/page/comArtHtmlCreatNew.vue +++ b/src/components/page/comArtHtmlCreatNew.vue @@ -648,7 +648,7 @@ export default { break; } - console.log('data at line 739:', data); + await this.$api .post(url, { am_id: data.mainId diff --git a/src/components/page/components/EditorArticle/detail.vue b/src/components/page/components/EditorArticle/detail.vue index c2ba66d..20d6a2a 100644 --- a/src/components/page/components/EditorArticle/detail.vue +++ b/src/components/page/components/EditorArticle/detail.vue @@ -5,13 +5,25 @@

- + {{ detailDate.reviewer }} + + {{ detailDate.article_final.reviewer_email }} + + + + + {{ detailDate.article_final.reviewer_company }} + + + {{ detailDate.ctime }} diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue index c553177..45a69c5 100644 --- a/src/components/page/components/Tinymce/index.vue +++ b/src/components/page/components/Tinymce/index.vue @@ -1,5 +1,6 @@
@@ -967,7 +966,7 @@
H1 H2 - H3 + H3
-