diff --git a/dist.zip b/dist.zip index 9de55fd..49eefa8 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/src/common/js/commonJS.js b/src/common/js/commonJS.js index e170c93..94f8ce1 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -54,6 +54,17 @@ function emuToPixels(emu) { // 四舍五入并保留两位小数 return (Math.round(emuToPixels * 100) / 100).toFixed(2); } +function findExtentElement(blipElement) { + let current = blipElement.parentElement; + while (current) { + const extents = current.getElementsByTagName('wp:extent'); + if (extents.length > 0) { + return extents[0]; // 找到包含 wp:extent 的节点 + } + current = current.parentElement; + } + return null; // 没有找到 +} export default { isImageValid(base64) { @@ -79,113 +90,118 @@ export default { handleFileUpload(event, callback) { - const file = event.target.files[0]; // 获取用户上传的文件 - if (file && file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') { - const reader = new FileReader(); - - reader.onload = (e) => { - // 将文件读取为 ArrayBuffer - const arrayBuffer = e.target.result; - - // 使用 JSZip 解析 .docx 文件内容 - const zip = new JSZip(); - zip.loadAsync(arrayBuffer).then((zip) => { - // 获取 Word 文档的 XML 内容 - const documentXml = zip.files['word/document.xml']; - const images = {}; // 用来保存图片的 src 和对应的宽高 - if (documentXml) { - documentXml.async("string").then((xmlString) => { - // 使用正则或 XML 解析器提取所有图片的宽高 - const parser = new DOMParser(); - const xmlDoc = parser.parseFromString(xmlString, "text/xml"); - - // 查找图片的宽高(通常在 标签内) - const imageElements = xmlDoc.getElementsByTagName('wp:extent'); - Array.from(imageElements).forEach((imgElement, index) => { - console.log('imgElement at line 78:', imgElement) - // 提取 width 和 height 属性 - const widthEmu = imgElement.getAttribute('cx'); // 宽度 - const heightEmu = imgElement.getAttribute('cy'); // 高度 - - if (widthEmu && heightEmu) { - // 转换为像素 - const width = emuToPixels(widthEmu); - const height = emuToPixels(heightEmu); - images[index] = { width, height }; // 保存图片的宽高 - } - // 这里你可以将宽高传递给回调函数 - }); - }); - } - - mammoth.convertToHtml({ - arrayBuffer: e.target.result - }) - .then((result) => { - - console.log('images at line 115:', images) - // 使用正则提取所有表格内容 - const tableContent = result.value.match(//g); - if (tableContent) { - console.log('tableContent at line 20:', tableContent); - // 筛选出包含 的表格 - const validTables = tableContent.filter(table => //g.test(table)); - console.log('validTables at line 71:', validTables); - - // 提取表格内的图片 - validTables.forEach((table, index) => { - console.log('table at line 75:', table) - const imgTags = table.match(/ { - console.log('imgTag at line 128:', imgTag); - - const srcMatch = imgTag.match(/src="([^"]*)"/); - if (srcMatch) { - - const imageInfo = images[imgIndex]; // 从 images 中查找对应的宽高 - - if (imageInfo) { - // 构建新的 标签,保留原来的其他属性 - const newImgTag = imgTag.replace( - / 0) { - console.log('validTables.length at line 147:', validTables) - callback(validTables); - } else { - callback([]); - } - } else { - console.log("没有找到表格内容。"); - } - }) - .catch((err) => { - console.error('Error parsing Word file:', err); - });; - }).catch((err) => { - console.error("Error loading zip file:", err); - }); - }; - - reader.readAsArrayBuffer(file); // 将文件读取为 ArrayBuffer - } else { + const file = event.target.files[0]; + if (!file || file.type !== 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') { alert('请上传一个有效的 Word 文件'); + return; } + + const reader = new FileReader(); + + reader.onload = (e) => { + const arrayBuffer = e.target.result; + const zip = new JSZip(); + + zip.loadAsync(arrayBuffer).then(async (zip) => { + const relsXml = await zip.files['word/_rels/document.xml.rels'].async('string'); + const docXml = await zip.files['word/document.xml'].async('string'); + + const parser = new DOMParser(); + const relDoc = parser.parseFromString(relsXml, "text/xml"); + const docDom = parser.parseFromString(docXml, "text/xml"); + + const rels = {}; + Array.from(relDoc.getElementsByTagName('Relationship')).forEach((rel) => { + const id = rel.getAttribute('Id'); + const target = rel.getAttribute('Target'); // e.g., 'media/image1.jpeg' + 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); + if (embedId && extent) { + const cx = extent.getAttribute('cx'); + const cy = extent.getAttribute('cy'); + if (cx && cy) { + const width = emuToPixels(cx); + const height = emuToPixels(cy); + const mediaFile = rels[embedId]; + if (mediaFile) { + imageInfoMap[mediaFile] = { width, height }; + } + } + } + }); + + mammoth.convertToHtml({ arrayBuffer }, + { + convertImage: mammoth.images.inline(async function (image) { + const contentType = image.contentType.toLowerCase(); + + // 只允许这三种格式 + const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png']; + if (!allowedTypes.includes(contentType)) { + // 跳过不支持的格式(如 image/tiff、image/x-emf 等) + return { src: '' }; // 会从 HTML 中删除这张图片 + } + + // 读取为 base64 并构造 src + const imageBuffer = await image.read("base64"); + const base64Src = `data:${contentType};base64,${imageBuffer}`; + + return { + src: base64Src + }; + }) + }) + .then((result) => { + let html = result.value; + // html = html.replace(/]+src="data:image\/x-emf[^"]*"[^>]*>/gi, ''); + + // 替换图片标签中的宽高 + const imgTags = html.match(/]*src="data:image\/[^"]+image(\d+)\.(png|jpg|jpeg)[^"]*"[^>]*>/gi); + if (imgTags) { + imgTags.forEach((imgTag) => { + const match = imgTag.match(/image(\d+)\.(png|jpg|jpeg)/); + if (match) { + const filename = `media/image${match[1]}.${match[2]}`; + const info = imageInfoMap[filename]; + if (info) { + const newImgTag = imgTag.replace( + //g); + const validTables = tableContent + ? tableContent.filter(table => //.test(table)) + : []; + + callback(validTables); + }) + .catch(err => { + console.error('mammoth 转换失败:', err); + }); + + }).catch(err => { + console.error("Zip 读取失败:", err); + }); + }; + + reader.readAsArrayBuffer(file); }, + extractLatexFromMathJax() { // 获取所有 MathJax 渲染的公式容器 const mathContainers = document.querySelectorAll('mjx-container'); @@ -193,17 +209,15 @@ export default { mathContainers.forEach(container => { // 查找每个渲染公式对应的 MathML 部分 const mathElement = container.querySelector('mjx-math'); - console.log('mathElement at line 28:', mathElement) + if (mathElement) { // 获取 MathJax 渲染的公式对象 const jax = window.MathJax.getJaxFor(mathElement); - console.log('jax at line 32:', jax) if (jax) { // 使用 MathJax API 获取公式的 LaTeX 代码 const latex = jax.getLiteral(); // 获取 LaTeX 表达式 - console.log('提取到的 LaTeX 公式:', latex); // 输出 LaTeX 代码 } else { console.warn('MathJax 对象未找到'); } @@ -232,28 +246,23 @@ export default { , // **解析 MathJax 公式,获取 LaTeX** async extractMathJaxLatex(cell, callback) { - console.log('cell at line 67:', cell) return new Promise((resolve, reject) => { // Step 1: First, process the math content and extract LaTeX from tags let updatedContent = cell.innerHTML; // Start with the cell's inner HTML - console.log('cell content at the start:', updatedContent); // Find all elements const wmathElements = cell.querySelectorAll('wmath'); wmathElements.forEach((element) => { // Get the LaTeX content from the data-latex attribute const latexContent = element.getAttribute('data-latex'); - console.log('LaTeX content from data-latex:', latexContent); // Replace the tag with its LaTeX content wrapped in $$...$$ updatedContent = updatedContent.replace(element.outerHTML, `${latexContent}`); }); - console.log('updatedContent after processing wmath tags:', updatedContent); // Step 2: Now extract content without the outer tags updatedContent = this.extractContentWithoutOuterSpan(updatedContent); - console.log('updatedContent after extractContentWithoutOuterSpan:', updatedContent); // Step 3: Call the callback function with the final updated content // callback(updatedContent); @@ -277,7 +286,7 @@ export default { }, //去掉最外层自定义的span标签 extractContentWithoutOuterSpan(cell) { - console.log('cell at line 90:', cell) + var str = '' if (!cell) { return '' @@ -285,7 +294,6 @@ export default { // 获取单元格的 HTML 内容 let htmlContent = cell.trim(); - console.log('htmlContent at line 94:', htmlContent) str = this.transformHtmlString(htmlContent, 'table') @@ -326,8 +334,7 @@ export default { - console.log('str at line 141:', str) - // 如果没有 标签,直接返回原始 HTML 内容 + return str; }, @@ -413,7 +420,7 @@ export default { allTables.push(tableArray); // 添加当前表格到所有表格数组 } - console.log("解析后的表格数组:", allTables); + callback(allTables); // 返回处理后的数组 } catch (error) { console.error("解析粘贴内容失败:", error); @@ -426,7 +433,6 @@ export default { const Zip = new JSZip(); const zip = await Zip.loadAsync(file); - console.log("解压后的文件:", Object.keys(zip.files)); const documentFile = zip.file("word/document.xml"); if (!documentFile) { @@ -438,8 +444,6 @@ export default { const parser = new DOMParser(); const documentDoc = parser.parseFromString(documentXml, "application/xml"); - console.log("解析的 XML 结构:", new XMLSerializer().serializeToString(documentDoc)); - const numberingFile = zip.file("word/numbering.xml"); let numberingMap = {}; if (numberingFile) { @@ -546,7 +550,7 @@ export default { } } - console.log('rowspan at line 265:', rowspan) + const currentLevelNumbers = {}; for (const paragraph of paragraphs) { let listPrefix = ""; @@ -577,7 +581,7 @@ export default { const embedId = blip.getAttribute("r:embed"); if (embedId) { textContent += ``; - console.log("✅ 图片 embedId:", embedId); + } } } @@ -585,7 +589,7 @@ export default { - + const texts = run.getElementsByTagName("w:t"); for (const text of texts) { textContent += text.textContent; @@ -632,7 +636,6 @@ export default { }); } - console.log("After replacement:", formattedText); paragraphText += formattedText; } @@ -643,7 +646,6 @@ export default { } cellText += paragraphText; - console.log('cellText at line 366:', cellText) } rowArray.push({ @@ -671,7 +673,6 @@ export default { allTables.push(tableArray); } - console.log("解析后的二维数组:", allTables); callback(allTables); } catch (error) { @@ -951,7 +952,7 @@ export default { let parsedData = Array.from(paragraphs).map(p => { let text = p.innerHTML.trim(); // 获取内容,去除两端空格 text = replaceNegativeSign(text); - console.log('text at line 756:', text) + text = this.transformHtmlString(text) // 3️⃣ **正确移除 (Word 复制的无效标签)** text = text.replace(/<\/?o:p[^>]*>/g, ""); @@ -977,7 +978,7 @@ export default { return text.trim() === "" ? "" : text; }); - console.log(parsedData); // 输出数组,方便调试 + return parsedData; } @@ -987,7 +988,6 @@ export default { async parseTableToArray(tableString, callback) { - console.log('tableString at line 845:', tableString) const parser = new DOMParser(); const doc = parser.parseFromString(tableString, 'text/html'); const rows = doc.querySelectorAll('table tr'); // 获取所有的行() @@ -1008,7 +1008,7 @@ export default { ); }) ); - console.log('result at line 78611:', result) + callback(result) // 返回处理后的数组 @@ -1095,7 +1095,6 @@ export default { // 获取编号定义 const numberingMap = this.parseNumbering(numberingDoc); - console.log('numberingMap at line 232:', numberingMap) // 提取表格 // 获取所有的段落 const paragraphs = xmlDoc.getElementsByTagName("w:p"); @@ -1115,9 +1114,7 @@ export default { } // 将前一段的内容转化为 HTML 或文本 const previousHtml = this.convertParagraphsToHtml(previousParagraphs); - console.log('tables at line 17:', previousHtml) const tableHtml = this.convertTablesToHtml(tables, numberingMap); - console.log('tableHtml at line 18:', tableHtml) // 更新 HTML 内容 this.htmlContent = tableHtml || "

未检测到表格内容。

"; @@ -1472,8 +1469,6 @@ export default { // 保持原比例 this.renderTiffImage(mediaUrl + img.image, `tiff-canvas-modal-${index}`, index, true); - console.log('at line 827:', document.getElementsByClassName('thumbnailBox')) - // 不保持原比例,强制缩放到指定大小 const targetWidth = imgWidth || document.getElementsByClassName('thumbnailBox')[0].offsetWidth; // 使用外层容器宽度 const targetHeight = imgHeight || document.getElementsByClassName('thumbnailBox')[0].offsetHeight; // 使用外层容器高度 this.renderTiffImage(mediaUrl + img.image, `tiff-canvas-${index}`, index, false, targetWidth, targetHeight); @@ -1866,7 +1861,6 @@ export default { // 如果找到的 div 节点存在 if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); - console.log('dataId at line 1258:', dataId) vueInstance.$emit('onAddRow', dataId); } @@ -1889,7 +1883,6 @@ export default { if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); var content; - console.log('outerDiv at line 663:', outerDiv.innerHTML); content = outerDiv.innerHTML.replace(/<(?!\/?(img|b|i|sub|sup|span|strong|em |blue)\b)[^>]+>/g, ''); content = content.replace(/<([a-zA-Z]+)>\s*<\/\1>/g, ''); content = content.replace(/ /g, ' '); @@ -1932,7 +1925,6 @@ export default { // 如果找到的 div 节点存在 if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); - console.log('dataId at line 1258:', dataId) vueInstance.$emit('onEditTitle', { mainId: dataId, value: 1 @@ -1954,7 +1946,6 @@ export default { // 如果找到的 div 节点存在 if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); - console.log('dataId at line 1258:', dataId) vueInstance.$emit('onEditTitle', { mainId: dataId, value: 2 @@ -1976,7 +1967,6 @@ export default { // 如果找到的 div 节点存在 if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); - console.log('dataId at line 1258:', dataId) vueInstance.$emit('onEditTitle', { mainId: dataId, value: 3 @@ -1998,7 +1988,6 @@ export default { // 如果找到的 div 节点存在 if (outerDiv) { const dataId = outerDiv.getAttribute('main-id'); - console.log('dataId at line 1258:', dataId) vueInstance.$emit('onEdit', dataId); } @@ -2023,7 +2012,6 @@ export default { const dataId = outerDiv.getAttribute('main-id'); const type = outerDiv.getAttribute('type'); - console.log('type:', type); // 获取选中的内容(HTML格式) let selectedContent = edSelection.getContent({ format: 'html' }); @@ -2142,7 +2130,6 @@ export default { onAction: function () { // 在选中的文本周围包裹 标签 var selectedText = ed.selection.getContent(); - console.log('selectedText at line 529:', selectedText); if (selectedText) { var wrappedText = `${selectedText}`; ed.selection.setContent(wrappedText); @@ -2161,7 +2148,6 @@ export default { // 1. 获取当前光标位置 const latexEditorBookmark = ed.selection.getBookmark(2); // 获取光标位置 const editorId = ed.id; // 保存当前编辑器 ID - console.log('activeEditorId:', editorId); // 2. 生成一个随机的 ID,用于 wmath 标签 const uid = 'wmath-' + Math.random().toString(36).substr(2, 9); diff --git a/src/components/common/langs/en.js b/src/components/common/langs/en.js index 52a514c..28d9ac3 100644 --- a/src/components/common/langs/en.js +++ b/src/components/common/langs/en.js @@ -382,7 +382,9 @@ const en = { uploadImageInfo: 'Figures can only upload files in JPG, JPEG, and PNG formats!', selectComment: 'Please select the text to add annotations to!', selectWord: 'Please select only a single word!', - alreadyCommented: 'There are already annotations in the text, please select again!' + alreadyCommented: 'There are already annotations in the text, please select again!', + Multicolumn:'Multicolumn', + singleRow:"single-row", }, pendingPayment: { title: 'Title', @@ -430,7 +432,10 @@ const en = { "covered": "Research Fields", "digest": "Summary", "research_background": "Research Background", - "research_result": "Research Results", + "research_methods": "Research Method", + "research_result": "Results", + "summarize": "Summarize", + "overview": "Overview", "highlights": "Highlights", "discussion": "Discussion", "prospect": "Future Prospects", @@ -453,13 +458,13 @@ const en = { "add_author": "Add Author" }, - AIArticleStatusEn: { + AIArticleStatus: { 1: 'WeChat AI content generated', 2: 'WeChat AI content not generated', - 3: 'Draft not created', + 3: 'The article has been generated, but the draft box has not been pushed yet', 4: 'Draft created but not published', 10: 'WeChat article published successfully', - 11: 'WeChat article publishing in progress', + 11: 'WeChat article publishing in progress...', fail: 'WeChat article publishing failed', unknown: 'Unknown status' } diff --git a/src/components/common/langs/zh.js b/src/components/common/langs/zh.js index 0a1b91f..0687aa6 100644 --- a/src/components/common/langs/zh.js +++ b/src/components/common/langs/zh.js @@ -376,6 +376,8 @@ const zh = { selectComment: '请选择要添加批注的文本', selectWord:'请只选中单个单词!', alreadyCommented:'文本中已有批注内容请重新选择', + Multicolumn:'多列', + singleRow:"单列", }, pendingPayment: { title: 'Title', @@ -423,7 +425,10 @@ const zh = { "covered": "研究学科", "digest": "摘要", "research_background": "研究背景", - "research_result": "研究结果", + "research_methods": "研究方法", + "research_result": "结果", + "summarize": "总结", + "overview": "概述", "highlights": "研究亮点", "discussion": "讨论", "prospect": "前景展望", @@ -448,13 +453,13 @@ const zh = { AIArticleStatus: { 1: '公微 AI 内容已生成', 2: '公微 AI 内容未生成', - 3: '尚未生成草稿', + 3: '文章已生成,尚未推送草稿箱', 4: '草稿已生成,尚未发布', 10: '公微文章已成功发布', - 11: '公微文章正在发布中', + 11: '公微文章正在发布中...', fail: '公微文章发布失败', unknown: '状态未知' - } + }, } diff --git a/src/components/page/GenerateCharts copy.vue b/src/components/page/GenerateCharts copy.vue deleted file mode 100644 index f9d2fdc..0000000 --- a/src/components/page/GenerateCharts copy.vue +++ /dev/null @@ -1,2149 +0,0 @@ - - - - - diff --git a/src/components/page/GenerateCharts.vue b/src/components/page/GenerateCharts.vue index ce9cdc9..3f3ca5e 100644 --- a/src/components/page/GenerateCharts.vue +++ b/src/components/page/GenerateCharts.vue @@ -196,14 +196,14 @@ :wrapperClosable="false" :close-on-click-modal="false" direction="rtl" - size="70%" + size="80vw" > -
- 插入Table{{ i + 1 }} -
- - - - - - - - -
- -
- - - +
+
+ 插入 +
+

Table {{ i + 1 }}

+ + + + +
+ +
+
-
@@ -1137,42 +1131,15 @@ export default { // 处理文件上传并传递回调函数 this.$commonJS.handleFileUpload(event, function (tables) { - console.log('tables at line 786:', tables); - + // 使用 Promise.all 等待所有表格解析完成 Promise.all( tables.map((table) => { return new Promise((resolve, reject) => { // 解析每个表格 that.$commonJS.parseTableToArray(table, (tableList) => { - console.log('res at line 104:', tableList); + - // 生成 HTML 内容 - // var contentHtml = ` - //
- // - // ${tableList - // .map((row) => { - // return ` - // - // ${row - // .map((cell) => { - // return ` - // - // `; - // }) - // .join('')} - // - // `; - // }) - // .join('')} - //
- // ${cell.text || ''} - //
- //
- // `; - - // 将解析后的数据和生成的 HTML 返回 resolve({ table_data: tableList, html_data: '' }); }); }); @@ -1182,8 +1149,7 @@ export default { // 所有表格的解析完成后,处理结果 that.uploadWordTables = result; that.tablesHtmlVisible = true; - console.log('Processed tables:', that.uploadWordTables); - }) + }) .catch((error) => { console.error('Error processing tables:', error); }); @@ -1191,16 +1157,14 @@ export default { const file = event.target.files[0]; if (file) { // 处理文件逻辑 - console.log('处理文件:', file.name); - } + } // 关键:重置 input 的值 event.target.value = ''; }, async onAddRow(mainId) { - console.log('data at line 886:', mainId); - + await this.$api .post(this.urlList.addRow, { am_id: mainId, @@ -1267,11 +1231,10 @@ export default { addUploadWordTable(data) { this.lineStyle = { note: '', table: data.table_data, html_data: data.html_data }; - this.lineStyle.visiTitle = 'Insert Table'; + this.lineStyle.visiTitle = 'Add Table'; this.threeVisible = true; }, handleImageEdit(data, type) { - console.log('data at line 600:', data); if (type == 'img') { var extension = data.url.split('.').pop().toLowerCase(); this.picStyle = {}; @@ -1301,10 +1264,7 @@ export default { this.picStyle1.title = str; } else { this.lineStyle1[type] = str; - } - - }, onEdit(dataId) { this.currentContent = {}; @@ -1761,12 +1721,11 @@ export default { } }; var cleanedTableList = content.table ? content.table : []; - console.log('content at line 998:', this.lineStyle); - + cleanedTableList = cleanTableData(content.table); - var strTitle = this.lineStyle1.title? this.lineStyle1.title : ''; + var strTitle = this.lineStyle1.title ? this.lineStyle1.title : ''; - var strNote = this.lineStyle1.note? this.lineStyle1.note : ''; + var strNote = this.lineStyle1.note ? this.lineStyle1.note : ''; if (strNote != '') { strNote = await this.$commonJS.decodeHtml(strNote); } @@ -2229,6 +2188,12 @@ export default { ::v-deep .wordTableHtml table span blue { color: rgb(0, 130, 170) !important; } +::v-deep .wordTableHtml table span blue sup{ + color: rgb(0, 130, 170) !important; +} +::v-deep .wordTableHtml table span blue sub{ + color: rgb(0, 130, 170) !important; +} .toolbar { display: flex; align-items: center; @@ -2310,4 +2275,26 @@ export default { ::-webkit-scrollbar-thumb:hover { background: #555; /* 滑块悬停时的颜色 */ } +.uploadWordTableBox { + width: 38vw; + position: relative; + height: auto; +overflow: hidden; + padding: 10px; + box-sizing: border-box; + box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px 0px; +} +::v-deep .el-drawer__header { + margin-bottom: 0; + padding: 15px; +} +.uploadWordTableBox .insertTable{ + /* display: none; */ + position: absolute; + right: 10px; +} +.uploadWordTableBox:hover { + background-color: #0066990d; + /* display: block !important; */ +} diff --git a/src/components/page/articleListEditor_C.vue b/src/components/page/articleListEditor_C.vue index 3e61a1c..9acfe71 100644 --- a/src/components/page/articleListEditor_C.vue +++ b/src/components/page/articleListEditor_C.vue @@ -56,9 +56,9 @@ {{ item.npp }}. {{ item.title }} - - Html - + + Html + - + {{ getStatusText(item.ai_wechat_status) }} + + - +
@@ -299,6 +359,7 @@ import { watch } from 'vue'; export default { data() { return { + articleBaseInfo: {}, publish_status: null, draft_status: null, stepValue: null, @@ -625,7 +686,9 @@ export default { this.ArticleForm.authors.splice(index, 1); }, async init(data) { + console.log('data at line 641:', data); this.articleId = data.article_id; + this.articleBaseInfo = { ...data }; // this.articleId = 2673; // this.stepList = this.stepList.map((e) => (e.status = '')); await this.getStatus(); @@ -1121,6 +1184,7 @@ export default { this.createType = '1'; // html生成方式 this.collapseActiveNames = ['html']; this.stopInterval(); + this.$emit('fresh'); }, beforeupload_manuscirpt(file) { diff --git a/src/components/page/components/pendingPayment/OrderConfirmation.vue b/src/components/page/components/pendingPayment/OrderConfirmation.vue index e7f5a90..2db9a5d 100644 --- a/src/components/page/components/pendingPayment/OrderConfirmation.vue +++ b/src/components/page/components/pendingPayment/OrderConfirmation.vue @@ -247,6 +247,9 @@ export default { this.$message.error(res.data.msg); loading.close() } + }).catch((error) => { + console.error('Error:', error); + loading.close() }); }, getPayPal(id) { diff --git a/src/components/page/components/reviewerList/add.vue b/src/components/page/components/reviewerList/add.vue index ff85921..e3566a8 100644 --- a/src/components/page/components/reviewerList/add.vue +++ b/src/components/page/components/reviewerList/add.vue @@ -151,7 +151,7 @@
{{ addForm.company }}
- + + + + @@ -337,6 +341,7 @@ export default { data() { return { + majorValueList: [], tableData: [], reviewerForm: {}, //审稿人信息 checkForm: { @@ -497,13 +502,29 @@ export default { trigger: 'blur' } ], - major_a: [ + major: [ { required: true, - message: 'Please select major', - trigger: 'blur' + validator: (rule, value, callback) => { + console.log('value at line 1202:', this.form); + var major = this.majorValueList.map((item) => item.selectedValue[item.selectedValue.length - 1]).toString(','); + if (major == '') { + callback(new Error('Please select the Research areas')); + } else { + callback(); + } + // 如果你需要在此处使用 this 访问 Vue 实例的数据,使用箭头函数保持上下文 + // 其他逻辑 + } } ] + // major_a: [ + // { + // required: true, + // message: 'Please select major', + // trigger: 'blur' + // } + // ] }, urlList: { userList: 'api/Reviewer/researchUser', @@ -525,6 +546,7 @@ export default { this.init(); }, init() { + this.majorValueList = []; this.initMajor(); this.getCountry(); this.addVisible = true; @@ -685,39 +707,46 @@ export default { this.fileL_pdf2[0].url = this.mediaUrl + 'reviewer/' + this.reviewerForm.cvs[this.reviewerForm.cvs.length - 1].cv; } - this.addForm.major = 1; - this.addForm.major_a = ''; - this.addForm.major_b = ''; - this.addForm.major_c = ''; - this.addForm.majorList = []; + // this.addForm.major = 1; + // this.addForm.major_a = ''; + // this.addForm.major_b = ''; + // this.addForm.major_c = ''; + // this.addForm.majorList = []; - this.reviewerForm.major = res.data.result.major; - this.reviewerForm.major_a = ''; - this.reviewerForm.major_b = ''; - this.reviewerForm.major_c = ''; - this.reviewerForm.majorList = []; + // this.reviewerForm.major = res.data.result.major; + // this.reviewerForm.major_a = ''; + // this.reviewerForm.major_b = ''; + // this.reviewerForm.major_c = ''; + // this.reviewerForm.majorList = []; - if (res.data.result.majorshu != 0 && res.data.result.majorshu != null) { - if (typeof res.data.result.majorshu == 'number') { - this.addForm.majorList.push(res.data.result.majorshu); - this.reviewerForm.majorList.push(res.data.result.majorshu); - } else { - this.addForm.majorList = res.data.result.majorshu.split(','); - this.reviewerForm.majorList = res.data.result.majorshu.split(','); - } - } - - if (this.reviewerForm.majorList) { - if (this.reviewerForm.majorList.length >= 1) { - this.reviewerForm.major_a = this.reviewerForm.majorList[0]; - } - if (this.reviewerForm.majorList.length >= 2) { - this.reviewerForm.major_b = this.reviewerForm.majorList[1]; - } - if (this.reviewerForm.majorList.length == 3) { - this.reviewerForm.major_c = this.reviewerForm.majorList[2]; - } - } + // if (res.data.result.majorshu != 0 && res.data.result.majorshu != null) { + // if (typeof res.data.result.majorshu == 'number') { + // this.addForm.majorList.push(res.data.result.majorshu); + // this.reviewerForm.majorList.push(res.data.result.majorshu); + // } else { + // this.addForm.majorList = res.data.result.majorshu.split(','); + // this.reviewerForm.majorList = res.data.result.majorshu.split(','); + // } + // } + this.majorValueList = this.reviewerForm.major_data.map((item) => ({ + selectedValue: Array.isArray(item.shu) + ? item.shu + : typeof item.shu === 'string' + ? item.shu.split(',').map(Number) + : [item.shu] + })); + console.log('this.majorValueList at line 903:', this.majorValueList); + // if (this.reviewerForm.majorList) { + // if (this.reviewerForm.majorList.length >= 1) { + // this.reviewerForm.major_a = this.reviewerForm.majorList[0]; + // } + // if (this.reviewerForm.majorList.length >= 2) { + // this.reviewerForm.major_b = this.reviewerForm.majorList[1]; + // } + // if (this.reviewerForm.majorList.length == 3) { + // this.reviewerForm.major_c = this.reviewerForm.majorList[2]; + // } + // } // if (this.reviewerForm.major_c != '' || this.reviewerForm.major_c != 0) { // this.reviewerForm.major = this.reviewerForm.major_c; // } else if (this.addForm.major_b != '' || this.addForm.major_b != 0) { @@ -728,7 +757,7 @@ export default { this.$forceUpdate(); console.log('this.addForm.majorList at line 674:', this.reviewerForm); this.$nextTick(async () => { - await this.jiLInaoan(); + // await this.jiLInaoan(); await this.getJournalsForReviewerInEditor(); }); @@ -865,19 +894,19 @@ export default { } // this.addForm.maj_cn = [this.addForm.major, this.addForm.cmajor]; - this.addForm.major = 1; - this.addForm.major_a = ''; - this.addForm.major_b = ''; - this.addForm.major_c = ''; - this.addForm.majorList = []; + // this.addForm.major = 1; + // this.addForm.major_a = ''; + // this.addForm.major_b = ''; + // this.addForm.major_c = ''; + // this.addForm.majorList = []; - if (this.addForm.majorshu != 0 && this.addForm.majorshu != null) { - if (typeof this.addForm.majorshu == 'number') { - this.addForm.majorList.push(this.addForm.majorshu); - } else { - this.addForm.majorList = this.addForm.majorshu.split(','); - } - } + // if (this.addForm.majorshu != 0 && this.addForm.majorshu != null) { + // if (typeof this.addForm.majorshu == 'number') { + // this.addForm.majorList.push(this.addForm.majorshu); + // } else { + // this.addForm.majorList = this.addForm.majorshu.split(','); + // } + // } this.$nextTick(() => { this.jiLInaoan(); @@ -937,7 +966,7 @@ export default { reviewer_id: this.addForm.reviewer_id, title: this.addForm.title, country: this.addForm.country, - major: this.addForm.major, + // major: this.addForm.major, // majorshu: this.addForm.majorshu, cmajor: this.addForm.cmajor, field: this.addForm.field, @@ -949,10 +978,10 @@ export default { cv: this.addForm.cv, journal_id: this.addForm.journal_id }; - + data.major = this.majorValueList.map((item) => item.selectedValue[item.selectedValue.length - 1]).toString(','); console.log(data, this.addForm, 111111111111111111111); - + if (this.email_num == 2) { // 新的 path_add = this.urlList.addReviewer; @@ -979,9 +1008,6 @@ export default { } } - - - this.$api .post(path_add, data) .then((res) => { diff --git a/src/components/page/components/table/table.vue b/src/components/page/components/table/table.vue index 5df876b..f83eb57 100644 --- a/src/components/page/components/table/table.vue +++ b/src/components/page/components/table/table.vue @@ -128,8 +128,7 @@ export default { const container = document.createElement('div'); container.innerHTML = content; this.$commonJS.parseTableToArray(content, (table) => { - console.log('res at line 104:', table); -// return false + this.$emit('getContent', type, { html_data: content, table: table }); }); } else { diff --git a/src/components/page/components/table/word.vue b/src/components/page/components/table/word.vue index 4369340..7835093 100644 --- a/src/components/page/components/table/word.vue +++ b/src/components/page/components/table/word.vue @@ -23,11 +23,11 @@ left: 285px; z-index: 10; right: 330px; - height: 60px; + height: 46px; display: flex; align-items: center; justify-content: space-between; - padding: 10px; + padding:0 10px; box-sizing: border-box; overflow: hidden; width: calc(100% - 285px - 330px); @@ -70,20 +70,20 @@
-
+
  • - + Comment
  • @@ -91,13 +91,13 @@ Row
  • -
  • +
  • Edit
  • -
  • +
  • Delete @@ -117,6 +117,10 @@ position: relative; " > + {{ selectedIds }} +
    + Selected to here: {{ selectedIds[selectedIds.length - 1] }} +