From 5c7fbb76fa2dcf6cc320593578e9f7f0d123788f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Wed, 21 Jan 2026 14:34:14 +0800 Subject: [PATCH] tijiao --- src/assets/css/main.css | 8 +- src/common/js/commonJS.js | 8 + src/components/common/Header.vue | 2 +- src/components/common/Header2.vue | 2 +- src/components/common/langs/en.js | 25 +- src/components/common/langs/zh.js | 23 +- src/components/page/GenerateCharts.vue | 578 ++++++---- src/components/page/OnlineProofreading.vue | 2 +- src/components/page/articleListEditor_B1.vue | 220 +++- src/components/page/comArtHtmlCreatNew.vue | 2 +- .../page/components/table/DynamicTable.vue | 243 ++++ .../page/components/table/LateX.vue | 4 +- .../page/components/table/MediaLinkDialog.vue | 9 +- .../page/components/table/catalogue.vue | 262 +++++ .../page/components/table/content.vue | 2 +- .../page/components/table/table.vue | 80 +- .../page/components/table/word copy.vue | 2 +- src/components/page/components/table/word.vue | 1001 +++++++---------- .../components/table/wordHtmlTypesetting.vue | 328 +++--- src/components/page/per_text.vue | 8 +- 20 files changed, 1729 insertions(+), 1080 deletions(-) create mode 100644 src/components/page/components/table/DynamicTable.vue create mode 100644 src/components/page/components/table/catalogue.vue diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 6634b84..2cf126f 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -9,7 +9,13 @@ margin: 0; padding: 0; } - +/* 禁止选中特定段落或组件 */ +.no-select { + user-select: none; /* 标准语法 */ + -webkit-user-select: none; /* Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} html, body, #app, diff --git a/src/common/js/commonJS.js b/src/common/js/commonJS.js index 04e0b86..e6f6b8f 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -2055,6 +2055,14 @@ export default { onAction: () => { // 插入自定义表格到编辑器中 ed.setContent(''); + const customCallback = ed.getParam('clear_custom_action'); + if (typeof customCallback === 'function') { + customCallback(ed, vueInstance); + } else { + // 3. 如果没有自定义逻辑,执行默认逻辑 + vueInstance.$emit('onClear'); + } + } }); diff --git a/src/components/common/Header.vue b/src/components/common/Header.vue index 3d1623b..febaf40 100644 --- a/src/components/common/Header.vue +++ b/src/components/common/Header.vue @@ -18,7 +18,7 @@ -
+
diff --git a/src/components/common/Header2.vue b/src/components/common/Header2.vue index b406822..5e0ee7b 100644 --- a/src/components/common/Header2.vue +++ b/src/components/common/Header2.vue @@ -7,7 +7,7 @@
-
+
diff --git a/src/components/common/langs/en.js b/src/components/common/langs/en.js index f3498b6..8e357f8 100644 --- a/src/components/common/langs/en.js +++ b/src/components/common/langs/en.js @@ -395,16 +395,19 @@ const en = { typesettingType2: 'Horizontal A4', typesettingType1: 'Vertical A4', AnnotationList: 'Annotation List', - Annotations: 'Annotations', + Annotations: 'Comments', exportWord: 'Export Word', exportImg: 'Export PNG', PaperRotation: 'Paper Rotation', removeAnnotations: 'Are you sure you want to delete this Annotation?', removeProofread: 'Are you sure to delete this suggestion?', removeContent: 'Are you sure you want to delete this content?', + removeimg: 'Are you sure you want to delete this figure?', + removetable: 'Are you sure you want to delete this table?', reContent: 'Are you sure you want to restore this content?', uploadImageInfo: 'Figures can only upload files in JPG, JPEG, and PNG formats!', selectComment: 'Please select the text to add annotations to!', + selectLinkText: 'Please select the target text content before associating it with a figure or table.', selectWord: 'Please select only a single word!', selectOne: 'Please select only a single paragraph!', alreadyCommented: 'There are already annotations in the text, please select again!', @@ -422,6 +425,7 @@ const en = { MoveDown: 'Move Down', jump: 'Locate', editAssociation: 'Edit Association', + UnbindAssociation: 'Unbind Association', }, pendingPayment: { title: 'Title', @@ -543,7 +547,24 @@ const en = { state194: 'Proportion of references from JCR Q2', state21: 'Probability of article being cited', - } + }, + + imageTask: { + "title": "Image Task Center", + "completed": "All Tasks Completed", + "preparing": "Preparing {total} images...", + "progress": "Progress: {current} / {total}", + "allDone": "Successfully processed {total} images", + "manualClose": "Tasks completed. Please close manually.", + "parsing": "Parsing...", + "uploading": "Uploading...", + "success": "Success", + "tooLarge": "Too Large (>1MB)", + "error": "Error: {msg}", + "imgLabel": "Img" + } + + } diff --git a/src/components/common/langs/zh.js b/src/components/common/langs/zh.js index a7b496d..4890c3b 100644 --- a/src/components/common/langs/zh.js +++ b/src/components/common/langs/zh.js @@ -389,9 +389,12 @@ const zh = { removeAnnotations: '确定要删除这条批注吗?', removeProofread: '确定要删除这条建议吗?', removeContent: '确定要删除这条内容吗?', + removeimg: '确定要删除这张图片吗?', + removetable: '确定要删除这个表格吗?', reContent: '确定要恢复这条内容吗?', uploadImageInfo: 'Figures 只能上传 JPG、JPEG 和 PNG 格式的文件', selectComment: '请选择要添加批注的文本', + selectLinkText: '执行图表关联前,请先选定目标文本内容', selectWord:'请只选中单个单词!', selectOne:'请只勾选单个段落!', alreadyCommented:'文本中已有批注内容请重新选择', @@ -406,8 +409,9 @@ const zh = { BatchAddcontent: '批量添加内容', MoveUp: '上移', MoveDown: '下移', - jump: 'Locate', - editAssociation: 'Edit Association', + jump: '定位', + editAssociation: '编辑关联', + UnbindAssociation: '取消关联', }, pendingPayment: { title: 'Title', @@ -525,7 +529,22 @@ const zh = { state193: '参考文献JCR1区比例', state194: '参考文献JCR2区比例', state21: '文章被引用概率', + }, + imageTask: { + "title": "图片任务中心", + "completed": "所有任务处理完毕", + "preparing": "正在准备 {total} 张图片...", + "progress": "处理进度: {current} / {total}", + "allDone": "已成功处理全部 {total} 张任务", + "manualClose": "任务已结束,请手动关闭窗口", + "parsing": "正在解析...", + "uploading": "正在上传...", + "success": "成功", + "tooLarge": "过大跳过(>1MB)", + "error": "失败: {msg}", + "imgLabel": "图" } + } diff --git a/src/components/page/GenerateCharts.vue b/src/components/page/GenerateCharts.vue index 00e2818..a290caf 100644 --- a/src/components/page/GenerateCharts.vue +++ b/src/components/page/GenerateCharts.vue @@ -16,7 +16,7 @@
+
-
- +
* Table: - + - +
@@ -427,6 +429,7 @@ import Tiff from 'tiff.js'; import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑 import Tinymce from '@/components/page/components/Tinymce'; import bottomTinymce from '@/components/page/components/Tinymce'; +import catalogue from '@/components/page/components/table/catalogue.vue'; export default { data() { return { @@ -465,9 +468,11 @@ export default { setPositioningImage: 'api/Preaccept/positioningImage', removePositioningImage: 'api/Preaccept/removeImage', addImage: 'api/Preaccept/addMainImage', - editImage: 'api/Preaccept/editMainImage', addTable: 'api/Preaccept/addMainTable', - editTable: 'api/Preaccept/editMainTable' + editImage: 'api/Preaccept/editMainImage', + editTable: 'api/Preaccept/editMainTable', + deleteImage: 'api/Articlemain/removeMainImage', + deleteTable: 'api/Articlemain/removeMainTable' }, wordStyle: ` // p { @@ -552,7 +557,8 @@ export default { }, components: { Tinymce, - bottomTinymce + bottomTinymce, + catalogue }, computed: { combinedValue() { @@ -582,20 +588,16 @@ export default { } }, async created() { - // await this.$api.post('api/Proofread/proofRead', { - // article_id: this.$route.query.id - // }); + localStorage.removeItem('scrollPosition'); this.isShowEditComment(); this.getDate(); this.getCommentList(); - // this.loadDictionary().catch(console.error); + }, mounted() {}, async activated() { - // await this.$api.post('api/Proofread/proofRead', { - // article_id: this.$route.query.id - // }); + this.isShowEditComment(); this.getDate(); this.getCommentList(); @@ -705,38 +707,55 @@ export default { this.addComment(content); } }, - -handleConfirmLink(selectedMedia) { - // selectedMedia 是你从 el-radio 列表中选中的那一项(包含 ami_id 或 amt_id) - const targetId = selectedMedia.select.amt_id || selectedMedia.select.ami_id; - - const type = selectedMedia.type; // 'table' 或 'figure' - const tagName = `my${type}`; // 生成 mytable 或 myfigure - - // 获取当前段落原本的完整 HTML 内容 - let originalContent = selectedMedia.linkData.content; - // 获取用户选中的纯文本片段 - const label = selectedMedia.linkData.label; + handleUnbindLink(data) { + const { label, mainId, index, content } = data; - if (!label || !originalContent) return; + const unwrapTag = (str) => { + return str.replace(/<(myfigure|mytable)[^>]*>([\s\S]*?)<\/\1>/gi, '$2'); + }; - // --- 核心替换逻辑 --- - // 使用正则匹配选中的文字,并用自定义标签包裹它 - // 注意:这里需要考虑 label 在 HTML 中可能被拆分的情况,简单处理可直接 replace - const replacement = `<${tagName} data-id="${targetId}">${label}`; - - // 执行替换(仅替换第一次匹配到的,防止全篇误伤) - const newContent = originalContent.replace(label, replacement); + // 2. 执行替换 + // 我们只针对传入的这个特定的 label 进行剥壳 + const strippedLabel = unwrapTag(label); - -console.log('newContent at line 592:', newContent); -this.saveContent(newContent, selectedMedia.linkData.mainId); + // 3. 将 content 中的原标签替换为剥壳后的文字 + // 使用 split/join 或者是精准 replace,确保只替换这一处 + const newContent = content.replace(label, strippedLabel); + this.saveContent(newContent, mainId); + }, + handleConfirmLink(selectedMedia) { + const targetId = selectedMedia.select.amt_id || selectedMedia.select.ami_id; + const type = selectedMedia.type; + const tagName = `my${type}`; + let originalContent = selectedMedia.linkData.content; + const label = selectedMedia.linkData.label; + if (!label || !originalContent) return; + const isAlreadyTagged = label.startsWith(''); + let newContent = ''; + if (isAlreadyTagged) { + const updatedTag = label + .replace(/$/, ``); + + newContent = originalContent.replace(label, updatedTag); + } else { + const replacement = `<${tagName} data-id="${targetId}">${label}`; + newContent = originalContent.replace(label, replacement); + } + this.saveContent(newContent, selectedMedia.linkData.mainId); }, async saveContent(content, am_id) { + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); var that = this; var str = content.replace(/^

\s*(.*?)\s*<\/p>$/, '$1').trim(); - + str = await that.$commonJS.decodeHtml(str); await that.$api @@ -746,10 +765,18 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }) .then(async (res) => { if (res.code == 0) { + loading.close(); this.editVisible = false; - this.getDate(); + this.refreshCurrentContent('content', am_id, res.data); this.getCommentList(); + } else { + loading.close(); + this.$message.error(res.msg); } + }) + .catch((err) => { + loading.close(); + this.$message.error(err); }); }, async saveContentList(content, am_id) { @@ -759,7 +786,12 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); message: 'Please enter the content!' }); } - + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); await this.$api .post('api/Preaccept/addMoreRow', { article_id: this.articleId, @@ -768,10 +800,18 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }) .then(async (res) => { if (res.code == 0) { + loading.close(); this.addContentVisible = false; - this.getDate(); + this.refreshCurrentContent('addMoreRow', am_id, res.data); this.getCommentList(); + } else { + loading.close(); + this.$message.error(res.msg); } + }) + .catch((err) => { + loading.close(); + this.$message.error(err); }); }, isHeaderRow(rowIndex, table) { @@ -877,8 +917,10 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); var am_id; if (type == 'img') { am_id = this.Main_List.find((item) => item.ami_id == id).am_id; - } else { + } else if (type == 'table') { am_id = this.Main_List.find((item) => item.amt_id == id).am_id; + } else { + am_id = id; } if (am_id) { this.goToComment(am_id); @@ -903,8 +945,10 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); } }, async onDelete(dataId) { + 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'; @@ -913,53 +957,70 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); } else if (dataInfo.type == 0) { type = 'content'; } + var url = ''; + switch (type) { + case 'table': + url = that.urlList.removePositioningTable; + break; + case 'img': + url = that.urlList.removePositioningImage; + break; + case 'content': + url = that.urlList.delete; + break; + } + if (dataInfo.type == 0 && dataInfo.content == '') { + await that.$api + .post(url, { + am_id: dataId + }) + .then(async (res) => { + if (res.code == 0) { + setTimeout(() => { + that.Main_List.splice(dataIndex, 1); - await this.$confirm(this.$t('commonTable.removeContent'), 'Prompt', { - confirmButtonText: 'Submit', - cancelButtonText: 'Cancel', - type: 'warning' - }) - .then(async () => { - var that = this; - var url = ''; - switch (type) { - case 'table': - url = that.urlList.removePositioningTable; - break; - case 'img': - url = that.urlList.removePositioningImage; - break; - case 'content': - url = that.urlList.delete; - break; - } - await that.$api - .post(url, { - am_id: dataId - }) - .then(async (res) => { - if (res.code == 0) { - setTimeout(() => { - that.getDate(); - that.getCommentList(); - if (type == 'img') { - that.$refs.commonWordHtmlTypeSetting.refresh('img'); - } else { - that.$refs.commonWordHtmlTypeSetting.refresh('table'); - } - - that.$forceUpdate(); - }); - } - }); - // this.Main_List.splice( - // this.Main_List.findIndex((item) => item.p_main_id == dataId), - // 1 - // ); + that.getCommentList(); + that.$forceUpdate(); + }); + } else { + this.$message.error(res.msg); + } + }) + .catch((err) => { + this.$message.error(err); + }); + } else { + await this.$confirm(this.$t('commonTable.removeContent'), 'Prompt', { + confirmButtonText: 'Submit', + cancelButtonText: 'Cancel', + type: 'warning' }) - .catch((err) => { - console.log('err at line 466:', err); - }); + .then(async () => { + await that.$api + .post(url, { + am_id: dataId + }) + .then(async (res) => { + if (res.code == 0) { + setTimeout(() => { + that.Main_List.splice(dataIndex, 1); + that.$forceUpdate(); + if (type == 'img') { + that.$refs.commonWordHtmlTypeSetting.refresh('removeImg', { ami_id: dataInfo.ami_id }); + } else if (type == 'table') { + that.$refs.commonWordHtmlTypeSetting.refresh('removeTable', { amt_id: dataInfo.amt_id }); + } + that.getCommentList(); + + that.$forceUpdate(); + }); + } + }); + }) + .catch((err) => { + console.log('err at line 466:', err); + }); + } }, async onDeletes(dataId) { await this.$confirm(this.$t('commonTable.removeContent'), 'Prompt', { @@ -978,8 +1039,8 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); setTimeout(() => { that.getDate(); that.getCommentList(); - that.$refs.commonWordHtmlTypeSetting.refresh('img'); - that.$refs.commonWordHtmlTypeSetting.refresh('table'); + that.$refs.commonWordHtmlTypeSetting.reload(); + that.$forceUpdate(); }); } @@ -994,20 +1055,40 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }); }, 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({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); await that.$api .post(type == 'up' ? '/api/Preaccept/upArticleMain' : '/api/Preaccept/downArticleMain', { am_id: id }) .then(async (res) => { if (res.code == 0) { - setTimeout(() => { - that.getDate(); - that.getCommentList(); - - that.$forceUpdate(); - }); + load.close(); + await this.refreshCurrentContent(`${type}ArticleMain`, id); + that.$forceUpdate(); + } else { + load.close(); + this.$message.error(res.msg); } + }) + .catch((err) => { + load.close(); + this.$message.error(err); }); }, async addCommentSetting(content) { @@ -1103,7 +1184,7 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); if (data && data.remark) { this.$alert( `

${data.remark}

`, - 'Annotations', + 'Comments', { confirmButtonText: 'OK', dangerouslyUseHTMLString: true, // 启用 HTML 渲染 @@ -1146,6 +1227,12 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); this.commentVisible = true; }, async onEditTitle(data) { + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); var url; switch (data.value) { case 0: @@ -1168,13 +1255,64 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); am_id: data.mainId }) .then(async (res) => { - this.getDate(); - this.getCommentList(); + if (res.code == 0) { + await this.refreshCurrentContent('content', data.mainId, res.data); + loading.close(); + this.getCommentList(); + } }) .catch((err) => { + loading.close(); this.$message.error(err.msg); }); }, + async refreshCurrentContent(type, mainId, resData) { + const index = this.Main_List.findIndex((item) => item.am_id == mainId); + if (type == 'upArticleMain') { + if (index == 0) { + return; + } + const item = this.Main_List[index]; + // 2. 从原位置删除 + this.Main_List.splice(index, 1); + // 3. 插入到前一个位置 + this.Main_List.splice(index - 1, 0, item); + return; + } + if (type == 'downArticleMain') { + if (index == this.Main_List.length - 1) { + return; + } + const item = this.Main_List[index]; + // 2. 从原位置删除 + this.Main_List.splice(index, 1); + // 3. 插入到前一个位置 + this.Main_List.splice(index + 1, 0, item); + return; + } + if (index !== -1 && resData) { + 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'){ + this.Main_List.splice(index + 1, 0, ...updatedItems); + } + else { + this.$set(this.Main_List, index, updatedItems[0]); + } + } else { + console.warn(`Item with am_id ${mainId} not found.`); + } + this.$forceUpdate(); + }, handlePaperclip() { this.uploadWordTables = []; this.$refs.fileInput.click(); @@ -1231,21 +1369,18 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }, async onAddRow(mainId) { - await this.$api .post(this.urlList.addRow, { am_id: mainId, article_id: this.articleId }) .then(async (res) => { - if(res.code == 0){ - this.getDate(); - - this.getCommentList(); - }else{ + if (res.code == 0) { + this.refreshCurrentContent('addRow', mainId, res.data); + this.getCommentList(); + } else { this.$message.error(res.msg); } - }) .catch((err) => { this.$message.error(err.msg); @@ -1270,8 +1405,6 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }, async executeProofreading(data) { - console.log('data at line 1225:', data); - await this.$api .post(this.urlList.executeProofreading, { am_id: data.am_id, @@ -1292,8 +1425,6 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); }); }, async revokeProofreading(data) { - console.log('data at line 1225:', data); - await this.$api .post(this.urlList.executeProofreading, { am_id: data.am_id, @@ -1313,13 +1444,8 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); this.$message.error(err.msg); }); }, - async editProofreading(data) { - console.log('data at line 1225:', data); - }, - deleteProofreading(data, index) { - console.log('comment at line 480:', data); - - }, + async editProofreading(data) {}, + deleteProofreading(data, index) {}, async cancelSolveComment(data) { await this.$api @@ -1363,7 +1489,69 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); this.lineStyle.visiTitle = 'Add Table'; this.threeVisible = true; }, - handleImageEdit(data, type) { + + async handleFigureAndTableDelete(data, type) { + await this.$confirm(this.$t('commonTable.remove' + type), 'Prompt', { + confirmButtonText: 'Submit', + cancelButtonText: 'Cancel', + type: 'warning' + }) + .then(async (res) => { + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + if (type == 'img') { + this.$api + .post(this.urlList.deleteImage, { + ami_id: data.ami_id, + + article_id: this.articleId + }) + .then(async (res) => { + if (res.status == 1) { + loading.close(); + this.$message.success(res.msg); + this.$refs.commonWordHtmlTypeSetting.replacement('img', data.ami_id); + } else { + loading.close(); + this.$message.error(res.msg); + } + }) + .catch((err) => { + loading.close(); + this.$message.error(err.msg); + }); + } + if (type == 'table') { + this.$api + .post(this.urlList.deleteTable, { + amt_id: data.amt_id, + + article_id: this.articleId + }) + .then(async (res) => { + if (res.status == 1) { + loading.close(); + this.$refs.commonWordHtmlTypeSetting.replacement('table', data.amt_id); + } else { + loading.close(); + this.$message.error(res.msg); + } + }) + .catch((err) => { + loading.close(); + this.$message.error(err.msg); + }); + } + }) + .catch((err) => { + // this.$message.error(err.msg); + }); + }, + handleFigureAndTableEdit(data, type) { if (type == 'img') { var extension = data.url.split('.').pop().toLowerCase(); this.picStyle = {}; @@ -1373,17 +1561,15 @@ this.saveContent(newContent, selectedMedia.linkData.mainId); } else if (type == 'table') { this.lineStyle = {}; this.lineStyle1 = {}; - // 1. 提取处理逻辑 -const formattedData = { - ...data, - table: JSON.parse(data.table_data), - // 如果 data 中已经包含了 html_data, note, title,且不需要特殊处理, - // 解构赋值 (...data) 其实已经把它们带进来了。 -}; + // 1. 提取处理逻辑 + const formattedData = { + ...data, + table: JSON.parse(data.table_data) + }; -// 2. 统一赋值 -this.lineStyle = formattedData; -this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指向不同引用(如果需要独立修改) + // 2. 统一赋值 + this.lineStyle = formattedData; + this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指向不同引用(如果需要独立修改) this.lineStyle.visiTitle = 'Edit Table'; this.threeVisible = true; } @@ -1448,36 +1634,40 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 this.currentId = dataId; }, - + async onDrop(event, dataId) { + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); if (event.dataTransfer.getData('image')) { 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) { - this.getDate(); + if (res.code == 0) {loading.close() + this.refreshCurrentContent('positioningImg',dataId, res.data); this.$nextTick(() => { - this.$refs.commonWordHtmlTypeSetting.refresh('img'); + this.$refs.commonWordHtmlTypeSetting.refresh('positioningImg', res.data); }); this.$forceUpdate(); - } else { + } else {loading.close() this.$message.error(res.msg); } }) - .catch((err) => { + .catch((err) => {loading.close() this.$message.error(err.msg); }); }); - // this.Main_List.splice(index + 1, 0, draggedImage); - // this.$nextTick(() => { - // this.$refs.commonWordHtmlTypeSetting.changeIsHidden(draggedImageIndex, true, 'img'); - // }); + } else { const draggedtable = JSON.parse(event.dataTransfer.getData('table')); @@ -1488,28 +1678,27 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 amt_id: draggedtable.amt_id }) .then(async (res) => { - if (res.code == 0) { - this.getDate(); + if (res.code == 0) {loading.close() + this.refreshCurrentContent('positioningTable',dataId, res.data); this.$nextTick(() => { - this.$refs.commonWordHtmlTypeSetting.refresh('table'); + this.$refs.commonWordHtmlTypeSetting.refresh('positioningTable', res.data); }); this.$forceUpdate(); } else { + loading.close() this.$message.error(res.msg); } }) .catch((err) => { + loading.close() this.$message.error(err.msg); }); }); - // const draggedtableIndex = JSON.parse(event.dataTransfer.getData('tableIndex')); - - // this.Main_List.splice(index + 1, 0, draggedtable); - // console.log('this.Main_List.splice at line 447:', this.Main_List); + } - // this.getWord(); + }, getCommentList() { this.$api @@ -1522,13 +1711,10 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 }); }, getWord() { - this.htmlContent = 'true'; - }, // 获取数据 async getDate() { - this.imagesList = []; let urlLInk = ''; let urlTask = {}; @@ -1548,7 +1734,7 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 .post(urlLInk, urlTask) .then(async (res) => { if (res.code == 0) { - this.Main_List = res.data.list.map(e=>{ + this.Main_List = res.data.list.map((e) => { e.checked = false; return e; }); @@ -1556,14 +1742,12 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 for (let i = 0; i < this.Main_List.length; i++) { this.Main_List[i].text = this.Main_List[i].content; this.Main_List[i].getnum = 0; - // this.Main_List[i].checked = false; } - - // setTimeout(async () => { this.$nextTick(async () => { await this.getWord(); - - + if (this.$refs.catalogue) { + await this.$refs.catalogue.getCatalogueList(); + } loading.close(); }); // }, 1000); @@ -1659,8 +1843,6 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 // 确定保存图片 async savePic() { - - var str = this.picStyle1.note ? await this.$commonJS.decodeHtml(this.picStyle1.note) : ''; var titleStr = this.picStyle1.title ? await this.$commonJS.decodeHtml(this.picStyle1.title) : ''; @@ -1672,6 +1854,12 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 this.$message.error('Please enter a title'); return; } + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); if (this.picStyle.visiTitle == 'Edit Figure') { this.$api .post(this.urlList.editImage, { @@ -1682,20 +1870,22 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 }) .then((res) => { if (res.code == 0) { + 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.$nextTick(() => { - this.getDate(); this.getCommentList(); this.$forceUpdate(); }); - - this.$refs.commonWordHtmlTypeSetting.refresh('img'); } else { + loading.close(); this.$message.error(res.msg); } }) .catch((err) => { + loading.close(); this.$message.error(err); }); } else { @@ -1708,15 +1898,19 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 }) .then((res) => { if (res.code == 0) { + loading.close(); this.$message.success('Successfully Add Figure!'); this.pictVisible = false; - this.getDate(); - this.$refs.commonWordHtmlTypeSetting.refresh('img'); + + this.$refs.commonWordHtmlTypeSetting.refresh('addImg', res.data); + } else { + loading.close(); this.$message.error(res.msg); } }) .catch((err) => { + loading.close(); this.$message.error(err); }); } @@ -1766,18 +1960,18 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 } if (strTitle != '') { strTitle = await this.$commonJS.decodeHtml(strTitle); - }else{ + } else { this.$message.error('Please enter a title'); return; } - + if (content && cleanedTableList && cleanedTableList.length > 0) { const loading = this.$loading({ - lock: true, - text: 'Loading...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); if (this.lineStyle.visiTitle == 'Edit Table') { this.$api .post(this.urlList.editTable, { @@ -1789,21 +1983,22 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 }) .then((res) => { if (res.code == 0) { + loading.close(); this.$message.success('Successfully edit Table!'); this.threeVisible = false; setTimeout(() => { - this.getDate(); + 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(); - this.$refs.commonWordHtmlTypeSetting.refresh('table'); }); } else { - this.$message.error(res.msg); loading.close(); + this.$message.error(res.msg); } }) .catch((err) => { - this.$message.error(err); loading.close(); + this.$message.error(err); }); } else { this.$api @@ -1816,14 +2011,14 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 }) .then((res) => { if (res.code == 0) { + loading.close(); this.$message.success('Successfully Add Table!'); this.threeVisible = false; - this.getDate(); - loading.close(); - this.$refs.commonWordHtmlTypeSetting.refresh('table'); + + this.$refs.commonWordHtmlTypeSetting.refresh('addTable', res.data); } else { - this.$message.error(res.msg); loading.close(); + this.$message.error(res.msg); } }) .catch((err) => { @@ -1940,7 +2135,7 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 this.$message.error('Picture size cannot exceed 20M!'); return false; } - + const isValidFormat = ['image/jpeg', 'image/png', 'image/tiff'].includes(file.type); if (!isValidFormat) { this.$message.error(this.$t('commonTable.uploadImageInfo')); @@ -2337,5 +2532,4 @@ this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指 background-color: #0066990d; /* display: block !important; */ } - diff --git a/src/components/page/OnlineProofreading.vue b/src/components/page/OnlineProofreading.vue index 4c99c86..bca82ff 100644 --- a/src/components/page/OnlineProofreading.vue +++ b/src/components/page/OnlineProofreading.vue @@ -1103,7 +1103,7 @@ export default { if (data && data.remark) { this.$alert( `

${data.remark}

`, - 'Annotations', + 'Comments', { confirmButtonText: 'OK', dangerouslyUseHTMLString: true, // 启用 HTML 渲染 diff --git a/src/components/page/articleListEditor_B1.vue b/src/components/page/articleListEditor_B1.vue index 4d005f2..a7b3870 100644 --- a/src/components/page/articleListEditor_B1.vue +++ b/src/components/page/articleListEditor_B1.vue @@ -124,7 +124,7 @@ :value="tradition" class="paste-area text-container" :toolbar="[ - 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|clearButton' + 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton' ]" style=" line-height: 12px; @@ -155,7 +155,7 @@ :value="mhooStr" class="paste-area text-container" :toolbar="[ - 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|clearButton' + 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton' ]" style=" line-height: 12px; @@ -199,7 +199,7 @@ :value="abstract" class="paste-area text-container" :toolbar="[ - 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|clearButton' + 'bold italic |customBlue removeBlue|myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton' ]" style=" line-height: 12px; @@ -688,39 +688,92 @@

{{ tabsList[5].name }}

-
- Choose Template : - - - - - - Create Manuscript - -
-
-
Download list
-

No Manuscript

-
- - Typesetting {{ index + 1 }} - Time : {{ modifDate(item.ctime * 1000) }} - - - +
+
Improve information
+ + + + https://doi.org/10.53388/ + + + + + + + +
+ + + Save Essential Information +
- -
+
+
+
+
+ Choose Template : + + + + + Create Manuscript + +
+ +
+
Download list
+

No Manuscript

+
+ + Typesetting {{ index + 1 }} + Time : {{ modifDate(item.ctime * 1000) }} + + + +
+
+
+ +
+
+ + {{ isGenerating ? 'Generating PDF...' : 'Generate PDF' }} + + Click the button below to start high-quality PDF typesetting. +
+
+
Download list
+

No Manuscript

+
+ + Typesetting {{ index + 1 }} + Time : {{ modifDate(item.ctime * 1000) }} + + + +
+
+ + +
+
+
Upload the final typeset file
@@ -767,34 +820,7 @@
-
-
-
Improve information
- - - - https://doi.org/10.53388/ - - - - - - - -
- - - Save Essential Information - -
-
+
@@ -994,6 +1020,8 @@ import Tinymce from '@/components/page/components/Tinymce'; export default { data() { return { + isGenerating: false, // 按钮加载状态 + percentage: 0, // 进度条 finalReview: null, baseUrl: this.Common.baseUrl, mediaUrl: this.Common.mediaUrl, @@ -1452,6 +1480,42 @@ export default { this.getWorldPdf(); }, methods: { + async generatePDF() { + // 1. 验证是否选择了模板 + if (!this.shuTter.board) { + this.$message.warning("Please select a template first!"); + return; + } + + this.isGenerating = true; + this.percentage = 0; + + try { + // 模拟进度条逻辑(如果是真实接口,可以根据后端返回或者固定时长模拟) + let timer = setInterval(() => { + if (this.percentage < 90) this.percentage += 10; + }, 500); + + // 调用你的生成接口 (假设是 Establish 的升级版) + // const res = await api.createPDF({ board: this.shuTter.board }); + + // 模拟接口请求耗时 + await new Promise(resolve => setTimeout(resolve, 3000)); + + this.percentage = 100; + clearInterval(timer); + + this.$message.success("PDF Generated Successfully!"); + + // 自动刷新左侧的下载列表 + // this.getDLFileList(); + + } catch (error) { + this.$message.error("Generation failed, please try again."); + } finally { + this.isGenerating = false; + } + }, getArticleFinal(id) { // api/Finalreview/getRecord this.$api @@ -3071,6 +3135,37 @@ export default { height: 6vh; min-height: 60px; } +.left-panel { + flex: 1; /* 左侧占据剩余空间 */ + margin-right: 40px; + border-right: 1px dashed #eee; /* 加一条虚线分隔线 */ + padding-right: 20px; +} + +.right-panel { + width: 45%; /* 右侧固定宽度 */ +} +.right-panel h5 { + font-weight: normal; +} +.console-card { + background: #f9f9f9; + border-radius: 8px; + padding: 20px; + border: 1px solid #ebeef5; +} + +.load_pdf { + display: flex; + align-items: center; + margin-bottom: 15px; + padding: 10px; + transition: background 0.3s; +} + +.load_pdf:hover { + background: #f5f7fa; +} diff --git a/src/components/page/comArtHtmlCreatNew.vue b/src/components/page/comArtHtmlCreatNew.vue index ff2b386..81857ac 100644 --- a/src/components/page/comArtHtmlCreatNew.vue +++ b/src/components/page/comArtHtmlCreatNew.vue @@ -592,7 +592,7 @@ export default { if (data && data.remark) { this.$alert( `

${data.remark}

`, - 'Annotations', + 'Comments', { confirmButtonText: 'OK', dangerouslyUseHTMLString: true, // 启用 HTML 渲染 diff --git a/src/components/page/components/table/DynamicTable.vue b/src/components/page/components/table/DynamicTable.vue new file mode 100644 index 0000000..a900d14 --- /dev/null +++ b/src/components/page/components/table/DynamicTable.vue @@ -0,0 +1,243 @@ + + + + + \ No newline at end of file diff --git a/src/components/page/components/table/LateX.vue b/src/components/page/components/table/LateX.vue index eaea12f..c555f8a 100644 --- a/src/components/page/components/table/LateX.vue +++ b/src/components/page/components/table/LateX.vue @@ -152,11 +152,11 @@ export default { this.$nextTick(() => { setTimeout(() => { const el = document.querySelector('.math-only'); - console.log('el at line 121:', el); + if (window.MathJax && el) { // MathJax.typesetClear([el]); // 清除旧渲染 window.MathJax.typesetPromise([el]).catch((err) => { - console.warn('MathJax 渲染失败:', err); + }); } }, 500); diff --git a/src/components/page/components/table/MediaLinkDialog.vue b/src/components/page/components/table/MediaLinkDialog.vue index 0c10729..a3d00ac 100644 --- a/src/components/page/components/table/MediaLinkDialog.vue +++ b/src/components/page/components/table/MediaLinkDialog.vue @@ -11,23 +11,23 @@
@@ -63,6 +63,7 @@ export default { }, show(data) { this.selectLinkData = data; + console.log('show at line 34:', data); // 1. 获取传入的 ID const inputId = data.selectedId ? Number(data.selectedId) : null; const exists = this.displayList.some((item) => item.ami_id === inputId || item.amt_id === inputId); diff --git a/src/components/page/components/table/catalogue.vue b/src/components/page/components/table/catalogue.vue new file mode 100644 index 0000000..c2e1e4d --- /dev/null +++ b/src/components/page/components/table/catalogue.vue @@ -0,0 +1,262 @@ + + + + + diff --git a/src/components/page/components/table/content.vue b/src/components/page/components/table/content.vue index 810a740..bd9782b 100644 --- a/src/components/page/components/table/content.vue +++ b/src/components/page/components/table/content.vue @@ -16,7 +16,7 @@ :value="value" :typesettingType="typesettingType" class="paste-area text-container" - :toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue| myuppercase myuppercasea Line|subscript superscript|clearButton|searchreplace']" + :toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']" style=" /* white-space: pre-line; */ line-height: 12px; diff --git a/src/components/page/components/table/table.vue b/src/components/page/components/table/table.vue index 89cceb2..1ec2b42 100644 --- a/src/components/page/components/table/table.vue +++ b/src/components/page/components/table/table.vue @@ -1,40 +1,28 @@