This commit is contained in:
2025-02-21 10:33:37 +08:00
48 changed files with 18492 additions and 4960 deletions

View File

@@ -512,7 +512,7 @@ a {
} }
.kuang_communtion .kuang_communtion_conmt { .kuang_communtion .kuang_communtion_conmt {
/* max-height: 350px; /* max-height: 350px;
overflow-y: auto; */ overflow-y: auto; */
word-break: normal; word-break: normal;
} }
@@ -1072,115 +1072,365 @@ a {
line-height: 24px; line-height: 24px;
} */ } */
.wordTableHtml b span { .wordTableHtml b span {
font-weight: bold !important; font-weight: bold !important;
} }
.wordTableHtml i span {
font-style: italic !important; .wordTableHtml i span {
font-style: italic !important;
} }
.wordTableHtml sub span {
vertical-align: sub; .wordTableHtml sub span {
vertical-align: sub;
} }
.wordTableHtml sup span { .wordTableHtml sup span {
vertical-align: super; vertical-align: super;
} }
.wordTableHtml sub {
vertical-align: sub !important; .wordTableHtml sub {
vertical-align: sub !important;
} }
.wordTableHtml sup {
vertical-align: super !important; .wordTableHtml sup {
vertical-align: super !important;
} }
.wordTableHtml span[style*='vertical-align: super'] {
vertical-align: super !important; .wordTableHtml span[style*='vertical-align: super'] {
vertical-align: super !important;
} }
.wordTableHtml span[style*='vertical-align: sub'] {
vertical-align: sub !important; .wordTableHtml span[style*='vertical-align: sub'] {
vertical-align: sub !important;
} }
.wordTableHtml table { .wordTableHtml table {
border: 0px !important; border: 0px !important;
border-collapse: collapse; /* 去除单元格间隙 */ border-bottom: 1px solid #000 !important;
width: auto; border-collapse: collapse;
margin: 0 auto !important; /* 去除单元格间隙 */
table-layout: auto; /* 自动调整列宽 */ width: auto;
text-align: left; margin: 0 auto !important;
font-family: 'Charis SIL' !important; table-layout: auto;
font-size: 7.5pt !important; /* 自动调整列宽 */
mso-font-kerning: 1pt !important; text-align: left;
line-height: 10pt !important; font-family: 'Charis SIL' !important;
mos-line-height: 10pt !important; font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
} }
.wordTableHtml table td, .wordTableHtml table td,
.wordTableHtml table th{ .wordTableHtml table th {
padding: 5px; padding: 5px;
text-align: left !important; text-align: left !important;
word-wrap: break-word; /* 长单词自动换行 */ word-wrap: normal;
word-break: break-word; /* 长单词自动换行 */
font-family: 'Charis SIL' !important; word-break: normal;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important; font-family: 'Charis SIL' !important;
line-height: 10pt !important; font-size: 7.5pt !important;
mos-line-height: 10pt !important; mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
} }
.wordTableHtml table tbody tr td { .wordTableHtml table tbody tr td {
text-align: left !important; text-align: left !important;
border-left: none !important; border-left: none !important;
mso-border-left-alt: none !important; mso-border-left-alt: none !important;
border-right: none !important; border-right: none !important;
mso-border-right-alt: none !important; mso-border-right-alt: none !important;
border-top: none; border-top: none;
mso-border-top-alt: none !important; mso-border-top-alt: none !important;
border-bottom: none !important; border-bottom: none !important;
mso-border-bottom-alt: none !important; mso-border-bottom-alt: none !important;
border: 1px dashed #dcdfe6 !important; border: 1px dashed #dcdfe6 !important;
border-left: 1px dashed #dcdfe6 !important; border-left: 1px dashed #dcdfe6 !important;
border-right: 1px dashed #dcdfe6 !important; border-right: 1px dashed #dcdfe6 !important;
word-break: keep-all !important; word-break: keep-all !important;
/* text-align: justify !important; */ /* text-align: justify !important; */
} }
.wordTableHtml table tr td p { .wordTableHtml table tr td p {
display: flex; display: flex;
text-align: left !important; text-align: left !important;
align-items: center; align-items: center;
margin: 0; margin: 0;
font-family: 'Charis SIL' !important; font-family: 'Charis SIL' !important;
font-size: 7.5pt !important; font-size: 7.5pt !important;
mso-font-kerning: 1pt !important; mso-font-kerning: 1pt !important;
line-height: 10pt !important; line-height: 10pt !important;
mos-line-height: 10pt !important; mos-line-height: 10pt !important;
} }
.wordTableHtml table span { .wordTableHtml table span {
color: #000000; color: #000000;
text-align: left !important; text-align: left !important;
font-family: 'Charis SIL' !important; font-family: 'Charis SIL' !important;
font-size: 7.5pt !important; font-size: 7.5pt !important;
mso-font-kerning: 1pt !important; mso-font-kerning: 1pt !important;
line-height: 10pt !important; line-height: 10pt !important;
mos-line-height: 10pt !important; mos-line-height: 10pt !important;
} }
.wordTableHtml table .color-highlight { .wordTableHtml table .color-highlight {
color: rgb(0, 130, 170) !important; color: rgb(0, 130, 170) !important;
font-family: 'Charis SIL' !important; font-family: 'Charis SIL' !important;
font-size: 7.5pt !important; font-size: 7.5pt !important;
mso-font-kerning: 1pt !important; mso-font-kerning: 1pt !important;
line-height: 10pt !important; line-height: 10pt !important;
mos-line-height: 10pt !important; mos-line-height: 10pt !important;
} }
.wordTableHtml table blue { .wordTableHtml table blue {
color: rgb(0, 130, 170) !important; color: rgb(0, 130, 170) !important;
font-family: 'Charis SIL' !important; font-family: 'Charis SIL' !important;
font-size: 7.5pt !important; font-size: 7.5pt !important;
mso-font-kerning: 1pt !important; mso-font-kerning: 1pt !important;
line-height: 10pt !important; line-height: 10pt !important;
mos-line-height: 10pt !important; mos-line-height: 10pt !important;
} }
.wordTableHtml table tr:first-child td {
border-top: 1px solid #000 !important; .wordTableHtml table tr:first-child td {
border-top: 1px solid #000 !important;
border-bottom: 1px solid #000 !important;
border-bottom: 1px solid #000 !important;
} }
.wordTableHtml table tr:last-of-type td {
/* 给表格中最后一行表头添加红色下边框 */
/* 给最后一个 table-header-row 添加红色下边框 */
.wordTableHtml table tr:last-of-type td {
border-bottom: 1px solid #000 !important;
}
/* 给最后一个 table-header-row第二行加样式 */
.wordTableHtml table tr.table-header-row:nth-of-type(2) td {
border-bottom: 1px solid #000 !important; border-bottom: 1px solid #000 !important;
}
.word-container b span {
font-weight: bold !important;
}
.word-container i span {
font-style: italic !important;
}
.word-container sub span {
vertical-align: sub;
}
.word-container sup span {
vertical-align: sup;
}
.word-container sub {
vertical-align: sub !important;
}
.word-container sup {
vertical-align: sup !important;
}
.word-container span[style*='vertical-align: super'] {
vertical-align: super !important;
}
.word-container span[style*='vertical-align: sub'] {
vertical-align: sub !important;
}
.word-container table {
border: 0px !important;
border-collapse: collapse;
/* 去除单元格间隙 */
width: auto;
margin: 0 auto !important;
table-layout: auto;
/* 自动调整列宽 */
text-align: left;
font-family: 'Charis SIL' !important;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
}
.word-container table td,
.word-container table th {
padding: 5px;
text-align: left !important;
white-space: pre-wrap;
/* 保留换行符并换行 */
word-wrap: normal;
/* 长单词自动换行 */
word-break: normal;
font-family: 'Charis SIL' !important;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
}
.word-container table tbody tr td {
text-align: left !important;
border-left: none !important;
mso-border-left-alt: none !important;
border-right: none !important;
mso-border-right-alt: none !important;
border-top: none;
mso-border-top-alt: none !important;
border-bottom: none !important;
mso-border-bottom-alt: none !important;
border: 1px dashed #dcdfe6 !important;
border-left: 1px dashed #dcdfe6 !important;
border-right: 1px dashed #dcdfe6 !important;
word-break: keep-all !important;
white-space: pre-wrap !important;
/* text-align: justify !important; */
}
.word-container table tr td p {
text-align: left !important;
margin: 0;
font-family: 'Charis SIL' !important;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
}
.word-container table span {
color: #000000;
text-align: left !important;
font-family: 'Charis SIL' !important;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
}
.word-container table .color-highlight {
color: rgb(0, 130, 170) !important;
font-family: 'Charis SIL' !important;
font-size: 7.5pt !important;
mso-font-kerning: 1pt !important;
line-height: 10pt !important;
mos-line-height: 10pt !important;
}
.word-container table tr:first-child td {
/* border-top: 1pt solid #000 !important;
mso-border-top-alt: 0.5pt solid #000 !important;
border-bottom: 1pt solid #000 !important;
mso-border-bottom-alt: 0.5pt solid #000 !important; */
}
.word-container table tr:last-of-type {
border-bottom: 1pt solid #000 !important;
mso-border-bottom-alt: 0.5pt solid #000 !important;
}
.word-container blue {
color: rgb(0, 130, 170) !important;
}
.tinymce-custom-button-blue {
font-weight: bold !important;
color: #007bff !important;
/* 设置字体颜色 */
}
.tinymce-custom-button-commentadd {
font-weight: bold !important;
background-color: #fef0f0 !important;
color: #f56c6c !important;
/* 设置字体颜色 */
fill: #f56c6c !important;
/* font-size:16px!important; */
/* 设置字体颜色 */
}
.tinymce-custom-button-commentadd svg {
fill: #f56c6c !important;
}
.tinymce-custom-button-delete {
font-weight: bold !important;
background-color: red !important;
color: #fff !important;
/* 设置字体颜色 */
fill: #fff !important;
/* font-size:16px!important; */
/* 设置字体颜色 */
}
.tinymce-custom-button-delete svg {
fill: #fff !important;
}
.tinymce-custom-button-edit {
font-weight: bold !important;
background-color: rgb(43, 129, 239) !important;
color: #fff !important;
/* 设置字体颜色 */
fill: #fff !important;
/* font-size:16px!important; */
/* 设置字体颜色 */
}
.tinymce-custom-button-edit svg {
fill: #fff !important;
}
.tinymce-custom-button-save {
font-weight: bold !important;
background-color: rgb(19, 188, 32) !important;
color: #fff !important;
/* 设置字体颜色 */
fill: #fff !important;
/* font-size:16px!important; */
/* 设置字体颜色 */
}
.tinymce-custom-button-addrow {
font-weight: bold !important;
background-color: #cbccd1 !important;
/* color: #fff !important; */
/* 设置字体颜色 */
/* fill: #fff !important; */
/* font-size:16px!important; */
/* 设置字体颜色 */
}
.tinymce-custom-button-save svg {
fill: #fff !important;
}
.tinymce-custom-button-removeblue {
font-weight: bold !important;
color: #007bff !important;
/* 设置字体颜色 */
text-decoration: line-through !important;
/* 设置字体颜色 */
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,7 +1,8 @@
import Vue from 'vue';
import JSZip from 'jszip'; import JSZip from 'jszip';
import Common from '@/components/common/common' import Common from '@/components/common/common'
import Tiff from 'tiff.js'; import Tiff from 'tiff.js';
var mediaUrl = Common.mediaUrl+'articleImage/'; var mediaUrl = Common.mediaUrl + 'articleImage/';
// var mediaUrl1 = 'https://submission.tmrjournals.com/public/articleImage/'; // var mediaUrl1 = 'https://submission.tmrjournals.com/public/articleImage/';
const fs = require('fs'); const fs = require('fs');
@@ -17,13 +18,19 @@ const capitalizeFirstLetter = function (text) {
}); });
}; };
export default { export default {
decodeHtml(html) {
var txt = document.createElement('textarea');
txt.innerHTML = html;
return txt.value;
},
//去掉最外层自定义的span标签 //去掉最外层自定义的span标签
extractContentWithoutOuterSpan(cell) { extractContentWithoutOuterSpan(cell) {
var str = '' var str = ''
// 获取单元格的 HTML 内容 // 获取单元格的 HTML 内容
let htmlContent = cell.innerHTML.trim(); let htmlContent = cell.innerHTML.trim();
str = this.transformHtmlString(htmlContent) str = this.transformHtmlString(htmlContent)
// 创建一个临时的 DOM 元素来解析 HTML // 创建一个临时的 DOM 元素来解析 HTML
const div = document.createElement('div'); const div = document.createElement('div');
div.innerHTML = htmlContent; div.innerHTML = htmlContent;
@@ -42,10 +49,26 @@ export default {
str = capitalizeFirstLetter(str); str = capitalizeFirstLetter(str);
// 添加蓝色标签 // 添加蓝色标签
const regex = /\[\d+(?:,\d+)*\]/g; const regex = /\[(\d+(?:\d+)?(?:, ?\d+(?:\d+)?)*)\]/g;
str = str.replace(/<blue>/g, '').replace(/<\/blue>/g, ''); // 先去掉所有的 <blue> 标签
if (regex.test(str)) { if (regex.test(str)) {
str = `<blue>${str}</blue>`; str = str.replace(regex, function(match) {
// 提取出方括号中的内容,并进行匹配
const content = match.slice(1, match.length - 1); // 去掉方括号
// 判断是否符合条件,纯数字、逗号后有空格、连字符
if (/^\d+$/.test(content) || /, ?/.test(content) || //.test(content)) {
return `<blue>${match}</blue>`; // 如果符合条件则加上蓝色标签
}
return match; // 如果不符合条件,则保持原样
});
} }
// 如果没有 <span> 标签,直接返回原始 HTML 内容 // 如果没有 <span> 标签,直接返回原始 HTML 内容
return str; return str;
}, },
@@ -54,7 +77,7 @@ export default {
// 创建临时 DOM 容器 // 创建临时 DOM 容器
const tempDiv = document.createElement("div"); const tempDiv = document.createElement("div");
tempDiv.innerHTML = pastedHtml; // 插入粘贴的 HTML 内容 tempDiv.innerHTML = pastedHtml; // 插入粘贴的 HTML 内容
// 获取表格 // 获取表格
const tables = tempDiv.querySelectorAll("table"); const tables = tempDiv.querySelectorAll("table");
if (tables.length === 0) { if (tables.length === 0) {
@@ -62,31 +85,31 @@ export default {
callback([]); callback([]);
return; return;
} }
const allTables = []; // 存储所有表格的二维数组 const allTables = []; // 存储所有表格的二维数组
for (const table of tables) { for (const table of tables) {
const rows = table.querySelectorAll("tr"); const rows = table.querySelectorAll("tr");
const tableArray = []; // 当前表格的二维数组 const tableArray = []; // 当前表格的二维数组
// 存储合并单元格信息 // 存储合并单元格信息
const mergeMap = {}; const mergeMap = {};
rows.forEach((row, rowIndex) => { rows.forEach((row, rowIndex) => {
const cells = row.querySelectorAll("td, th"); const cells = row.querySelectorAll("td, th");
const rowArray = []; const rowArray = [];
let colIndex = 0; let colIndex = 0;
cells.forEach((cell) => { cells.forEach((cell) => {
// 跳过被合并的单元格 // 跳过被合并的单元格
while (mergeMap[`${rowIndex},${colIndex}`]) { while (mergeMap[`${rowIndex},${colIndex}`]) {
colIndex++; colIndex++;
} }
// 获取单元格内容,如果为空则设置为默认值 // 获取单元格内容,如果为空则设置为默认值
let cellText = cell.innerText.trim() || "&nbsp;"; // 处理空值 let cellText = cell.innerText.trim() || "&nbsp;"; // 处理空值
// 处理样式 // 处理样式
if (cell.style.fontWeight === "bold") { if (cell.style.fontWeight === "bold") {
cellText = `<b>${cellText}</b>`; cellText = `<b>${cellText}</b>`;
@@ -100,18 +123,18 @@ export default {
if (cell.style.verticalAlign === "sub") { if (cell.style.verticalAlign === "sub") {
cellText = `<sub>${cellText}</sub>`; cellText = `<sub>${cellText}</sub>`;
} }
// 检查合并单元格属性 // 检查合并单元格属性
const colspan = parseInt(cell.getAttribute("colspan") || "1", 10); const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
const rowspan = parseInt(cell.getAttribute("rowspan") || "1", 10); const rowspan = parseInt(cell.getAttribute("rowspan") || "1", 10);
// 保存当前单元格信息 // 保存当前单元格信息
rowArray[colIndex] = { rowArray[colIndex] = {
text: cellText, text: cellText,
colspan: colspan, colspan: colspan,
rowspan: rowspan, rowspan: rowspan,
}; };
// 更新合并单元格信息 // 更新合并单元格信息
if (rowspan > 1 || colspan > 1) { if (rowspan > 1 || colspan > 1) {
for (let i = 0; i < rowspan; i++) { for (let i = 0; i < rowspan; i++) {
@@ -121,16 +144,16 @@ export default {
} }
} }
} }
colIndex++; // 移动到下一列 colIndex++; // 移动到下一列
}); });
tableArray.push(rowArray); // 添加当前行到表格数组 tableArray.push(rowArray); // 添加当前行到表格数组
}); });
allTables.push(tableArray); // 添加当前表格到所有表格数组 allTables.push(tableArray); // 添加当前表格到所有表格数组
} }
console.log("解析后的表格数组:", allTables); console.log("解析后的表格数组:", allTables);
callback(allTables); // 返回处理后的数组 callback(allTables); // 返回处理后的数组
} catch (error) { } catch (error) {
@@ -138,7 +161,7 @@ export default {
callback([]); callback([]);
} }
}, },
async extractWordTablesToArrays(file, callback) { async extractWordTablesToArrays(file, callback) {
const Zip = new JSZip(); const Zip = new JSZip();
try { try {
@@ -272,11 +295,30 @@ export default {
formattedText = capitalizeFirstLetter(formattedText); formattedText = capitalizeFirstLetter(formattedText);
// 添加蓝色标签 // 添加蓝色标签
const regex = /\[\d+(?:,\d+)*\]/g;
if (regex.test(formattedText)) {
formattedText = `<blue>${formattedText}</blue>`;
}
const regex = /\[(\d+(?:\d+)?(?:, ?\d+(?:\d+)?)*)\]/g;
formattedText = formattedText.replace(/<blue>/g, '').replace(/<\/blue>/g, ''); // 先去掉所有的 <blue> 标签
if (regex.test(formattedText)) {
formattedText = formattedText.replace(regex, function(match) {
// 提取出方括号中的内容,并进行匹配
const content = match.slice(1, match.length - 1); // 去掉方括号
// 判断是否符合条件,纯数字、逗号后有空格、连字符
if (/^\d+$/.test(content) || /, ?/.test(content) || //.test(content)) {
return `<blue>${match}</blue>`; // 如果符合条件则加上蓝色标签
}
return match; // 如果不符合条件,则保持原样
});
}
console.log("After replacement:", formattedText); // 调试:查看替换后的文本
paragraphText += formattedText; paragraphText += formattedText;
} }
@@ -324,11 +366,12 @@ export default {
} }
}, },
transformHtmlString(inputHtml) { transformHtmlString(inputHtml) {
inputHtml = inputHtml.replace(/(<[^>]+) style="[^"]*"/g, '$1'); // 移除style属性 inputHtml = inputHtml.replace(/(<[^>]+) style="[^"]*"/g, '$1'); // 移除style属性
inputHtml = inputHtml.replace(/(<[^>]+) class="[^"]*"/g, '$1'); // 移除class属性 inputHtml = inputHtml.replace(/(<[^>]+) class="[^"]*"/g, '$1'); // 移除class属性
// 2. 删除所有不需要的标签 (除 `strong`, `em`, `sub`, `sup`, `b`, `i` 外的所有标签) // 2. 删除所有不需要的标签 (除 `strong`, `em`, `sub`, `sup`, `b`, `i` 外的所有标签)
inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i))[^>]+>/g, ''); // 删除不需要的标签 inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue))[^>]+>/g, ''); // 删除不需要的标签
// 3. 如果有 `<strong>` 和 `<em>` 标签,去掉内部样式并保留内容 // 3. 如果有 `<strong>` 和 `<em>` 标签,去掉内部样式并保留内容
inputHtml = inputHtml.replace(/<span[^>]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签 inputHtml = inputHtml.replace(/<span[^>]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签
@@ -444,23 +487,23 @@ export default {
console.log('numberingMap at line 232:', numberingMap) console.log('numberingMap at line 232:', numberingMap)
// 提取表格 // 提取表格
// 获取所有的段落 // 获取所有的段落
const paragraphs = xmlDoc.getElementsByTagName("w:p"); const paragraphs = xmlDoc.getElementsByTagName("w:p");
// 获取所有的表格 // 获取所有的表格
const tables = xmlDoc.getElementsByTagName("w:tbl"); const tables = xmlDoc.getElementsByTagName("w:tbl");
// 找到表格前的段落 // 找到表格前的段落
let previousParagraphs = []; let previousParagraphs = [];
let tableIndex = 0; let tableIndex = 0;
// 遍历段落,找到第一个表格之前的段落 // 遍历段落,找到第一个表格之前的段落
for (let i = 0; i < paragraphs.length; i++) { for (let i = 0; i < paragraphs.length; i++) {
if (tableIndex < tables.length && paragraphs[i].nextSibling === tables[tableIndex]) { if (tableIndex < tables.length && paragraphs[i].nextSibling === tables[tableIndex]) {
break; // 找到表格 break; // 找到表格
}
previousParagraphs.push(paragraphs[i]);
} }
previousParagraphs.push(paragraphs[i]); // 将前一段的内容转化为 HTML 或文本
} const previousHtml = this.convertParagraphsToHtml(previousParagraphs);
// 将前一段的内容转化为 HTML 或文本
const previousHtml = this.convertParagraphsToHtml(previousParagraphs);
console.log('tables at line 17:', previousHtml) console.log('tables at line 17:', previousHtml)
const tableHtml = this.convertTablesToHtml(tables, numberingMap); const tableHtml = this.convertTablesToHtml(tables, numberingMap);
console.log('tableHtml at line 18:', tableHtml) console.log('tableHtml at line 18:', tableHtml)
@@ -477,45 +520,45 @@ const previousHtml = this.convertParagraphsToHtml(previousParagraphs);
callback("<p>文件解析失败,请检查文件格式。</p>"); callback("<p>文件解析失败,请检查文件格式。</p>");
} }
}, },
// 转换段落为 HTML // 转换段落为 HTML
convertParagraphsToHtml(paragraphs) { convertParagraphsToHtml(paragraphs) {
let html = ""; let html = "";
paragraphs.forEach(p => { paragraphs.forEach(p => {
let paragraphHtml = ""; let paragraphHtml = "";
// 处理段落中的所有子元素 // 处理段落中的所有子元素
const runs = p.getElementsByTagName("w:r"); // 获取段落中的所有文本运行(可能包含上标、下标等) const runs = p.getElementsByTagName("w:r"); // 获取段落中的所有文本运行(可能包含上标、下标等)
Array.from(runs).forEach(run => { Array.from(runs).forEach(run => {
let text = ""; let text = "";
// 获取文本内容 // 获取文本内容
const textNodes = run.getElementsByTagName("w:t"); const textNodes = run.getElementsByTagName("w:t");
Array.from(textNodes).forEach(t => { Array.from(textNodes).forEach(t => {
text += t.textContent || t.text; text += t.textContent || t.text;
});
// 检查是否为上标或下标
const isSuperscript = run.getElementsByTagName("w:vertAlign")[0] ? run.getElementsByTagName("w:vertAlign")[0].getAttribute("w:val") === "superscript" : "";
const isSubscript = run.getElementsByTagName("w:vertAlign")[0] ? run.getElementsByTagName("w:vertAlign")[0].getAttribute("w:val") === "subscript" : '';
if (isSuperscript) {
text = `<sup>${text}</sup>`;
} else if (isSubscript) {
text = `<sub>${text}</sub>`;
}
// 拼接到段落 HTML 中
paragraphHtml += text;
}); });
// 检查是否为上标或下标
const isSuperscript = run.getElementsByTagName("w:vertAlign")[0]?run.getElementsByTagName("w:vertAlign")[0].getAttribute("w:val") === "superscript":"";
const isSubscript = run.getElementsByTagName("w:vertAlign")[0]?run.getElementsByTagName("w:vertAlign")[0].getAttribute("w:val") === "subscript":'';
if (isSuperscript) { // 将运行的文本拼接成完整的段落
text = `<sup>${text}</sup>`; html += `<p>${paragraphHtml}</p>`;
} else if (isSubscript) {
text = `<sub>${text}</sub>`;
}
// 拼接到段落 HTML 中
paragraphHtml += text;
}); });
// 将运行的文本拼接成完整的段落 return html;
html += `<p>${paragraphHtml}</p>`; }
}); ,
return html;
}
,
convertTablesToHtml(tables, numberingMap) { convertTablesToHtml(tables, numberingMap) {
const namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"; const namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
let html = ""; let html = "";
@@ -773,7 +816,7 @@ convertParagraphsToHtml(paragraphs) {
if (['jpg', 'jpeg', 'png'].includes(extension)) { if (['jpg', 'jpeg', 'png'].includes(extension)) {
thumbnailContent = `<img src="${mediaUrl + img.image}" alt="Image ${index}" style="width: 100%; height: auto;">`; thumbnailContent = `<img src="${mediaUrl + img.image}" alt="Image ${index}" style="width: 100%; height: auto;">`;
} else if (extension === 'tif') { } else if (extension === 'tif') {
thumbnailContent = `<canvas id="tiff-canvas-${index} ${img.article_image_id?`tiff-canvas-${img.article_image_id}`:''}" style="width: 100%; height: auto;"></canvas>`; thumbnailContent = `<canvas id="tiff-canvas-${index} ${img.article_image_id ? `tiff-canvas-${img.article_image_id}` : ''}" style="width: 100%; height: auto;"></canvas>`;
} else { } else {
thumbnailContent = `<a href="${mediaUrl + img.image}" style="color: #75abf1;width:100%; height: 100%;"> thumbnailContent = `<a href="${mediaUrl + img.image}" style="color: #75abf1;width:100%; height: 100%;">
<div <div
@@ -947,7 +990,7 @@ convertParagraphsToHtml(paragraphs) {
//更新传入所有表格样式 //更新传入所有表格样式
updateTableStyles(container, type, setTopBottomBorder) { updateTableStyles(container, type, setTopBottomBorder) {
var typesettingType = type ? type : 1 var typesettingType = type ? type : 1
const tables = container.querySelectorAll('table'); const tables = container.querySelectorAll('table');
tables.forEach((table) => { tables.forEach((table) => {
@@ -1150,6 +1193,487 @@ convertParagraphsToHtml(paragraphs) {
}, },
initEditorButton(vueInstance, ed) {
ed.ui.registry.addMenuButton('customDropdown', {
text: 'Set Title', // 下拉框标题
fetch: function (callback) {
// 定义下拉框的内容
const items = [
{
label: 'First level title',
value: 1
},
{
label: 'Secondary Title',
value: 2
},
{
label: 'Third level title',
value: 3
}
];
const menuItems = items.map((item) => ({
type: 'menuitem',
text: item.label,
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
if (selectedNode) {
// 向上查找最外层的 div
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
vueInstance.$emit('onEditTitle', {
mainId: dataId,
value: item.value
});
}
}
}
}));
callback(menuItems);
}
});
ed.ui.registry.addButton('addRow', {
icon:'duplicate-row',
text: 'Add Row', // 下拉框标题
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
console.log('dataId at line 1258:', dataId)
vueInstance.$emit('onAddRow', dataId);
}
}
});
// 添加自定义菜单项
ed.ui.registry.addButton('Save', {
icon: 'checkmark',
text: 'Save',
onAction: function () {
var deleteButtons = document.querySelectorAll('.tox-tinymce-inline');
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
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(/&nbsp;/g, ' ');
content = content.replace(/\s*style="[^"]*"/g, '');
var div = document.createElement('div');
div.innerHTML = content; // 将 HTML 字符串加载到 div 中
// 替换所有 <strong> 为 <b>
var strongTags = div.getElementsByTagName('strong');
for (var i = 0; i < strongTags.length; i++) {
var bTag = document.createElement('b');
bTag.innerHTML = strongTags[i].innerHTML; // 保留内容
strongTags[i].parentNode.replaceChild(bTag, strongTags[i]);
}
// 替换所有 <em> 为 <i>
var emTags = div.getElementsByTagName('em');
for (var i = 0; i < emTags.length; i++) {
var iTag = document.createElement('i');
iTag.innerHTML = emTags[i].innerHTML; // 保留内容
emTags[i].parentNode.replaceChild(iTag, emTags[i]);
}
content = div.innerHTML;
vueInstance.$emit('saveContent', content, dataId);
}
}
});
ed.ui.registry.addButton('level1', {
// icon: 'highlight-bg-color',
text: 'First level title',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
console.log('dataId at line 1258:', dataId)
vueInstance.$emit('onEditTitle', {
mainId: dataId,
value: 1
});
}
}
});
ed.ui.registry.addButton('level2', {
// icon: 'highlight-bg-color',
text: 'Second level Title',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
console.log('dataId at line 1258:', dataId)
vueInstance.$emit('onEditTitle', {
mainId: dataId,
value: 2
});
}
}
});
ed.ui.registry.addButton('level3', {
// icon: 'highlight-bg-color',
text: 'Third level title',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
console.log('dataId at line 1258:', dataId)
vueInstance.$emit('onEditTitle', {
mainId: dataId,
value: 3
});
}
}
});
ed.ui.registry.addButton('Edit', {
icon: 'highlight-bg-color',
text: 'Edit',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
console.log('dataId at line 1258:', dataId)
vueInstance.$emit('onEdit', dataId);
}
}
});
ed.ui.registry.addButton('commentAdd', {
icon: 'comment-add',
text: 'Comment Add',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
if (selectedNode) {
// 向上查找最外层的 div
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
const type = outerDiv.getAttribute('type');
console.log('type:', type);
// 获取选中的内容HTML格式
let selectedContent = edSelection.getContent({ format: 'html' });
// 创建一个临时容器来处理 HTML
const tempDiv = document.createElement('div');
tempDiv.innerHTML = selectedContent;
// 检查是否包含 <img> 标签
const hasImage = tempDiv.querySelector('img') !== null;
if (hasImage) {
vueInstance.$message.error(vueInstance.$t('commonTable.selectComment'));
return; // 如果包含图片,停止处理
}
// 获取清理后的纯文本内容
let selectedText = tempDiv.innerText.trim(); // 使用 trim() 清理前后的空格
// 处理文本中的多余空格:替换多个连续空格为一个空格
selectedText = selectedText.replace(/\s+/g, ' ');
// 确保保留的标签
const allowedTags = ['sup', 'sub', 'strong', 'em', 'b', 'i', 'blue', 'tr', 'td'];
// 遍历选中的节点并保留需要的标签
function preserveTags(node) {
if (node.nodeType === 3) { // 文本节点
return node.nodeValue;
}
if (node.nodeType === 1 && allowedTags.includes(node.nodeName.toLowerCase())) {
return node.outerHTML; // 保留整个标签
}
return '';
}
let preservedContent = '';
Array.from(tempDiv.childNodes).forEach((childNode) => {
preservedContent += preserveTags(childNode);
});
// 检查选中的内容是否已经包含嵌套批注
const containsPositionRemark = tempDiv.querySelector('.positionRemarkIndex');
if (containsPositionRemark) {
vueInstance.$message.error(vueInstance.$t('commonTable.alreadyCommented'));
return; // 如果已有嵌套批注,停止处理
}
// 如果内容不为空,发送批注请求
if (type == 0) {
if (selectedText !== '') {
vueInstance.$emit('onAddComment', {
mainId: dataId,
label: preservedContent // 发送保留标签的内容
});
} else {
vueInstance.$message.error(vueInstance.$t('commonTable.selectComment'));
}
} else if (type == 1) {
vueInstance.$emit('onAddComment', {
mainId: dataId,
label: preservedContent // 发送保留标签的内容
});
} else if (type == 2) {
vueInstance.$emit('onAddComment', {
mainId: dataId,
label: preservedContent // 发送保留标签的内容
});
}
}
}
}
});
ed.ui.registry.addButton('delete', {
icon: 'remove',
text: 'Delete',
onAction: function () {
var edSelection = ed.selection;
const selectedNode = edSelection.getNode(); // 获取选中的节点
if (selectedNode) {
// 向上查找最外层的 div
let outerDiv = selectedNode;
while (outerDiv && outerDiv.tagName !== 'DIV') {
outerDiv = outerDiv.parentNode;
}
// 如果找到的 div 节点存在
if (outerDiv) {
const dataId = outerDiv.getAttribute('main-id');
vueInstance.$emit('onDelete', dataId);
}
}
}
});
// 定义自定义按钮
ed.ui.registry.addButton('clearButton', {
text: 'Empty',
onAction: () => {
// 插入自定义表格到编辑器中
ed.setContent('');
}
});
ed.ui.registry.addButton('customBlue', {
text: 'Blue', // 按钮文本
className: 'custom-button-blue', // 添加自定义类
// shortcut: "Ctrl+J",
onAction: function () {
// 在选中的文本周围包裹 <blue> 标签
var selectedText = ed.selection.getContent();
console.log('selectedText at line 529:', selectedText);
if (selectedText) {
var wrappedText = `<blue>${selectedText}</blue>`;
ed.selection.setContent(wrappedText);
} else {
this.$message.error('请选择要添加蓝色的文本');
}
}
});
ed.ui.registry.addButton('myuppercase', {
text: 'A', // 按钮文本
onAction: function () {
// 在选中的文本周围包裹 <blue> 标签
var selectedText = ed.selection.getContent({ format: 'html' });
// 确保选中的文本是单个单词,包括空格
if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) {
// 使用正则将选中的文本中的第一个字母大写
var capitalizedText = selectedText.replace(/(^|\s)([a-zA-Z])/g, function(match, p1, p2) {
return p1 + p2.toUpperCase();
});
// 替换选中的文本,保持空格和其他内容
ed.selection.setContent(capitalizedText);
} else {
vueInstance.$message.error(vueInstance.$t('commonTable.selectWord'));
}
}
});
ed.ui.registry.addButton('myuppercase', {
text: 'A', // 按钮文本
onAction: function () {
// 在选中的文本周围包裹 <blue> 标签
var selectedText = ed.selection.getContent({ format: 'html' });
// 确保选中的文本是单个单词,包括空格
if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) {
// 使用正则将选中的文本中的第一个字母大写
var capitalizedText = selectedText.replace(/(^|\s)([a-zA-Z])/g, function(match, p1, p2) {
return p1 + p2.toUpperCase();
});
// 替换选中的文本,保持空格和其他内容
ed.selection.setContent(capitalizedText);
} else {
vueInstance.$message.error(vueInstance.$t('commonTable.selectWord'));
}
}
});
ed.ui.registry.addButton('myuppercasea', {
text: 'a', // 按钮文本(小写字母)
onAction: function () {
// 获取选中的文本,保留 HTML 格式
var selectedText = ed.selection.getContent({ format: 'html' });
// 确保选中的文本是单个有效的单词,包括空格
if (selectedText.trim() && /^[\s\w]+$/.test(selectedText)) {
// 使用正则将选中的文本中的第一个字母转换为小写
var lowercasedText = selectedText.replace(/(^|\s)([a-zA-Z])/g, function(match, p1, p2) {
return p1 + p2.toLowerCase();
});
// 替换选中的文本,保持空格和其他内容
ed.selection.setContent(lowercasedText);
} else {
vueInstance.$message.error(vueInstance.$t('commonTable.selectWord'));
}
}
});
ed.ui.registry.addButton('Line', {
text: '', // 按钮文本
onAction: function () {
// 插入 `` 符号到当前光标位置
ed.insertContent('');
}
});
ed.ui.registry.addButton('removeBlue', {
text: 'Blue', // 按钮文本
onAction: function () {
const range = ed.selection.getRng(); // 获取选区范围
let startNode = range.startContainer; // 获取选区起始节点
let closestBlue = null;
// 向上查找最近的 <blue> 标签
while (startNode) {
if (startNode.nodeName && startNode.nodeName.toLowerCase() === 'blue') {
closestBlue = startNode;
break;
}
startNode = startNode.parentNode;
}
if (closestBlue) {
// 如果找到最近的 <blue> 标签,移除它的外层标签,但保留内容
const parent = closestBlue.parentNode;
while (closestBlue.firstChild) {
parent.insertBefore(closestBlue.firstChild, closestBlue);
}
parent.removeChild(closestBlue);
} else {
// 未找到 <blue> 标签,仅移除选中的 <blue> 标签内容
const selectedContent = ed.selection.getContent({ format: 'html' });
// 使用正则表达式移除选区中的 <blue> 标签
const cleanedContent = selectedContent
.replace(/<blue[^>]*>/g, '') // 删除起始标签 <blue>
.replace(/<\/blue>/g, ''); // 删除结束标签 </blue>
// 更新选中的内容
ed.selection.setContent(cleanedContent);
}
}
});
},
inTinymceButtonClass() {
setTimeout(function () {
// 使用 querySelectorAll 获取所有符合条件的按钮
const buttons = [
{ selector: '.tox-tbtn[data-mce-name="commentadd"]', className: 'tinymce-custom-button-commentadd' },
{ selector: '.tox-tbtn[data-mce-name="addrow"]', className: 'tinymce-custom-button-addrow' },
{ selector: '.tox-tbtn[data-mce-name="delete"]', className: 'tinymce-custom-button-delete' },
{ selector: '.tox-tbtn[data-mce-name="edit"]', className: 'tinymce-custom-button-edit' },
{ selector: '.tox-tbtn[data-mce-name="save"]', className: 'tinymce-custom-button-save' },
{ selector: '.tox-tbtn[data-mce-name="customblue"]', className: 'tinymce-custom-button-blue' },
{ selector: '.tox-tbtn[data-mce-name="removeblue"]', className: 'tinymce-custom-button-removeblue' }
];
// 遍历每个按钮并为每个按钮添加类
buttons.forEach(item => {
const buttonElements = document.querySelectorAll(item.selector);
buttonElements.forEach(button => {
if (!button.classList.contains(item.className)) { // 防止重复添加
button.classList.add(item.className);
}
});
});
}, 100); // 延迟执行,确保按钮渲染完成
}
// 通用递归方法 // 通用递归方法
}; };

View File

@@ -1,45 +1,47 @@
<template> <template>
<div class="header"> <div class="header">
<!-- 折叠按钮 --> <!-- 折叠按钮 -->
<div class="collapse-btn" @click="collapseChage"> <div class="collapse-btn" @click="collapseChage" v-if="!home">
<i v-if="!collapse" class="el-icon-s-fold"></i> <i v-if="!collapse" class="el-icon-s-fold"></i>
<i v-else class="el-icon-s-unfold"></i> <i v-else class="el-icon-s-unfold"></i>
</div> </div>
<div class="logo"> <div class="collapse-btn" @click="goHome" v-if="home">
<div> <i class="el-icon-s-home"></i>
<img src="../../assets/img/logo.png" /> </div>
<p>{{ $t('system.title_1') }}</p> <div class="logo">
</div> <div>
<div> <img src="../../assets/img/logo.png" />
{{ $t('system.title_2') }} <p>{{ $t('system.title_1') }}</p>
</div> </div>
<!-- {{ $t('system.title') }} --> <div>
</div> {{ $t('system.title_2') }}
<div class="header-right"> </div>
<div class="header-user-con"> <!-- {{ $t('system.title') }} -->
<div class="changelang"> </div>
<el-dropdown trigger="click" @command="chengelang"> <div class="header-right">
<span class="el-dropdown-link"> <div class="header-user-con">
language <div class="changelang">
<i class="el-icon-arrow-down el-icon--right"></i> <el-dropdown trigger="click" @command="chengelang">
</span> <span class="el-dropdown-link">
<el-dropdown-menu slot="dropdown"> language
<el-dropdown-item command="en">english</el-dropdown-item> <i class="el-icon-arrow-down el-icon--right"></i>
<el-dropdown-item command="zh">中文简体</el-dropdown-item> </span>
</el-dropdown-menu> <el-dropdown-menu slot="dropdown">
</el-dropdown> <el-dropdown-item command="en">english</el-dropdown-item>
</div> <el-dropdown-item command="zh">中文简体</el-dropdown-item>
<!-- 全屏显示 --> </el-dropdown-menu>
<div class="btn-fullscreen" @click="handleFullScreen"> </el-dropdown>
<el-tooltip effect="dark" :content="fullscreen ? $t('system.noscreen') : $t('system.screen')" placement="bottom"> </div>
<i class="el-icon-rank"></i> <!-- 全屏显示 -->
</el-tooltip> <div class="btn-fullscreen" @click="handleFullScreen">
</div> <el-tooltip effect="dark" :content="fullscreen ? $t('system.noscreen') : $t('system.screen')" placement="bottom">
<!-- 消息中心 --> <i class="el-icon-rank"></i>
</el-tooltip>
</div>
<!-- 消息中心 -->
<!-- 身份切换 -->
<!-- 身份切换 --> <!-- <span style="font-size: 14px;margin-right: 8px;" v-if="this.user_cap.includes('author')">View as :</span>
<!-- <span style="font-size: 14px;margin-right: 8px;" v-if="this.user_cap.includes('author')">View as :</span>
<el-dropdown class="link_role" trigger="click" v-if="this.user_cap.includes('author')"> <el-dropdown class="link_role" trigger="click" v-if="this.user_cap.includes('author')">
<span style="color: #fff;cursor: pointer;"> <span style="color: #fff;cursor: pointer;">
Author<i class="el-icon-arrow-down el-icon--right"></i> Author<i class="el-icon-arrow-down el-icon--right"></i>
@@ -63,343 +65,346 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> --> </el-dropdown> -->
<!-- 用户头像 -->
<!-- 用户头像 --> <div class="user-avator" @click="skip_link()" v-if="hasorcie">
<div class="user-avator" @click="skip_link()" v-if="hasorcie"> <el-tooltip class="item" effect="light" content="Link to Orcid" placement="bottom-end">
<el-tooltip class="item" effect="light" content="Link to Orcid" placement="bottom-end"> <img src="../../assets/img/orcid.png" />
<img src="../../assets/img/orcid.png" /> </el-tooltip>
</el-tooltip> </div>
</div> <div class="user-avator" @click="skip_check()" v-else>
<div class="user-avator" @click="skip_check()" v-else> <el-tooltip class="item" effect="light" content="Connect to ORCID" placement="bottom-end">
<el-tooltip class="item" effect="light" content="Connect to ORCID" placement="bottom-end"> <img src="../../assets/img/orcno.png" />
<img src="../../assets/img/orcno.png" /> </el-tooltip>
</el-tooltip> </div>
</div> <!-- 用户名下拉菜单 -->
<!-- 用户名下拉菜单 --> <el-dropdown class="user-name" trigger="click" @command="handleCommand">
<el-dropdown class="user-name" trigger="click" @command="handleCommand"> <span class="el-dropdown-link">
<span class="el-dropdown-link"> {{ username }}
{{ username }} <i class="el-icon-caret-bottom"></i>
<i class="el-icon-caret-bottom"></i> </span>
</span> <el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown"> <!-- <el-dropdown-item divided command="personcenter">Personal Center</el-dropdown-item> -->
<!-- <el-dropdown-item divided command="personcenter">Personal Center</el-dropdown-item> --> <el-dropdown-item divided command="loginout">{{ $t('system.loyout') }}</el-dropdown-item>
<el-dropdown-item divided command="loginout">{{ $t('system.loyout') }}</el-dropdown-item> </el-dropdown-menu>
</el-dropdown-menu> </el-dropdown>
</el-dropdown> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import bus from '../common/bus'; import bus from '../common/bus';
export default { export default {
data() { props: ['home'],
return { data() {
collapse: false, return {
fullscreen: false, collapse: false,
name: 'unknown user', fullscreen: false,
message: 2, name: 'unknown user',
hasorcie: false, message: 2,
link_path: '', hasorcie: false,
user_id: localStorage.getItem('U_id'), link_path: '',
user_cap: localStorage.getItem('U_role'), user_id: localStorage.getItem('U_id'),
orcid: '', user_cap: localStorage.getItem('U_role'),
orcidLink: 'https://orcid.org/oauth/authorize?client_id=APP-PKF0BGRP6DWM6FUB&response_type=code&scope=/authenticate&redirect_uri=https://submission.tmrjournals.com/orcidBind', orcid: '',
langArr: [{ orcidLink:
value: 'zh', 'https://orcid.org/oauth/authorize?client_id=APP-PKF0BGRP6DWM6FUB&response_type=code&scope=/authenticate&redirect_uri=https://submission.tmrjournals.com/orcidBind',
label: '中文' langArr: [
}, {
{ value: 'zh',
value: 'en', label: '中文'
label: 'English' },
} {
], value: 'en',
curStartTime: '2019-07-31 08:00:00', label: 'English'
daojishi: '', }
day: '0', ],
hour: '00', curStartTime: '2019-07-31 08:00:00',
min: '00', daojishi: '',
second: '00', day: '0',
}; hour: '00',
}, min: '00',
created() { second: '00'
this.initORCID(); };
if (this.user_id == 24) { },
this.daojishi = '2021.9.3 - 2021.9.30' created() {
this.curStartTime = '2021-10-01 00:00:00' this.initORCID();
this.countTime(); if (this.user_id == 24) {
} this.daojishi = '2021.9.3 - 2021.9.30';
if (this.user_id == 25) { this.curStartTime = '2021-10-01 00:00:00';
this.daojishi = '2021.9.6 - 2021.12.31' this.countTime();
this.curStartTime = '2022-01-01 00:00:00' }
this.countTime(); if (this.user_id == 25) {
} this.daojishi = '2021.9.6 - 2021.12.31';
}, this.curStartTime = '2022-01-01 00:00:00';
computed: { this.countTime();
username() { }
let username = localStorage.getItem('U_name'); },
return username ? username : this.name; computed: {
}, username() {
onRoutes() { let username = localStorage.getItem('U_name');
0 return username ? username : this.name;
return this.$route.path.replace('/', ''); },
}, onRoutes() {
userrole() { 0;
let userrole = localStorage.getItem('U_status'); return this.$route.path.replace('/', '');
if (userrole == 1) { },
return this.$t('total.author'); userrole() {
} else if (userrole == 2) { let userrole = localStorage.getItem('U_status');
return this.$t('total.editor'); if (userrole == 1) {
} else if (userrole == 'admin') { return this.$t('total.author');
return this.$t('total.admin'); } else if (userrole == 2) {
} else { return this.$t('total.editor');
return this.$t('total.reviewers'); } else if (userrole == 'admin') {
} return this.$t('total.admin');
} } else {
}, return this.$t('total.reviewers');
methods: { }
// 用户名下拉菜单选择事件 }
handleCommand(command) { },
// 个人中心 methods: {
if (command == 'personcenter') { goHome() {
this.$router.push('/percenter'); this.$router.push('/');
} },
// 退出系统 // 用户名下拉菜单选择事件
if (command == 'loginout') { handleCommand(command) {
localStorage.removeItem('U_role'); // 个人中心
localStorage.removeItem('U_id'); if (command == 'personcenter') {
localStorage.removeItem('U_name'); this.$router.push('/percenter');
localStorage.removeItem('U_status'); }
localStorage.removeItem('ms_journal_alias'); // 退出系统
this.$router.push('/login'); if (command == 'loginout') {
} localStorage.removeItem('U_role');
}, localStorage.removeItem('U_id');
// 侧边栏折叠 localStorage.removeItem('U_name');
collapseChage() { localStorage.removeItem('U_status');
this.collapse = !this.collapse; localStorage.removeItem('ms_journal_alias');
bus.$emit('collapse', this.collapse); this.$router.push('/login');
}, }
//判断orcid },
initORCID() { // 侧边栏折叠
this.$api collapseChage() {
.post('api/user/checkOrcid', { this.collapse = !this.collapse;
account: localStorage.getItem('U_name') bus.$emit('collapse', this.collapse);
}) },
.then((res) => { //判断orcid
this.hasorcie = res.userinfo.orcid == '' ? false : true; initORCID() {
this.orcid = res.userinfo.orcid; this.$api
}) .post('api/user/checkOrcid', {
.catch((err) => { account: localStorage.getItem('U_name')
console.log(err); })
}); .then((res) => {
}, this.hasorcie = res.userinfo.orcid == '' ? false : true;
// 全屏事件 this.orcid = res.userinfo.orcid;
handleFullScreen() { })
let element = document.documentElement; .catch((err) => {
if (this.fullscreen) { console.log(err);
if (document.exitFullscreen) { });
document.exitFullscreen(); },
} else if (document.webkitCancelFullScreen) { // 全屏事件
document.webkitCancelFullScreen(); handleFullScreen() {
} else if (document.mozCancelFullScreen) { let element = document.documentElement;
document.mozCancelFullScreen(); if (this.fullscreen) {
} else if (document.msExitFullscreen) { if (document.exitFullscreen) {
document.msExitFullscreen(); document.exitFullscreen();
} } else if (document.webkitCancelFullScreen) {
} else { document.webkitCancelFullScreen();
if (element.requestFullscreen) { } else if (document.mozCancelFullScreen) {
element.requestFullscreen(); document.mozCancelFullScreen();
} else if (element.webkitRequestFullScreen) { } else if (document.msExitFullscreen) {
element.webkitRequestFullScreen(); document.msExitFullscreen();
} else if (element.mozRequestFullScreen) { }
element.mozRequestFullScreen(); } else {
} else if (element.msRequestFullscreen) { if (element.requestFullscreen) {
// IE11 element.requestFullscreen();
element.msRequestFullscreen(); } else if (element.webkitRequestFullScreen) {
} element.webkitRequestFullScreen();
} } else if (element.mozRequestFullScreen) {
this.fullscreen = !this.fullscreen; element.mozRequestFullScreen();
}, } else if (element.msRequestFullscreen) {
//切换语言 // IE11
chengelang(commond) { element.msRequestFullscreen();
localStorage.setItem('langs', commond); }
this.$router.go(0); }
}, this.fullscreen = !this.fullscreen;
skip_link() { },
location.href = 'https://orcid.org/' + this.orcid; //切换语言
}, chengelang(commond) {
skip_check() { localStorage.setItem('langs', commond);
location.href = this.orcidLink; this.$router.go(0);
}, },
skip_link() {
location.href = 'https://orcid.org/' + this.orcid;
},
skip_check() {
location.href = this.orcidLink;
},
// 倒计时
// 倒计时 countTime() {
countTime() { // 获取当前时间
// 获取当前时间 let date = new Date();
let date = new Date() let now = date.getTime();
let now = date.getTime() // 设置截止时间
// 设置截止时间 let endDate = new Date(this.curStartTime); // this.curStartTime需要倒计时的日期
let endDate = new Date(this.curStartTime) // this.curStartTime需要倒计时的日期 let end = endDate.getTime();
let end = endDate.getTime() // 时间差
// 时间差 let leftTime = end - now;
let leftTime = end - now // 定义变量 d,h,m,s保存倒计时的时间
// 定义变量 d,h,m,s保存倒计时的时间 if (leftTime >= 0) {
if (leftTime >= 0) { // 天
// 天 this.day = Math.floor(leftTime / 1000 / 60 / 60 / 24);
this.day = Math.floor(leftTime / 1000 / 60 / 60 / 24) // 时
// 时 let h = Math.floor((leftTime / 1000 / 60 / 60) % 24);
let h = Math.floor(leftTime / 1000 / 60 / 60 % 24) this.hour = h < 10 ? '0' + h : h;
this.hour = h < 10 ? '0' + h : h // 分
// 分 let m = Math.floor((leftTime / 1000 / 60) % 60);
let m = Math.floor(leftTime / 1000 / 60 % 60) this.min = m < 10 ? '0' + m : m;
this.min = m < 10 ? '0' + m : m // 秒
// 秒 let s = Math.floor((leftTime / 1000) % 60);
let s = Math.floor(leftTime / 1000 % 60) this.second = s < 10 ? '0' + s : s;
this.second = s < 10 ? '0' + s : s } else {
} else { this.day = 0;
this.day = 0 this.hour = '00';
this.hour = '00' this.min = '00';
this.min = '00' this.second = '00';
this.second = '00' }
} // 等于0的时候不调用
// 等于0的时候不调用 if (Number(this.hour) === 0 && Number(this.day) === 0 && Number(this.min) === 0 && Number(this.second) === 0) {
if (Number(this.hour) === 0 && Number(this.day) === 0 && Number(this.min) === 0 && Number(this.second) === 0) { return;
return } else {
} else { // 递归每秒调用countTime方法显示动态时间效果,
// 递归每秒调用countTime方法显示动态时间效果, setTimeout(this.countTime, 1000);
setTimeout(this.countTime, 1000) }
} }
}, },
}, mounted() {
mounted() { if (document.body.clientWidth < 1000) {
if (document.body.clientWidth < 1000) { this.collapseChage();
this.collapseChage(); }
} },
}, watch: {
watch: { $route: {
$route: { handler: function (route) {
handler: function(route) { this.link_path = route.path;
this.link_path = route.path },
}, immediate: true
immediate: true }
} }
} };
};
</script> </script>
<style scoped> <style scoped>
.header { .header {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: 70px; height: 70px;
font-size: 22px; font-size: 22px;
color: #fff; color: #fff;
} }
.collapse-btn { .collapse-btn {
float: left; float: left;
padding: 0 15px 0 21px; padding: 0 15px 0 21px;
cursor: pointer; cursor: pointer;
line-height: 70px; line-height: 70px;
} }
.header .logo { .header .logo {
float: left; float: left;
padding-top: 19px; padding-top: 19px;
vertical-align: middle; vertical-align: middle;
font-size: 20px; font-size: 20px;
} }
.header .logo img { .header .logo img {
width: 84px; width: 84px;
height: 20px; height: 20px;
margin-top: -4px; margin-top: -4px;
margin-right: 15px; margin-right: 15px;
padding-left: 12px; padding-left: 12px;
} }
.header .logo>div { .header .logo > div {
float: left; float: left;
height: 40px; height: 40px;
} }
.header .logo p { .header .logo p {
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
} }
.header-right { .header-right {
float: right; float: right;
padding-right: 50px; padding-right: 50px;
} }
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.btn-fullscreen { .btn-fullscreen {
transform: rotate(45deg); transform: rotate(45deg);
margin-right: 5px; margin-right: 5px;
font-size: 24px; font-size: 24px;
} }
.changelang { .changelang {
position: relative; position: relative;
width: 90px; width: 90px;
height: 30px; height: 30px;
} }
.btn-fullscreen { .btn-fullscreen {
position: relative; position: relative;
width: 30px; width: 30px;
height: 30px; height: 30px;
text-align: center; text-align: center;
border-radius: 15px; border-radius: 15px;
cursor: pointer; cursor: pointer;
} }
.btn-bell-badge { .btn-bell-badge {
position: absolute; position: absolute;
right: 0; right: 0;
top: -2px; top: -2px;
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 4px; border-radius: 4px;
background: #f56c6c; background: #f56c6c;
color: #fff; color: #fff;
} }
.btn-bell .el-icon-bell { .btn-bell .el-icon-bell {
color: #fff; color: #fff;
} }
.user-name { .user-name {
margin-left: 10px; margin-left: 10px;
} }
.user-avator { .user-avator {
margin-left: 20px; margin-left: 20px;
} }
.user-avator img { .user-avator img {
display: block; display: block;
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.el-dropdown-link { .el-dropdown-link {
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
} }
.el-dropdown-menu__item { .el-dropdown-menu__item {
text-align: center; text-align: center;
} }
#colgreen {
color: rgb(142, 150, 74);
}
#colgreen {
color: rgb(142, 150, 74);
}
</style> </style>

View File

@@ -0,0 +1,403 @@
<template>
<div class="header">
<!-- 折叠按钮 -->
<div class="" @click="goHome" >
<i class="el-icon-s-home" style="font-size: 24px;line-height: 60px;color: #006699d1;"></i>
</div>
<div class="header-right">
<div class="header-user-con">
<div class="changelang">
<el-dropdown trigger="click" @command="chengelang">
<span class="el-dropdown-link">
language
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="en">english</el-dropdown-item>
<el-dropdown-item command="zh">中文简体</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<!-- 全屏显示 -->
<div class="btn-fullscreen" @click="handleFullScreen">
<el-tooltip effect="dark" :content="fullscreen ? $t('system.noscreen') : $t('system.screen')" placement="bottom">
<i class="el-icon-rank"></i>
</el-tooltip>
</div>
<!-- 消息中心 -->
<!-- 身份切换 -->
<!-- <span style="font-size: 14px;margin-right: 8px;" v-if="this.user_cap.includes('author')">View as :</span>
<el-dropdown class="link_role" trigger="click" v-if="this.user_cap.includes('author')">
<span style="color: #fff;cursor: pointer;">
Author<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu :default-active="onRoutes" router slot="dropdown" style="cursor: pointer;">
<router-link :to="{path:'/dashboard'}">
<el-dropdown-item>Author</el-dropdown-item>
</router-link>
<router-link :to="{path:'/managing'}" v-if="this.user_cap.includes('chief')">
<el-dropdown-item>Editor-in-Chief</el-dropdown-item>
</router-link>
<router-link :to="{path:'/editorial'}" v-if="this.user_cap.includes(',board')">
<el-dropdown-item>Editorial board member</el-dropdown-item>
</router-link>
<router-link :to="{path:'/peerewer'}" v-if="this.user_cap.includes('reviewer')">
<el-dropdown-item>Reviewer</el-dropdown-item>
</router-link>
<router-link :to="{path:'/youthed'}" v-if="this.user_cap.includes('yboard')">
<el-dropdown-item>Young scientist member</el-dropdown-item>
</router-link>
</el-dropdown-menu>
</el-dropdown> -->
<!-- 用户头像 -->
<div class="user-avator" @click="skip_link()" v-if="hasorcie">
<el-tooltip class="item" effect="light" content="Link to Orcid" placement="bottom-end">
<img src="../../assets/img/orcid.png" />
</el-tooltip>
</div>
<div class="user-avator" @click="skip_check()" v-else>
<el-tooltip class="item" effect="light" content="Connect to ORCID" placement="bottom-end">
<img src="../../assets/img/orcno.png" />
</el-tooltip>
</div>
<!-- 用户名下拉菜单 -->
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
{{ username }}
<i class="el-icon-caret-bottom"></i>
</span>
<el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item divided command="personcenter">Personal Center</el-dropdown-item> -->
<el-dropdown-item divided command="loginout">{{ $t('system.loyout') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
props: ['home'],
data() {
return {
collapse: false,
fullscreen: false,
name: 'unknown user',
message: 2,
hasorcie: false,
link_path: '',
user_id: localStorage.getItem('U_id'),
user_cap: localStorage.getItem('U_role'),
orcid: '',
orcidLink:
'https://orcid.org/oauth/authorize?client_id=APP-PKF0BGRP6DWM6FUB&response_type=code&scope=/authenticate&redirect_uri=https://submission.tmrjournals.com/orcidBind',
langArr: [
{
value: 'zh',
label: '中文'
},
{
value: 'en',
label: 'English'
}
],
curStartTime: '2019-07-31 08:00:00',
daojishi: '',
day: '0',
hour: '00',
min: '00',
second: '00'
};
},
created() {
this.initORCID();
if (this.user_id == 24) {
this.daojishi = '2021.9.3 - 2021.9.30';
this.curStartTime = '2021-10-01 00:00:00';
this.countTime();
}
if (this.user_id == 25) {
this.daojishi = '2021.9.6 - 2021.12.31';
this.curStartTime = '2022-01-01 00:00:00';
this.countTime();
}
},
computed: {
username() {
let username = localStorage.getItem('U_name');
return username ? username : this.name;
},
onRoutes() {
0;
return this.$route.path.replace('/', '');
},
userrole() {
let userrole = localStorage.getItem('U_status');
if (userrole == 1) {
return this.$t('total.author');
} else if (userrole == 2) {
return this.$t('total.editor');
} else if (userrole == 'admin') {
return this.$t('total.admin');
} else {
return this.$t('total.reviewers');
}
}
},
methods: {
goHome() {
this.$router.push('/');
},
// 用户名下拉菜单选择事件
handleCommand(command) {
// 个人中心
if (command == 'personcenter') {
this.$router.push('/percenter');
}
// 退出系统
if (command == 'loginout') {
localStorage.removeItem('U_role');
localStorage.removeItem('U_id');
localStorage.removeItem('U_name');
localStorage.removeItem('U_status');
localStorage.removeItem('ms_journal_alias');
this.$router.push('/login');
}
},
// 侧边栏折叠
collapseChage() {
this.collapse = !this.collapse;
bus.$emit('collapse', this.collapse);
},
//判断orcid
initORCID() {
this.$api
.post('api/user/checkOrcid', {
account: localStorage.getItem('U_name')
})
.then((res) => {
this.hasorcie = res.userinfo.orcid == '' ? false : true;
this.orcid = res.userinfo.orcid;
})
.catch((err) => {
console.log(err);
});
},
// 全屏事件
handleFullScreen() {
let element = document.documentElement;
if (this.fullscreen) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
} else {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.msRequestFullscreen) {
// IE11
element.msRequestFullscreen();
}
}
this.fullscreen = !this.fullscreen;
},
//切换语言
chengelang(commond) {
localStorage.setItem('langs', commond);
this.$router.go(0);
},
skip_link() {
location.href = 'https://orcid.org/' + this.orcid;
},
skip_check() {
location.href = this.orcidLink;
},
// 倒计时
countTime() {
// 获取当前时间
let date = new Date();
let now = date.getTime();
// 设置截止时间
let endDate = new Date(this.curStartTime); // this.curStartTime需要倒计时的日期
let end = endDate.getTime();
// 时间差
let leftTime = end - now;
// 定义变量 d,h,m,s保存倒计时的时间
if (leftTime >= 0) {
// 天
this.day = Math.floor(leftTime / 1000 / 60 / 60 / 24);
// 时
let h = Math.floor((leftTime / 1000 / 60 / 60) % 24);
this.hour = h < 10 ? '0' + h : h;
// 分
let m = Math.floor((leftTime / 1000 / 60) % 60);
this.min = m < 10 ? '0' + m : m;
// 秒
let s = Math.floor((leftTime / 1000) % 60);
this.second = s < 10 ? '0' + s : s;
} else {
this.day = 0;
this.hour = '00';
this.min = '00';
this.second = '00';
}
// 等于0的时候不调用
if (Number(this.hour) === 0 && Number(this.day) === 0 && Number(this.min) === 0 && Number(this.second) === 0) {
return;
} else {
// 递归每秒调用countTime方法显示动态时间效果,
setTimeout(this.countTime, 1000);
}
}
},
mounted() {
if (document.body.clientWidth < 1000) {
this.collapseChage();
}
},
watch: {
$route: {
handler: function (route) {
this.link_path = route.path;
},
immediate: true
}
}
};
</script>
<style scoped>
.header {
background-color: #fff;
position: relative;
box-sizing: border-box;
width: 100%;
display: flex;
justify-content: space-between;
height: 60px;
padding: 0 20px;
color: #333639;
box-shadow: 0 2px 2px -2px rgba(34, 47, 62, 0.1), 0 8px 8px -4px rgba(34, 47, 62, 0.07);
border-bottom:1px solid #f0f0f0;
}
.collapse-btn {
float: left;
padding: 0 15px 0 21px;
cursor: pointer;
line-height: 60px;
}
.header .logo {
float: left;
padding-top: 19px;
vertical-align: middle;
font-size: 20px;
}
.header .logo img {
width: 84px;
height: 20px;
margin-top: -4px;
margin-right: 15px;
padding-left: 12px;
}
.header .logo > div {
float: left;
height: 40px;
}
.header .logo p {
font-size: 12px;
text-align: center;
}
.header-right {
float: right;
padding-right: 50px;
}
.header-user-con {
display: flex;
height: 60px;
align-items: center;
}
.btn-fullscreen {
transform: rotate(45deg);
margin-right: 5px;
font-size: 24px;
}
.changelang {
position: relative;
width: 90px;
height: 30px;
}
.btn-fullscreen {
position: relative;
width: 30px;
height: 30px;
text-align: center;
border-radius: 15px;
cursor: pointer;
}
.btn-bell-badge {
position: absolute;
right: 0;
top: -2px;
width: 8px;
height: 8px;
border-radius: 4px;
background: #f56c6c;
color: #333639;
}
.btn-bell .el-icon-bell {
color: #333639;
}
.user-name {
margin-left: 10px;
}
.user-avator {
margin-left: 20px;
}
.user-avator img {
display: block;
width: 20px;
height: 20px;
}
.el-dropdown-link {
color: #333639;
cursor: pointer;
}
.el-dropdown-menu__item {
text-align: center;
}
#colgreen {
color: rgb(142, 150, 74);
}
</style>

View File

@@ -1,23 +1,41 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<v-head></v-head> <template v-if="!this.$route.meta.hideSidebar">
<v-sidebar></v-sidebar> <v-head></v-head>
<div class="content-box" :class="{ 'content-collapse': collapse }">
<v-tags></v-tags> <v-sidebar></v-sidebar>
<div class="content"> <div class="content-box" :class="{ 'content-collapse': collapse }">
<transition name="move" mode="out-in"> <v-tags></v-tags>
<keep-alive :include="tagsList"> <div class="content">
<router-view ></router-view> <transition name="move" mode="out-in">
</keep-alive> <keep-alive :include="tagsList">
</transition> <router-view></router-view>
<el-backtop target=".content"></el-backtop> </keep-alive>
</transition>
<el-backtop target=".content"></el-backtop>
</div>
</div> </div>
</div> </template>
<template v-else>
<v-head2 :home="true"></v-head2>
<div style="width: 100%;height: calc(100% - 62px);overflow: hidden;">
<div class="content" style="padding: 0;overflow: hidden;">
<!-- <transition name="move" mode="out-in"> -->
<!-- <keep-alive :include="tagsList"> -->
<router-view></router-view>
<!-- </keep-alive> -->
<!-- </transition> -->
<el-backtop target=".content"></el-backtop>
</div>
</div>
</template>
</div> </div>
</template> </template>
<script> <script>
import vHead from './Header.vue'; import vHead from './Header.vue';
import vHead2 from './Header2.vue';
import vSidebar from './Sidebar.vue'; import vSidebar from './Sidebar.vue';
import vTags from './Tags.vue'; import vTags from './Tags.vue';
import bus from './bus'; import bus from './bus';
@@ -30,6 +48,7 @@ export default {
}, },
components: { components: {
vHead, vHead,
vHead2,
vSidebar, vSidebar,
vTags vTags
}, },

View File

@@ -636,6 +636,7 @@ export default {
} }
}, },
created() { created() {
localStorage.setItem('collapse', this.collapse); localStorage.setItem('collapse', this.collapse);
if (this.userrole == 2) { if (this.userrole == 2) {
//其余的身份(显示作者) //其余的身份(显示作者)

View File

@@ -355,6 +355,11 @@ const en = {
}, },
commonTable: { commonTable: {
add: 'Add', add: 'Add',
delete: 'Delete',
reply: 'Reply',
solve: 'Solve',
cancelsolve: 'Cancel resolved',
Resolved: 'Resolved',
preview: 'Preview', preview: 'Preview',
link: 'Positioning', link: 'Positioning',
Typed: 'Typed', Typed: 'Typed',
@@ -373,7 +378,10 @@ const en = {
removeAnnotations:'Are you sure you want to delete this Annotation?', removeAnnotations:'Are you sure you want to delete this Annotation?',
removeContent:'Are you sure you want to delete this content?', removeContent:'Are you sure you want to delete this content?',
reContent:'Are you sure you want to restore this content?', reContent:'Are you sure you want to restore this content?',
uploadImageInfo:'Figures can only upload files in JPG, JPEG, and PNG formats!' 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!'
}, },
pendingPayment:{ pendingPayment:{
title:'Title', title:'Title',

View File

@@ -348,6 +348,11 @@ const zh = {
}, },
commonTable: { commonTable: {
add: '新增', add: '新增',
delete: '删除',
reply: '答复',
solve: '解决',
cancelsolve: '取消解决',
Resolved: '已解决',
preview: '预览', preview: '预览',
positioning: '定位', positioning: '定位',
edit: '编辑', edit: '编辑',
@@ -366,7 +371,10 @@ const zh = {
removeAnnotations: '确定要删除这条批注吗?', removeAnnotations: '确定要删除这条批注吗?',
removeContent: '确定要删除这条内容吗?', removeContent: '确定要删除这条内容吗?',
reContent: '确定要恢复这条内容吗?', reContent: '确定要恢复这条内容吗?',
uploadImageInfo: 'Figures 只能上传 JPG、JPEG 和 PNG 格式的文件' uploadImageInfo: 'Figures 只能上传 JPG、JPEG 和 PNG 格式的文件',
selectComment: '请选择要添加批注的文本',
selectWord:'请只选中单个单词!',
alreadyCommented:'文本中已有批注内容请重新选择',
}, },
pendingPayment: { pendingPayment: {
title: 'Title', title: 'Title',

View File

@@ -270,12 +270,16 @@ export default {
}, },
// 跳转到图表编辑页面 // 跳转到图表编辑页面
goGenerateCharts(id) { goGenerateCharts(id) {
this.$router.push({ window.open(this.$router.resolve({ path: '/GenerateCharts',
path: 'GenerateCharts',
query: { query: {
id: id id: id
} } }).href, '_blank');
}); // this.$router.push({
// path: 'GenerateCharts',
// query: {
// id: id
// }
// });
}, },
// 隐藏alert // 隐藏alert

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -215,6 +215,7 @@
localStorage.setItem('U_role', 'superadmin'); localStorage.setItem('U_role', 'superadmin');
localStorage.setItem('U_name', res.userinfo.account); localStorage.setItem('U_name', res.userinfo.account);
localStorage.setItem('U_id', res.userinfo.user_id); localStorage.setItem('U_id', res.userinfo.user_id);
return false
// localStorage.setItem('U_id', res.userinfo.admin_id); // localStorage.setItem('U_id', res.userinfo.admin_id);
this.$router.push('/'); this.$router.push('/');
} else if (res.data.roles.includes('editor')) { } else if (res.data.roles.includes('editor')) {

View File

@@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<div class="tab_post"> <div class="tab_post" >
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<p <p
v-if="feeStatus == 0" v-if="feeStatus == 0"
@@ -50,7 +53,7 @@
<p v-else> <p v-else>
<el-button type="primary" plain @click="htmlContet()" style="width: auto; font-weight: bold; margin-top: 10px"> <el-button type="primary" plain @click="htmlContet()" style="width: auto; font-weight: bold; margin-top: 10px">
<i class="el-icon-document-copy" style="font-weight: bold; font-size: 14px"></i> <i class="el-icon-document-copy" style="font-weight: bold; font-size: 14px"></i>
HTML Proofread Text Proofread
</el-button> </el-button>
</p> </p>
@@ -94,7 +97,7 @@
<!-- 文章正文 --> <!-- 文章正文 -->
<!-- 参考文献 --> <!-- 参考文献 -->
<div :ref="tabsList[0].refName" class="scroll-item"> <div :ref="tabsList[0].refName" class="scroll-item" >
<div class="bor_style_onli"> <div class="bor_style_onli">
<h4>{{ tabsList[0].name }}</h4> <h4>{{ tabsList[0].name }}</h4>
<div class="liter_ture" v-if="0 == 2"> <div class="liter_ture" v-if="0 == 2">
@@ -401,7 +404,8 @@ import { quillEditor } from 'vue-quill-editor';
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
import timetalk from './time_talk'; import timetalk from './time_talk';
export default { export default {
data() { props:['type'],
data() {
return { return {
feeStatus: null, feeStatus: null,
isShowCommit: false, isShowCommit: false,
@@ -452,7 +456,7 @@ export default {
// rongCont: 'Modify the article body.' // rongCont: 'Modify the article body.'
// }, // },
{ {
name: 'Html', name: 'Text Proofread',
refName: 'setTwoRef', refName: 'setTwoRef',
rongCont: 'HTML layout.' rongCont: 'HTML layout.'
} }
@@ -1668,12 +1672,11 @@ export default {
// 6----校对文章 // 6----校对文章
htmlContet() { htmlContet() {
this.$router.push({ window.open(this.$router.resolve({ path: '/GenerateCharts',
path: '/GenerateCharts',
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} } }).href, '_blank');
});
}, },
// 6----修改时间为年月日 // 6----修改时间为年月日

File diff suppressed because it is too large Load Diff

View File

@@ -103,7 +103,7 @@
<el-table-column type="index" label="No." width="55" align="center"></el-table-column> <el-table-column type="index" label="No." width="55" align="center"></el-table-column>
<el-table-column label="state" width="55" align="center"> <el-table-column label="state" width="55" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="status ok" v-if="scope.row.refer_type == 'journal' && scope.row.doilink != '' || scope.row.refer_type == 'book' && scope.row.isbn != '' || scope.row.refer_type == 'other' && scope.row.refer_frag != '' && scope.row.refer_frag.length > 15" > <span class="status ok" v-if="scope.row.refer_type == 'journal' && scope.row.doilink != '' || scope.row.refer_type == 'book' && scope.row.isbn != '' " >
<i class="el-icon-circle-check"></i> <i class="el-icon-circle-check"></i>
</span> </span>
<span class="status warn" v-else > <span class="status warn" v-else >

File diff suppressed because it is too large Load Diff

View File

@@ -56,8 +56,9 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="Major :" :required="true" prop="major_a"> <el-form-item label="Research areas :" prop="major">
<el-select <common-major-list :list="majorValueList" @load="(e)=>this.majorValueList=e"></common-major-list>
<!-- <el-select
v-model="form.major_a" v-model="form.major_a"
placeholder="Please select major" placeholder="Please select major"
@change="majorChange(1)" @change="majorChange(1)"
@@ -99,7 +100,7 @@
:label="item.major_title" :label="item.major_title"
:value="item.major_id" :value="item.major_id"
></el-option> ></el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
<el-form-item label="Manuscript Title :" prop="title"> <el-form-item label="Manuscript Title :" prop="title">
<el-input v-model="form.title" placeholder="Please enter title"></el-input> <el-input v-model="form.title" placeholder="Please enter title"></el-input>
@@ -966,6 +967,7 @@
export default { export default {
data() { data() {
return { return {
majorValueList:[],
baseUrl: this.Common.baseUrl, baseUrl: this.Common.baseUrl,
usercap: localStorage.getItem('U_role'), usercap: localStorage.getItem('U_role'),
ms_alias: localStorage.getItem('ms_journal_alias'), ms_alias: localStorage.getItem('ms_journal_alias'),
@@ -1194,11 +1196,21 @@ export default {
} }
], ],
major: [ major: [
{ {
required: true, required: true,
message: 'Please select major', validator: (rule, value, callback) => {
trigger: 'blur' 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 实例的数据,使用箭头函数保持上下文
// 其他逻辑
}
}
], ],
abstrart: [ abstrart: [
{ {
@@ -2598,7 +2610,11 @@ export default {
}, },
// 点击进行下一步 // 点击进行下一步
onStep(e) { onStep(e) {
console.log('this.majorValueList at line 2604:', this.majorValueList)
console.log('this.form at line 2622:', this.form)
this.$refs.articleform.validate((valid) => { this.$refs.articleform.validate((valid) => {
if (valid) { if (valid) {
if (e == 1) { if (e == 1) {
@@ -2617,7 +2633,13 @@ export default {
} }
} }
this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1); this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1);
this.form.major=this.majorValueList.map(item => item.selectedValue[item.selectedValue.length - 1]).toString(',')
if(this.form.major==''){
this.$message.error('Please select the Research areas')
return false
}
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => { this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.stagingID = res.data.article_id; this.stagingID = res.data.article_id;
this.form.article_id = res.data.article_id; this.form.article_id = res.data.article_id;
@@ -2702,8 +2724,15 @@ export default {
fstr += flist[fu].ke.trim() + ','; fstr += flist[fu].ke.trim() + ',';
} }
} }
console.log('this.form at line 2707:', this.form)
this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1); this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1);
this.form.major=this.majorValueList.map(item => item.selectedValue[item.selectedValue.length - 1]).toString(',')
if(this.form.major==''){
this.$message.error('Please select the Research areas')
return false
}
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => { this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.stagingID = res.data.article_id; this.stagingID = res.data.article_id;
this.form.article_id = res.data.article_id; this.form.article_id = res.data.article_id;
@@ -2840,44 +2869,48 @@ export default {
console.log(res.data.base); console.log(res.data.base);
// this.form.topics = res.data.base.topics // this.form.topics = res.data.base.topics
// 领域 // 领域
this.$api this.majorValueList = res.data.majors.map(item => ({
.post('api/Major/getMajorForAddArticle', {
journal_id: this.form.journal, selectedValue: Array.isArray(item.major) ? item.major : (typeof item.major === 'string' ? item.major.split(',').map(Number) : [item.major])
major_id: 1 })); console.log('this.majorValueList at line 2853:', this.majorValueList)
}) // this.$api
.then((res) => { // .post('api/Major/getMajorForAddArticle', {
this.majors_a = res.data.majors; // journal_id: this.form.journal,
}); // major_id: 1
this.form.major_a = res.data.major.major_id; // })
this.$api // .then((res) => {
.post('api/Major/getMajorForAddArticle', { // this.majors_a = res.data.majors;
journal_id: this.form.journal, // });
major_id: this.form.major_a // this.form.major_a = res.data.major.major_id;
}) // this.$api
.then((ref) => { // .post('api/Major/getMajorForAddArticle', {
this.majors_b = ref.data.majors; // journal_id: this.form.journal,
this.majors_c = []; // major_id: this.form.major_a
this.form.major_b = ''; // })
this.form.major_c = ''; // .then((ref) => {
this.majorChange_panduan(); // this.majors_b = ref.data.majors;
if (res.data.major.child != undefined) { // this.majors_c = [];
this.form.major_b = res.data.major.child.major_id; // this.form.major_b = '';
this.$api // this.form.major_c = '';
.post('api/Major/getMajorForAddArticle', { // this.majorChange_panduan();
journal_id: this.form.journal, // if (res.data.major.child != undefined) {
major_id: this.form.major_b // this.form.major_b = res.data.major.child.major_id;
}) // this.$api
.then((ref) => { // .post('api/Major/getMajorForAddArticle', {
this.majors_c = ref.data.majors; // journal_id: this.form.journal,
this.form.major_c = ''; // major_id: this.form.major_b
this.majorChange_panduan(); // })
if (res.data.major.child.child != undefined) { // .then((ref) => {
this.form.major_c = res.data.major.child.child.major_id; // this.majors_c = ref.data.majors;
this.majorChange_panduan(); // this.form.major_c = '';
} // this.majorChange_panduan();
}); // if (res.data.major.child.child != undefined) {
} // this.form.major_c = res.data.major.child.child.major_id;
}); // this.majorChange_panduan();
// }
// });
// }
// });
// 关键词 // 关键词
let keyList = res.data.base.keywords.split(','); let keyList = res.data.base.keywords.split(',');
this.keywordsList = []; this.keywordsList = [];

View File

@@ -57,7 +57,7 @@
<p v-if="form.special_num > 0"> <p v-if="form.special_num > 0">
<font>Special Issues :</font><b>{{ form.special_title }}</b> <font>Special Issues :</font><b>{{ form.special_title }}</b>
</p> </p>
<el-collapse class="auth_colla auth_collna_ew"> <el-collapse class="auth_colla auth_collna_ew">
<el-collapse-item :title="authorList_name" name="1"> <el-collapse-item :title="authorList_name" name="1">
<div v-for="(item, index) in form.authorList" class="auth_mess"> <div v-for="(item, index) in form.authorList" class="auth_mess">
@@ -108,6 +108,7 @@
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<el-collapse class="auth_colla auth_collna_ew" style="margin-top: -15px"> <el-collapse class="auth_colla auth_collna_ew" style="margin-top: -15px">
<el-collapse-item name="2"> <el-collapse-item name="2">
<template slot="title"> <template slot="title">
@@ -126,6 +127,42 @@
</p> </p>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<el-collapse class="auth_colla auth_collna_ew" style="margin-top: -15px;">
<el-collapse-item title="Research areas" name="1" >
<div style="position: relative;height: 30px;">
<common-major
:articleId="editform.articleId"
@load="initMajor()"
style="position: absolute; top: 10px; right: 10px"
></common-major>
</div>
<div style="margin: 12px 20px 30px 0px; line-height: 24px; font-size: 14px; position: relative">
<div>
<!-- 统计数据 -->
<div class="join_link">
<!-- 如果你想投稿 请点击 -->
<p style="" v-for="(v, i) in majorsList">
<span style="color: #006699; font-weight: bold; margin-right: 10px"
>Field {{ i + 1 }}:</span
>{{ v.str
}}<i
class="el-icon-delete-solid"
style="color: #f56c6c !important; margin-left: 10px"
@click="handleDeleteMajor(v)"
></i>
</p>
<!-- 查看已投稿件列表 -->
</div>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div> </div>
<div class="art_file_"> <div class="art_file_">
@@ -178,7 +215,7 @@
<h4>Manuscirpt :</h4> <h4>Manuscirpt :</h4>
<p class="fi_new"> <p class="fi_new">
<!-- <template v-for="item in manuscirptFileList"> --> <!-- <template v-for="item in manuscirptFileList"> -->
<!-- <a href="#"> <!-- <a href="#">
<img <img
src="../../assets/img/icon_0.png" src="../../assets/img/icon_0.png"
@click="openDrawer(item, mediaUrl + item.file_url)" @click="openDrawer(item, mediaUrl + item.file_url)"
@@ -193,14 +230,14 @@
<i class="el-icon-download download"></i> <i class="el-icon-download download"></i>
</a> </a>
</a> --> </a> -->
<a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url" > <a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url">
<img src="../../assets/img/icon_0.png" /> <img src="../../assets/img/icon_0.png" />
<span> <span>
<font>Uploader : </font>{{ form.username }} <font>Uploader : </font>{{ form.username }}
<i><i class="el-icon-time"></i>{{ formatDate(item.ctime) }}</i> <i><i class="el-icon-time"></i>{{ formatDate(item.ctime) }}</i>
</span> </span>
<i class="el-icon-download download"></i> <i class="el-icon-download download"></i>
</a> </a>
<!-- </template> --> <!-- </template> -->
</p> </p>
<br clear="both" /> <br clear="both" />
@@ -241,12 +278,8 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<common-word-html
:articleId="$route.query.id" <common-word-html :articleId="$route.query.id" style="box-sizing: border-box"></common-word-html>
style=" box-sizing: border-box"
></common-word-html>
</div> </div>
<!-- 被拒稿件操作 ---> <!-- 被拒稿件操作 --->
<div class="art_caozuo_" v-if="opname == 'rejectArticles'"> <div class="art_caozuo_" v-if="opname == 'rejectArticles'">
@@ -626,6 +659,7 @@ export default {
ad_content: '' ad_content: ''
}, },
talkMsgs: [], talkMsgs: [],
majorsList: [],
opname: '', // 稿件详细类型 opname: '', // 稿件详细类型
editorJournalList: [], // 编辑期刊列表 editorJournalList: [], // 编辑期刊列表
resubmitJournal: { resubmitJournal: {
@@ -805,7 +839,7 @@ export default {
}); });
}, },
openDrawer(data, url) { openDrawer(data, url) {
console.log('url at line 799:',data, url) console.log('url at line 799:', data, url);
this.previewData = { this.previewData = {
...data, ...data,
previewUrl: url, previewUrl: url,
@@ -899,7 +933,29 @@ export default {
return { status: status, msg: msg }; return { status: status, msg: msg };
}, },
handleDeleteMajor(v) {
console.log('v at line 925:', v);
this.$confirm('Are you sure you want to delete this Field ?', 'Tip', {
type: 'warning'
})
.then(() => {
this.$api
.post('api/Major/delMajorByArticleIdForEditor', {
mta_id: v.mta_id
})
.then((res) => {
if (res.code == 0) {
this.initMajor();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
})
.catch(() => {});
},
//修改文章状态 //修改文章状态
async saveEdit() { async saveEdit() {
if (this.form.state == 0) { if (this.form.state == 0) {
@@ -948,7 +1004,16 @@ export default {
this.$router.go(0); this.$router.go(0);
}); });
}, },
initMajor() {
this.$api
.post('api/Major/getMajorByArticleId', {
article_id: this.editform.articleId
})
.then((res) => {
console.log('res at line 978:', res);
this.majorsList = res.data.majors;
});
},
//初始化期刊信息 //初始化期刊信息
initarticle() { initarticle() {
this.now_year = new Date().getFullYear(); this.now_year = new Date().getFullYear();
@@ -957,7 +1022,9 @@ export default {
articleId: this.editform.articleId, articleId: this.editform.articleId,
human: 'editor' human: 'editor'
}) })
.then((res) => { .then((res) => {
this.initMajor();
this.form.username = res.article.account; this.form.username = res.article.account;
this.form.title = res.article.title; this.form.title = res.article.title;
this.form.journal = res.article.journal_id; this.form.journal = res.article.journal_id;

View File

@@ -961,7 +961,7 @@
" "
> >
<el-button type="primary" @click="saveUserIndex(userIndexForm)" style="float: right">{{ $t('citeList.save') }}</el-button> <el-button type="primary" @click="saveUserIndex(userIndexForm)" style="float: right">{{ $t('citeList.save') }}</el-button>
<el-button style="float: right; margin-right: 20px">{{ $t('citeList.cancel') }}</el-button> <el-button style="float: right; margin-right: 20px" @click="aiSorbox=false">{{ $t('citeList.cancel') }}</el-button>
</div> </div>
</el-drawer> </el-drawer>

View File

@@ -420,11 +420,13 @@
<!-- 参考文献 --> <!-- 参考文献 -->
<div :ref="tabsList[3].refName" class="scroll-item"> <div :ref="tabsList[3].refName" class="scroll-item">
<div class="bor_style_onli">
<div class="bor_style_onli">
<h4>{{tabsList[3].name}}</h4> <h4>{{tabsList[3].name}}</h4>
<div class="liter_ture"> <PreIngestedEditorProduce type="produce" v-if="detailMes.article_id&&p_article_id" :article_id="detailMes.article_id" :p_article_id="p_article_id"></PreIngestedEditorProduce>
<!--<div class="liter_ture">
<div class="chanSelLef"> <div class="chanSelLef">
<!-- 1 -->
<div :class="showB_step ==1?'C_style':''"> <div :class="showB_step ==1?'C_style':''">
<h3><span>1</span>Check References and Doi</h3> <h3><span>1</span>Check References and Doi</h3>
<div v-if="showB_step ==1"> <div v-if="showB_step ==1">
@@ -454,7 +456,7 @@
</div> </div>
</div> </div>
<!-- 2 -->
<div :class="showB_step ==2?'C_style':''"> <div :class="showB_step ==2?'C_style':''">
<h3><span>2</span>Check Standard</h3> <h3><span>2</span>Check Standard</h3>
<div v-if="showB_step ==2"> <div v-if="showB_step ==2">
@@ -532,8 +534,7 @@
</div> </div>
</div> </div>
<br clear="both"> <br clear="both">
<!-- <p v-if="this.chanFerForm==''" style="text-align: center;color: #999;margin-top: 50px;">No references</p> -->
<!-- 进度条 -->
<div v-if="refProcess==1" class="RefProBar"> <div v-if="refProcess==1" class="RefProBar">
<div> <div>
<el-progress :text-inside="true" :stroke-width="24" :percentage="refReal" <el-progress :text-inside="true" :stroke-width="24" :percentage="refReal"
@@ -544,7 +545,7 @@
</p> </p>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
@@ -828,12 +829,15 @@
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import { import {
quillEditor quillEditor
} from 'vue-quill-editor'; } from 'vue-quill-editor';
import { import {
Loading Loading
} from 'element-ui'; } from 'element-ui';
import PreIngestedEditorProduce from './PreIngestedEditorProduce.vue'
export default { export default {
data() { data() {
return { return {
@@ -2738,7 +2742,7 @@
}, },
}, },
components: { components: {
quillEditor quillEditor,PreIngestedEditorProduce
}, },
} }
</script> </script>

View File

@@ -197,7 +197,7 @@ export default {
getDate() {console.log('at line 189:',localStorage.getItem('U_pointJour') ) getDate() {console.log('at line 189:',localStorage.getItem('U_pointJour') )
this.$api this.$api
.post('api/Article/getJournal', { .post('api/Article/getJournal', {
// username: this.query.username username: this.query.username
}) })
.then((res) => { .then((res) => {
this.jourList = res; this.jourList = res;

View File

@@ -50,14 +50,14 @@
<p v-html="scope.row.title"></p> <p v-html="scope.row.title"></p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Cite" width="100px" align="center"> <el-table-column label="Cite" width="80px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<p style="cursor: pointer; color: #006699 !important" @click="goCite(scope.row)"> <p style="cursor: pointer; color: #006699 !important" @click="goCite(scope.row)">
{{ scope.row.cite_num ? scope.row.cite_num.length : 0 }} {{ scope.row.cite_num ? scope.row.cite_num.length : 0 }}
<span style="margin-left: 4px; cursor: pointer; color: #006699 !important; font-weight: bold"> <!-- <span style="margin-left: 4px; cursor: pointer; color: #006699 !important; font-weight: bold">
<i class="el-icon-edit"></i> <i class="el-icon-edit"></i>
</span> </span> -->
</p> </p>
</template> </template>
</el-table-column> </el-table-column>
@@ -80,14 +80,37 @@
<p v-html="scope.row.sort"></p> <p v-html="scope.row.sort"></p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="" width="190px" align="center"> <el-table-column label="" width="220px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="EditDetail(scope.row)"> Edit</el-button> <p style="display: flex; align-items: center; justify-content: space-around">
<el-button size="mini" type="primary" plain icon="el-icon-notebook-2" @click="htmlContet(scope.row)"> Html</el-button> <el-button
<p style="margin-top: 10px"> size="small"
<el-button size="mini" type="primary" plain icon="el-icon-tickets" @click="ChoseRelated(scope.row)"> type="primary"
Relevant</el-button plain
@click="EditDetail(scope.row)"
style="padding: 4px 10px !important; float: left"
> >
<i class="el-icon-edit"></i> Edit</el-button
>
 <el-dropdown :hide-on-click="false" style="">
 
<span class="el-dropdown-link">     More operations<i class="el-icon-arrow-down el-icon--right"></i>   </span>  
<el-dropdown-menu slot="dropdown">
   
<el-dropdown-item
><p @click="htmlContet(scope.row)"><i class="el-icon-notebook-2"></i>Html</p></el-dropdown-item
>
       
<el-dropdown-item divided
><p @click="goCite(scope.row)"><i class="el-icon-edit"></i>Cite</p>
</el-dropdown-item>
   
<el-dropdown-item divided>
<p @click="ChoseRelated(scope.row)"><i class="el-icon-tickets"></i>Relevant</p>
</el-dropdown-item>
 
</el-dropdown-menu>
</el-dropdown>
</p> </p>
</template> </template>
</el-table-column> </el-table-column>
@@ -281,12 +304,12 @@
<span style="margin-left: 15px; color: #0b4b6a" v-if="mains != ''">Typesetting completed</span> <span style="margin-left: 15px; color: #0b4b6a" v-if="mains != ''">Typesetting completed</span>
<template v-if="mains != ''"> <template v-if="mains != ''">
<el-button <el-button
v-if="html_type == 2&&tg_article_id!=0" v-if="html_type == 2 && tg_article_id != 0"
type="primary" type="primary"
plain plain
icon="el-icon-document-copy" icon="el-icon-document-copy"
@click.stop @click.stop
@click=" htmlLayout2()" @click="htmlLayout2()"
style="margin-left: 20px" style="margin-left: 20px"
> >
<font>Edit Html Proofread</font> <font>Edit Html Proofread</font>
@@ -367,10 +390,12 @@
</div> </div>
<div class="titHtml titHtml1" v-if="htmlContent && html_type == 2"> <div class="titHtml titHtml1" v-if="htmlContent && html_type == 2">
<common-word <common-word
:readonly="true" :isPreview="true"
v-if="htmlContent" v-if="htmlContent"
ref="commonWord" ref="commonWord"
:value="htmlContent" :value="htmlContent"
:contentList="mains"
:wordStyle="wordStyle" :wordStyle="wordStyle"
style="width: calc(100%); height: 50vh" style="width: calc(100%); height: 50vh"
:style="`100%`" :style="`100%`"
@@ -410,24 +435,24 @@
<el-table-column type="index" align="center" width="50"> </el-table-column> <el-table-column type="index" align="center" width="50"> </el-table-column>
<el-table-column label="CONTENT" align="center"> <el-table-column label="CONTENT" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<p class="wrongLine" style="text-align: left" v-if="scope.row.author == ''"> <p class="wrongLine" style="text-align: left" v-if="scope.row.author == ''">
{{ scope.row.refer_frag }} {{ scope.row.refer_frag }}
</p> </p>
<div v-else> <div v-else>
<div style="text-align: left" v-if="scope.row.refer_type == 'journal'"> <div style="text-align: left" v-if="scope.row.refer_type == 'journal'">
<p> <p>
{{ scope.row.author }},{{ scope.row.title }}, <em>{{ scope.row.joura }}</em> ,{{ {{ scope.row.author }},{{ scope.row.title }}, <em>{{ scope.row.joura }}</em> ,{{
scope.row.dateno scope.row.dateno
}}<br /> }}<br />
</p> </p>
<a class="doiLink" :href="scope.row.doilink" target="_blank">{{ scope.row.doilink }}</a> <a class="doiLink" :href="scope.row.doilink" target="_blank">{{ scope.row.doilink }}</a>
</div>
<div style="text-align: left" v-if="scope.row.refer_type == 'book'">
<p>{{ scope.row.author }},{{ scope.row.title }},{{ scope.row.dateno }}<br /></p>
<a class="doiLink" :href="scope.row.isbn" target="_blank">{{ scope.row.isbn }}</a>
</div>
</div> </div>
<div style="text-align: left" v-if="scope.row.refer_type == 'book'"> </template>
<p>{{ scope.row.author }},{{ scope.row.title }},{{ scope.row.dateno }}<br /></p>
<a class="doiLink" :href="scope.row.isbn" target="_blank">{{ scope.row.isbn }}</a>
</div>
</div>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@@ -1001,104 +1026,71 @@ export default {
}); });
}, },
getWord() { getWord() {
var htmlContent = ``; // var htmlContent = ``;
htmlContent += this.mains // htmlContent += this.mains
.map((item) => { // .map((item) => {
//批注 // //批注
let contentHtml = ''; // let contentHtml = '';
var isRemark = ``; // var isRemark = ``;
// 判断是否是图片 // // 判断是否是图片
if (item.type == 1) { // if (item.type == 1) {
var extension = item.image.url.split('.').pop().toLowerCase(); // contentHtml = `
if (extension == 'tif') { // <p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
contentHtml = ` // item.ami_id
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${item.ami_id}" main-id="${ // }" main-id="${item.am_id}">
item.am_id // ${isRemark}
}"> // <img src="${this.mediaUrl +'articleImage/'+ item.image.url}" style="width: ${
<img src="" data-img-id="${item.ami_id}" style="width: ${item.width ? `${item.width}px` : '100%'}" /> // item.width ? `${item.width}px` : '100%'
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}">${item.image.note ? item.image.note : ''}</font> // }" />
</p> // <font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
`; // item.image.note ? item.image.note : ''
} else if (['jpg', 'jpeg', 'png'].includes(extension)) { // }</font>
contentHtml = ` // </p>
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${ // `;
item.ami_id // } else if (item.type == 2) {
}" main-id="${item.am_id}"> // var tableList = JSON.parse(item.table.table_data);
${isRemark}
<img src="${this.mediaUrl + item.image.url}" style="width: ${
item.width ? `${item.width}px` : '100%'
}" />
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
item.image.note ? item.image.note : ''
}</font>
</p>
`;
} else {
contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
item.ami_id
}" main-id="${item.am_id}">
${isRemark}
<span
style="
text-align: center;
font-size: 30px;
display: flex;
align-items: center;
justify-content: center;
"
>
Figures ( .${item.image.url.split('.').pop().toUpperCase()})
</span>
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${ // contentHtml = `
item.image.note ? item.image.note : '' // <div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
}</font> // item.am_id
</p> // }" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;">
`; // ${isRemark}
} // <font class="font tableTitle" style="width:100%" >${item.table.title ? item.table.title : ''}</font>
} else if (item.type == 2) { // <table border="1" style="width: auto; border-collapse: collapse; text-align: center; ">
var tableList = JSON.parse(item.table.table_data); // ${tableList
// .map((row) => {
// return `
// <tr>
// ${row
// .map((cell) => {
// return `
// <td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
// <span>${cell.text || ''}</span>
// </td>
// `;
// })
// .join('')} <!-- join the cells in the row -->
// </tr>
// `;
// })
// .join('')} <!-- join the rows -->
// </table>
// <font class="font" style="width:100%" >${item.table.note ? item.table.note : ''}</font>
// </div>
// `;
// } else {
// contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
// }
contentHtml = ` // // 判断是否是表格类型
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
item.am_id
}" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;">
${isRemark}
<font class="font tableTitle" style="width:100%" >${item.table.title ? item.table.title : ''}</font>
<table border="1" style="width: auto; border-collapse: collapse; text-align: center; ">
${tableList
.map((row) => {
return `
<tr>
${row
.map((cell) => {
return `
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
<span>${cell.text || ''}</span>
</td>
`;
})
.join('')} <!-- join the cells in the row -->
</tr>
`;
})
.join('')} <!-- join the rows -->
</table>
<font class="font" style="width:100%" >${item.table.note ? item.table.note : ''}</font>
</div>
`;
} else {
contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
}
// 判断是否是表格类型 // return contentHtml;
// })
return contentHtml; // .join('');
}) this.htmlContent = 'true';
.join('');
this.htmlContent = htmlContent;
}, },
getMainsInfo2(e) { getMainsInfo2(e) {
this.loadHtml = true; this.loadHtml = true;
@@ -1109,11 +1101,12 @@ export default {
.then((res) => { .then((res) => {
this.loadHtml = false; this.loadHtml = false;
if (res.code == 0) { if (res.code == 0) {
// console.log(res,'res') console.log(res,'res')
this.mains = ''; this.mains = '';
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.mains = res.data.list; this.mains = res.data.list;
console.log('this.mains at line 1108:', this.mains)
this.getWord(); this.getWord();
} else { } else {
this.mains = ''; this.mains = '';
@@ -1156,37 +1149,42 @@ export default {
}, },
// 文章html弹出层 // 文章html弹出层
async htmlContet(e) { async htmlContet(e) {
console.log('e at line 1151:', e)
this.htmlContent=''
this.articleId = e.article_id; this.articleId = e.article_id;
this.tg_article_id = e.tg_article_id; this.tg_article_id = e.tg_article_id;
// this.articleId = '3444';
this.UpHtpFIle.article_id = e.article_id; this.UpHtpFIle.article_id = e.article_id;
this.refersList = await this.getRefersList(); this.refersList = await this.getRefersList();
// this.UpHtpFIle.refers = e.refers
this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.p_article_id = e.p_article_id;
this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.doi = e.doi;
this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.htmlfile = e.file_html;
this.UpHtpFIle.title = e.title; this.UpHtpFIle.title = e.title;
this.UpHtpFIle.mains = e.mains; this.UpHtpFIle.mains = e.mains;
this.UpLoadFile.article_id = e.article_id; this.UpLoadFile.article_id = e.article_id;
this.html_type = e.html_type; await this.$api
// this.html_type = 2; .post('api/Publish/getPublishArticleDetail', {
article_id: e.article_id
if (this.html_type == 2) { })
if (e.has_html == 1) { .then(async (res) => {
await this.getMainsInfo2(); if (res.code == 0) {
console.log('res.code at line 1148:', res.code);
this.HtmlVisible = true; this.html_type = res.data.detail.html_type;
} else { if (this.html_type == 2) {
this.mains = ''; if ( res.data.detail.has_html == 1) {
this.HtmlVisible = true; await this.getMainsInfo2();
} this.HtmlVisible = true;
} else { } else {
await this.getMainsInfo(e); this.mains = '';
this.HtmlVisible = true; this.HtmlVisible = true;
} }
} else {
await this.getMainsInfo(e);
this.HtmlVisible = true;
}
}
});
}, },
// 生成html // 生成html
// CreateHtml(){ // CreateHtml(){
// const loading = this.$loading({ // const loading = this.$loading({
@@ -1206,6 +1204,7 @@ export default {
// this.htmlLayout() // this.htmlLayout()
// } // }
// }) // })
// }, // },
// 修改文章html // 修改文章html
async htmlLayout2(type) { async htmlLayout2(type) {
@@ -1217,16 +1216,21 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
await this.creatMains(); await this.creatMains();
this.html_type = 2;
await this.getMainsInfo2(); await this.getMainsInfo2();
loading.close(); loading.close();
} else { } else {
this.HtmlVisible = false; this.HtmlVisible = false;
this.$router.push({ window.open(this.$router.resolve({ path: '/GenerateCharts',
path: '/GenerateCharts', query: {
query: { id: this.tg_article_id
id: this.tg_article_id } }).href, '_blank');
} // this.$router.push({
}); // path: '/GenerateCharts',
// query: {
// id: this.tg_article_id
// }
// });
} }
}, },
htmlLayout() { htmlLayout() {

File diff suppressed because it is too large Load Diff

View File

@@ -1022,13 +1022,14 @@ export default {
str = 'With reviewer'; str = 'With reviewer';
break; break;
case 1: case 1:
str = 'Revision'; str = 'Major';
break; break;
case 2: case 2:
str = 'Reject'; str = 'Reject';
break; break;
case 3: case 3:
str = 'Accept'; // str = 'Accept';
str = 'Minor';
break; break;
} }
return str; return str;

View File

@@ -0,0 +1,299 @@
<template>
<div style="height: 98%;">
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item> <i class="el-icon-document-copy"></i> Artcile Html
<el-button size="mini" style="position: absolute;right: 40px;" @click="goEdit">Edit</el-button>
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="container" style="height: 97%; min-width: 1000px; background-color: #fafafa; padding: 10px 0 0 0">
<common-word
:readonly="true"
v-if="htmlContent"
ref="commonWord"
:value="htmlContent"
:wordStyle="wordStyle"
style="width: calc(100%); height: calc(100%); "
:style="`100%`"
></common-word>
</div>
</div>
</template>
<script>
import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑
export default {
data() {
return {
wordStyle: `
p {
position: relative;
padding: 8px 15px;
min-height: 22px;
border: 2px dashed #fff;
border-radius: 5px;
color: #606266;
}
p {
font-size: 14px;
line-height: 22px;
}
.imgBox .chNumer {
position: absolute;
top: -2px;
right: -1px;
border-radius: 3px;
font-size: 10px;
background-color: rgb(0 102 153 / 85%);
color: #fff;
padding: 0 6px;
}
.MaxPicture {
text-align: center;
}
.MaxPicture > img {
margin-bottom: 10px;
}
.font {
display: block;
margin: 0 auto;
font-size: 13px;
}
.tableTitle{
text-align:center!important;
font-weight: bold;
}
`,
detailMes: {},
baseUrl: this.Common.baseUrl,
mediaUrl: mediaUrl, //
Art_Id: this.$route.query.id,
Art_Doi: this.$route.query.doi,
Art_web_Id: this.$route.query.artID,
Art_P_Id: '',
btnDisble: true,
detailTitle: '',
htmlContent: '',
Main_List: [],
exegesis: "The following contents'<b></b>,<i></i>'are necessary for the generation phase, please do not delete them!!!"
};
},
created() {
this.getInfo();
},
activated() {
this.getInfo();
},
methods: {
goEdit(){
this.$router.push({
path: '/GenerateCharts',
query: {
id: this.Art_Id
}
});
},
async getInfo() {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// 获取文章信息
await this.$api
.post('api/Production/getProductionDetail', { p_article_id: this.Art_Id })
.then(async (res) => {
if (res.code == 0) {
this.detailTitle = res.data.production.title
this.detailMes = res.data.production;
await this.getDate(loading);
loading.close();
} else {
this.$message.error(res.msg);
loading.close();
}
})
.catch((err) => {
this.$message.error(err);
loading.close();
});
},
getWord() {
var htmlContent = `<h3 class="man_Title" contenteditable="false">${this.detailTitle} </h3>`;
htmlContent += this.Main_List.map((item) => {
//批注
let contentHtml = '';
var isRemark = ``;
// if (item.state == 2 && item.remark && item.remark != '') {
// // isRemark = `<img class="isRemark" main-id="${item.am_id}" src="${this.remarkImageUrl}" alt="" style="width:20px;height:20px;"/>`;
// isRemark = `<span class="isRemark" main-id="${item.am_id}"><img class="isRemarkIcon" main-id="${item.am_id}" src="${this.remarkImageUrl}" alt="" style="width: 20px; height: 20px" />
// <span class="isRemarkIcon" main-id="${item.am_id}" > (${item.am_id})</span>
// </span>
// `;
// }
// 判断是否是图片
if (item.type == 1) {
var extension = item.image.url.split('.').pop().toLowerCase();
if (extension == 'tif') {
contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${item.ami_id}" main-id="${
item.am_id
}">
<img src="" data-img-id="${item.ami_id}" style="width: ${item.width ? `${item.width}px` : '100%'}" />
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}">${item.image.note ? item.image.note : ''}</font>
</p>
`;
} else if (['jpg', 'jpeg', 'png'].includes(extension)) {
contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
item.ami_id
}" main-id="${item.am_id}">
${isRemark}
<img src="${this.mediaUrl + item.image.url}" style="width: ${
item.width ? `${item.width}px` : '100%'
}" />
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
item.image.note ? item.image.note : ''
}</font>
</p>
`;
} else {
contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
item.ami_id
}" main-id="${item.am_id}">
${isRemark}
<span
style="
text-align: center;
font-size: 30px;
display: flex;
align-items: center;
justify-content: center;
"
>
Figures ( .${item.image.url.split('.').pop().toUpperCase()})
</span>
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
item.image.note ? item.image.note : ''
}</font>
</p>
`;
}
} else if (item.type == 2) {
var tableList = JSON.parse(item.table.table_data);
contentHtml = `
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
item.am_id
}" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;">
${isRemark}
<font class="font tableTitle" style="width:100%" >${item.table.title ? item.table.title : ''}</font>
<table border="1" style="width: auto; border-collapse: collapse; text-align: center; ">
${tableList
.map((row) => {
return `
<tr>
${row
.map((cell) => {
return `
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
<span>${cell.text || ''}</span>
</td>
`;
})
.join('')} <!-- join the cells in the row -->
</tr>
`;
})
.join('')} <!-- join the rows -->
</table>
<font class="font" style="width:100%" >${item.table.note ? item.table.note : ''}</font>
</div>
`;
} else {
contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
}
// 判断是否是表格类型
return contentHtml;
}).join('');
this.htmlContent = htmlContent;
},
async getDate(loading) {
let urlLInk = '';
let urlTask = {};
if (this.Art_Id != undefined) {
urlLInk = 'api/Preaccept/getArticleMains';
urlTask.article_id = this.detailMes.article_id;
}
// 获取文章信息
await this.$api
.post(urlLInk, urlTask)
.then(async (res) => {
if (res.code == 0) {
this.Main_List = res.data.list;
// this.detailTitle = res.data.production.title
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;
}
// setTimeout(async () => {
this.$nextTick(async () => {
await this.getWord();
loading.close();
});
loading.close();
} else {
this.$message.error(res.msg);
loading.close();
}
})
.catch((err) => {
this.$message.error(err);
loading.close();
});
}
}
};
</script>
<style scoped>
.man_Title {
background-color: #fff;
margin: 0 0 10px 0;
border-bottom: 1px solid #dde1eb;
box-shadow: 0 5px 5px -2px rgb(134 134 134);
padding: 12px 25px 8px 25px;
font-size: 16px;
line-height: 24px;
color: #333;
position: relative;
}
.man_Title button {
position: absolute;
top: 10px;
right: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -68,9 +68,7 @@ const tableStyle = ` b span{
border-top:none;mso-border-top-alt:none !important; border-top:none;mso-border-top-alt:none !important;
border-bottom:none !important; border-bottom:none !important;
mso-border-bottom-alt:none !important; mso-border-bottom-alt:none !important;
border:1px dashed #dcdfe6 !important;
border-left:1px dashed #dcdfe6 !important;
border-right:1px dashed #dcdfe6 !important;
word-break: keep-all !important; word-break: keep-all !important;
text-align: justify !important; // 设置两端对齐 text-align: justify !important; // 设置两端对齐

View File

@@ -72,7 +72,7 @@ const tableStyle = ` b span{
border-left:1px dashed #dcdfe6 !important; border-left:1px dashed #dcdfe6 !important;
border-right:1px dashed #dcdfe6 !important; border-right:1px dashed #dcdfe6 !important;
word-break: keep-all !important; word-break: keep-all !important;
text-align: justify !important; // 设置两端对齐 // text-align: justify !important; // 设置两端对齐
} }
@@ -107,10 +107,17 @@ const tableStyle = ` b span{
table tr:first-child td { table tr:first-child td {
border-top:1.0000pt solid #000 !important;mso-border-top-alt:0.5000pt solid #000 !important;border-bottom:1.0000pt solid #000 !important;mso-border-bottom-alt:0.5000pt solid #000 !important; border-top:1.0000pt solid #000 !important;mso-border-top-alt:0.5000pt solid #000 !important;border-bottom:1.0000pt solid #000 !important;mso-border-bottom-alt:0.5000pt solid #000 !important;
} }
table tr:last-of-type td { table tr:last-of-type {
border-bottom:1.0000pt solid #000 !important;mso-border-bottom-alt:0.5000pt solid #000 !important;; border-bottom:1.0000pt solid #000 !important;mso-border-bottom-alt:0.5000pt solid #000 !important;;
} }
table span blue {
color: rgb(0, 130, 170) !important;
}blue {
color: rgb(0, 130, 170) !important;
}
.wordTableHtml table tr.table-header-row:nth-of-type(2) td {
border-bottom: 1px solid #000 !important;
}
`; `;
export default { export default {
@@ -133,11 +140,7 @@ export default {
}, },
isEdit: {}, isEdit: {},
toolbar: { toolbar: {
type: Array, required: false
required: false,
default() {
return [];
}
}, },
menubar: { menubar: {
default: 'file edit insert view format table ' default: 'file edit insert view format table '
@@ -154,6 +157,10 @@ export default {
}, },
isShowArtWorkButton: { isShowArtWorkButton: {
default: false default: false
},
wordStyle: {
type: String,
default: ''
} }
}, },
data() { data() {
@@ -262,9 +269,11 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
initTinymce() { initTinymce() {
const _this = this; var _this = this;
window.tinymce.init({ window.tinymce.init({
inline: false, // 使用 iframe 模式
selector: `#${this.tinymceId}`, selector: `#${this.tinymceId}`,
content_css: false, // 禁用默认样式 content_css: false, // 禁用默认样式
table_resize_bars: true, // 启用拖动调整功能 table_resize_bars: true, // 启用拖动调整功能
@@ -329,17 +338,19 @@ export default {
} }
}, },
content_style: `${tableStyle} table span blue { content_style: `
color: rgb(0, 130, 170) !important; ${tableStyle}
}blue { ${_this.wordStyle}
color: rgb(0, 130, 170) !important;
}`,
`,
formats: { formats: {
bold: { inline: 'b' }, bold: { inline: 'b' },
italic: { inline: 'i' } italic: { inline: 'i' }
}, },
body_class: 'panel-body ', body_class: 'panel-body ',
object_resizing: false, object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar, toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
@@ -347,112 +358,20 @@ export default {
statusbar: false, // 关闭底部状态栏 statusbar: false, // 关闭底部状态栏
custom_colors: false, custom_colors: false,
color_map: ['0082AA', 'TMR Blue'], color_map: ['0082AA', 'TMR Blue'],
plugins: 'forecolor code paste table image', // 启用 forecolor 和 code 插件
plugins: 'texttransform', // 启用 forecolor 和 code 插件
// plugins: 'forecolor code paste table image mathType searchreplace raw', // 启用 forecolor 和 code 插件
end_container_on_empty_block: true, end_container_on_empty_block: true,
content_css: 'default', // 加载 TinyMCE 默认样式表 content_css: 'default', // 加载 TinyMCE 默认样式表
mathjax: {
// 配置 MathJax 用于渲染数学公式
path: 'https://cdn.mathjax.org/mathjax/latest/MathJax.js',
config: 'TeX-AMS-MML_HTMLorMML'
},
//设置自定义按钮 myCustomToolbarButton //设置自定义按钮 myCustomToolbarButton
setup(ed) { setup(ed) {
// ed.on('change', function () { _this.$commonJS.initEditorButton(_this, ed);
// var selectedColor = ed.formatter.get('forecolor');
// console.log('ed.formatter.get at line 355:', ed.formatter)
// console.log('ed.formatter.get at line 355:', selectedColor)
// // 检查是否选择了蓝色
// if (selectedColor === '#0082AA') {
// // 蓝色的 hex 值
// var selectedText = ed.selection.getContent(); // 获取选中的文本
// if (selectedText) {
// var wrappedText = `<blue>${selectedText}</blue>`; // 包裹 <blue> 标签
// ed.selection.setContent(wrappedText); // 更新内容
// }
// }
// });
ed.ui.registry.addButton('customBlue', {
text: 'Blue', // 按钮文本
onAction: function () {
// 在选中的文本周围包裹 <blue> 标签
var selectedText = ed.selection.getContent();
var wrappedText = `<blue>${selectedText}</blue>`;
ed.selection.setContent(wrappedText);
},
classes: 'custom-colored-tinymce-button'
});
ed.ui.registry.addButton('removeBlue', {
text: 'Remove Blue', // 按钮文本
onAction: function () {
const range = ed.selection.getRng(); // 获取选区范围
let startNode = range.startContainer; // 获取选区起始节点
let closestBlue = null;
// 向上查找最近的 <blue> 标签
while (startNode) {
if (startNode.nodeName && startNode.nodeName.toLowerCase() === 'blue') {
closestBlue = startNode;
break;
}
startNode = startNode.parentNode;
}
if (closestBlue) {
// 如果找到最近的 <blue> 标签,移除它的外层标签,但保留内容
const parent = closestBlue.parentNode;
while (closestBlue.firstChild) {
parent.insertBefore(closestBlue.firstChild, closestBlue);
}
parent.removeChild(closestBlue);
} else {
// 未找到 <blue> 标签,仅移除选中的 <blue> 标签内容
const selectedContent = ed.selection.getContent({ format: 'html' });
// 使用正则表达式移除选区中的 <blue> 标签
const cleanedContent = selectedContent
.replace(/<blue[^>]*>/g, '') // 删除起始标签 <blue>
.replace(/<\/blue>/g, ''); // 删除结束标签 </blue>
// 更新选中的内容
ed.selection.setContent(cleanedContent);
}
}
});
ed.ui.registry.addToggleButton('toggleBlue', {
text: 'Toggle Blue', // 按钮文本
onAction: function () {
var selectedContent = ed.selection.getContent({ format: 'html' }); // 获取选中内容HTML 格式)
// 创建临时 DOM 容器
var tempDiv = document.createElement('div');
tempDiv.innerHTML = selectedContent;
// 检查是否完全被 <blue> 包裹
if (tempDiv.childNodes.length === 1 && tempDiv.firstChild.nodeName.toLowerCase() === 'blue') {
// 移除 <blue> 标签
var unwrappedContent = tempDiv.firstChild.innerHTML;
ed.selection.setContent(unwrappedContent); // 更新内容
} else {
// 添加 <blue> 标签
var wrappedContent = `<blue>${selectedContent}</blue>`;
ed.selection.setContent(wrappedContent); // 更新内容
}
},
onSetup: function (buttonApi) {
// 更新按钮状态(激活或非激活)
function updateButtonState() {
var selectedContent = ed.selection.getContent({ format: 'html' });
var tempDiv = document.createElement('div');
tempDiv.innerHTML = selectedContent;
buttonApi.setActive(
tempDiv.childNodes.length === 1 && tempDiv.firstChild.nodeName.toLowerCase() === 'blue'
);
}
// 监听编辑器中的选区变化
ed.on('NodeChange', updateButtonState);
ed.on('KeyUp', updateButtonState); // 处理键盘操作导致的内容变化
}
});
ed.ui.registry.addButton('uploadWord', { ed.ui.registry.addButton('uploadWord', {
text: 'Word', text: 'Word',
icon: 'import-word', // 使用自定义图标 icon: 'import-word', // 使用自定义图标
@@ -478,47 +397,51 @@ export default {
} }
}); });
ed.ui.registry.addMenuButton('customDropdown', { // ed.ui.registry.addMenuButton('customDropdown', {
text: _this.$t('commonTable.PaperRotation'), // 下拉框标题 // text: _this.$t('commonTable.PaperRotation'), // 下拉框标题
fetch: function (callback) { // fetch: function (callback) {
// 定义下拉框的内容 // // 定义下拉框的内容
const items = [..._this.typesettingTypeOptions]; // const items = [..._this.typesettingTypeOptions];
const menuItems = items.map((item) => ({ // const menuItems = items.map((item) => ({
type: 'menuitem', // type: 'menuitem',
text: item.label, // text: item.label,
onAction: function () { // onAction: function () {
_this.typesettingType = item.value; // _this.typesettingType = item.value;
_this.changeTable(); // _this.changeTable();
// ed.execCommand(item.value); // 执行命令 // // ed.execCommand(item.value); // 执行命令
} // }
})); // }));
callback(menuItems); // callback(menuItems);
} // }
}); // });
ed.on('init', function () { ed.on('init', function () {
_this.$commonJS.inTinymceButtonClass();
const editorBody = ed.getBody(); const editorBody = ed.getBody();
// 创建 MutationObserver 监听内容变化 // 创建 MutationObserver 监听内容变化
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
const currentContent = ed.getContent(); const currentContent = ed.getContent();
if (_this.isAutomaticUpdate) { if (_this.isAutomaticUpdate) {
_this.$emit('updateChange', ed.getContent());
// _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent));
_this.$emit('updateChange',currentContent);
} }
}); });
// 监听子节点和内容的变化 // 监听子节点和内容的变化
observer.observe(editorBody, { childList: true, subtree: true, characterData: true }); observer.observe(editorBody, { childList: true, subtree: true, characterData: true });
}); });
// 定义自定义按钮 // // 定义自定义按钮
ed.ui.registry.addButton('clearButton', { // ed.ui.registry.addButton('clearButton', {
text: 'Empty', // text: 'Empty',
onAction: () => { // onAction: () => {
// 插入自定义表格到编辑器中 // // 插入自定义表格到编辑器中
ed.setContent(''); // ed.setContent('');
} // }
}); // });
// 定义自定义按钮 // 定义自定义按钮
ed.ui.registry.addButton('customButtonExportWord', { ed.ui.registry.addButton('customButtonExportWord', {
@@ -590,13 +513,16 @@ export default {
window.tinymce.get(this.tinymceId).setContent(value); window.tinymce.get(this.tinymceId).setContent(value);
}, },
//获取内容 //获取内容
getContent(type) { async getContent(type) {
var content = window.tinymce.get(this.tinymceId).getContent(); var content = window.tinymce.get(this.tinymceId).getContent();
content = content.replace(/<span[^>]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签
content = content.replace(/<strong>/g, '<b>').replace(/<\/strong>/g, '</b>'); content = content.replace(/<strong>/g, '<b>').replace(/<\/strong>/g, '</b>');
content = content.replace(/<em>/g, '<i>').replace(/<\/em>/g, '</i>'); content = content.replace(/<em>/g, '<i>').replace(/<\/em>/g, '</i>');
content = content.replace(/&nbsp;/g, ' '); // 将所有 &nbsp; 替换为空格 content = content.replace(/&nbsp;/g, ' '); // 将所有 &nbsp; 替换为空格
this.$emit('getContent', type, content); this.$emit('getContent', type, content);
console.log('window.tinymce.get(this.tinymceId).getContent() at line 431:', content);
}, },
async export(type, data) { async export(type, data) {

View File

@@ -131,10 +131,12 @@
</div> </div>
<div class="titHtml titHtml1" v-if="htmlContent && html_type == 2"> <div class="titHtml titHtml1" v-if="htmlContent && html_type == 2">
<common-word <common-word
:readonly="true" :isPreview="true"
v-if="htmlContent" v-if="htmlContent"
ref="commonWord" ref="commonWord"
:value="htmlContent" :value="htmlContent"
:contentList="mains"
:wordStyle="wordStyle" :wordStyle="wordStyle"
style="width: calc(100%); height: 50vh" style="width: calc(100%); height: 50vh"
:style="`100%`" :style="`100%`"
@@ -755,104 +757,70 @@ export default {
}); });
}, },
getWord() { getWord() {
var htmlContent = ``; // var htmlContent = ``;
htmlContent += this.mains // htmlContent += this.mains
.map((item) => { // .map((item) => {
//批注 // //批注
let contentHtml = ''; // let contentHtml = '';
var isRemark = ``; // var isRemark = ``;
// 判断是否是图片 // // 判断是否是图片
if (item.type == 1) { // if (item.type == 1) {
var extension = item.image.url.split('.').pop().toLowerCase(); // contentHtml = `
if (extension == 'tif') { // <p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
contentHtml = ` // item.ami_id
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${item.ami_id}" main-id="${ // }" main-id="${item.am_id}">
item.am_id // ${isRemark}
}"> // <img src="${this.mediaUrl +'articleImage/'+ item.image.url}" style="width: ${
<img src="" data-img-id="${item.ami_id}" style="width: ${item.width ? `${item.width}px` : '100%'}" /> // item.width ? `${item.width}px` : '100%'
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}">${item.image.note ? item.image.note : ''}</font> // }" />
</p> // <font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
`; // item.image.note ? item.image.note : ''
} else if (['jpg', 'jpeg', 'png'].includes(extension)) { // }</font>
contentHtml = ` // </p>
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${ // `;
item.ami_id // } else if (item.type == 2) {
}" main-id="${item.am_id}"> // var tableList = JSON.parse(item.table.table_data);
${isRemark}
<img src="${this.mediaUrl + item.image.url}" style="width: ${
item.width ? `${item.width}px` : '100%'
}" />
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
item.image.note ? item.image.note : ''
}</font>
</p>
`;
} else {
contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
item.ami_id
}" main-id="${item.am_id}">
${isRemark}
<span
style="
text-align: center;
font-size: 30px;
display: flex;
align-items: center;
justify-content: center;
"
>
Figures ( .${item.image.url.split('.').pop().toUpperCase()})
</span>
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${ // contentHtml = `
item.image.note ? item.image.note : '' // <div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
}</font> // item.am_id
</p> // }" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;">
`; // ${isRemark}
} // <font class="font tableTitle" style="width:100%" >${item.table.title ? item.table.title : ''}</font>
} else if (item.type == 2) { // <table border="1" style="width: auto; border-collapse: collapse; text-align: center; ">
var tableList = JSON.parse(item.table.table_data); // ${tableList
// .map((row) => {
// return `
// <tr>
// ${row
// .map((cell) => {
// return `
// <td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
// <span>${cell.text || ''}</span>
// </td>
// `;
// })
// .join('')} <!-- join the cells in the row -->
// </tr>
// `;
// })
// .join('')} <!-- join the rows -->
// </table>
// <font class="font" style="width:100%" >${item.table.note ? item.table.note : ''}</font>
// </div>
// `;
// } else {
// contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
// }
contentHtml = ` // // 判断是否是表格类型
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
item.am_id
}" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;">
${isRemark}
<font class="font tableTitle" style="width:100%" >${item.table.title ? item.table.title : ''}</font>
<table border="1" style="width: auto; border-collapse: collapse; text-align: center; ">
${tableList
.map((row) => {
return `
<tr>
${row
.map((cell) => {
return `
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
<span>${cell.text || ''}</span>
</td>
`;
})
.join('')} <!-- join the cells in the row -->
</tr>
`;
})
.join('')} <!-- join the rows -->
</table>
<font class="font" style="width:100%" >${item.table.note ? item.table.note : ''}</font>
</div>
`;
} else {
contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
}
// 判断是否是表格类型 // return contentHtml;
// })
return contentHtml; // .join('');
}) this.htmlContent = 'true';
.join(''); console.log('this.htmlContent at line 820:', this.htmlContent)
this.htmlContent = htmlContent;
}, },
getMainsInfo2(e) { getMainsInfo2(e) {
this.loadHtml = true; this.loadHtml = true;
@@ -910,38 +878,43 @@ export default {
}, },
// 文章html弹出层 // 文章html弹出层
async htmlContet(e) { async htmlContet(e) {
console.log('e at line 923:', e); this.htmlContent=''
this.articleId = e.article_id; this.articleId = e.article_id;
this.tg_article_id = e.tg_article_id; this.tg_article_id = e.tg_article_id;
// this.articleId = '3444';
this.UpHtpFIle.article_id = e.article_id; this.UpHtpFIle.article_id = e.article_id;
this.refersList = await this.getRefersList(); this.refersList = await this.getRefersList();
// this.UpHtpFIle.refers = e.refers
this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.p_article_id = e.p_article_id;
this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.doi = e.doi;
this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.htmlfile = e.file_html;
this.UpHtpFIle.title = e.title; this.UpHtpFIle.title = e.title;
this.UpHtpFIle.mains = e.mains; this.UpHtpFIle.mains = e.mains;
this.UpLoadFile.article_id = e.article_id; this.UpLoadFile.article_id = e.article_id;
this.html_type = e.html_type; await this.$api
// this.html_type = 2; .post('api/Publish/getPublishArticleDetail', {
article_id: e.article_id
if (this.html_type == 2) { })
if (e.has_html == 1) { .then(async (res) => {
await this.getMainsInfo2(); if (res.code == 0) {
console.log('res.code at line 1148:', res.code);
this.HtmlVisible = true; this.html_type = res.data.detail.html_type;
} else { if (this.html_type == 2) {
this.mains = ''; if ( res.data.detail.has_html == 1) {
this.HtmlVisible = true; await this.getMainsInfo2();
} this.HtmlVisible = true;
} else { } else {
await this.getMainsInfo(e); this.mains = '';
this.HtmlVisible = true; this.HtmlVisible = true;
} }
} else {
await this.getMainsInfo(e);
this.HtmlVisible = true;
}
}
});
}, },
// 生成html // 生成html
// CreateHtml(){ // CreateHtml(){
// const loading = this.$loading({ // const loading = this.$loading({
@@ -972,16 +945,21 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
await this.creatMains(); await this.creatMains();
this.html_type=2;
await this.getMainsInfo2(); await this.getMainsInfo2();
loading.close(); loading.close();
} else { } else {
this.HtmlVisible = false; this.HtmlVisible = false;
this.$router.push({ window.open(this.$router.resolve({ path: '/GenerateCharts',
path: '/GenerateCharts', query: {
query: { id: this.tg_article_id
id: this.tg_article_id } }).href, '_blank');
} // this.$router.push({
}); // path: '/GenerateCharts',
// query: {
// id: this.tg_article_id
// }
// });
} }
}, },
htmlLayout() { htmlLayout() {

View File

@@ -0,0 +1,201 @@
<template>
<div class="block commonMajor" style="width: 100%">
<el-button type="primary" plain size="mini" @click="handleAdd" style="float:right"><i class="el-icon-plus" ></i>Add Field </el-button>
<el-dialog title="Add Field " :visible.sync="coreVisible1" width="780px" :close-on-click-modal="false">
<el-form :model="coreForm1" :rules="rules1" ref="core_Form1" label-width="140px" >
<el-form-item prop="major">
<span slot="label">
<i style="color: #f56c6c; margin-right: 4px">*</i>
Field
</span>
<div
v-for="(field, index) in fields"
:key="index"
class="cascader-container"
style="margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between"
>
<!-- <span style="margin-right: 10px; font-size: 12px; color: #006699; font-weight: bold">Field {{ Number(index+1) }} :</span> -->
<el-cascader
:ref="`cascader${index}`"
@change="handleChange(index)"
v-model="field.selectedValue"
:placeholder="'Please select Field '"
:options="options"
:props="getProps()"
style="width: calc(100%)"
></el-cascader>
<!-- Delete button -->
<!-- <el-button size="mini" type="danger" style="margin-left: 10px;" @click="handleDelete(index)"><i class="el-icon-delete"></i></el-button> -->
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="coreVisible1 = false">Cancel</el-button>
<el-button type="primary" @click="onSubmit_core1(coreForm1)">Save</el-button>
</span>
</el-dialog>
<!-- 渲染多个 el-cascader 组件 -->
</div>
</template>
<script>
export default {
props: {
userId: {
type: String,
default: ''
},
articleId: {
type: String,
default: ''
}
},
data() {
return {
rules1:{},
coreVisible1: false,
coreForm1: {
majorList: []
},
fields: [{}], // 用于存储多个领域的选项数据
options: [] // 用于存储级联选择的选项数据
};
},
created() {
this.loadFields(); // 初始化时加载数据
},
methods: {
handleChange(i) {
console.log('.blur at line 45:');
console.log('i at line 40:', i);
this.$nextTick(() => {
this.$refs[`cascader${i}`][0].dropDownVisible = false;
this.coreForm1.majorList = this.fields[i].selectedValue;
this.$forceUpdate();
});
},
onSubmit_core1(coreForm) {
console.log('coreForm at line 1963:', coreForm);
if(!this.fields[0].selectedValue||this.fields[0].selectedValue.length == 0){
this.$message.error('Please select Field !');
return false;
}
this.$refs.core_Form1.validate((valid) => {
if (valid) {
var data={
major_id: this.coreForm1.majorList[this.coreForm1.majorList.length - 1]
}
if(this.userId){
data.user_id = this.userId;
}else{
data.article_id = this.articleId;
}
this.$api
.post(this.userId?'api/User/addUserMajor':'api/Major/addMajorByArticleIdForEditor', {
...data
})
.then((res) => {
if (res.code == 0) {
this.$message.success('Personal information modified successfully!');
this.coreVisible1 = false;
// this.tipVisible = false;
this.$emit('load')
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
} else {
this.$message.error('error submit!!');
return false;
}
});
},
// 动态添加一个新的 Cascader
handleAdd() {
this.$nextTick(() => {
this.fields=[]
this.fields.push({ selectedValue: [] }); // 添加一个新的字段
this.coreVisible1 = true;
});
},
// 删除指定的 Cascader
handleDelete(index) {
this.fields.splice(index, 1); // 删除指定索引的字段
},
// 获取 Cascader 配置
getProps() {
return {
value: 'value',
label: 'label',
children: 'children',
checkStrictly: true, // 允许任意选择一级
expandTrigger: 'hover' // 使用 hover 触发展开
};
},
// API 调用,获取子节点数据
getMajor(majorId) {
return this.$api
.post('api/Ucenter/getMajor', { major_id: majorId })
.then((response) => response.data)
.catch((error) => {
console.error('API Error:', error);
return [];
});
},
// 加载多个领域数据
loadFields() {
this.$api.post('api/Major/getMajorList', {}).then((res) => {
const transformData = (data) => {
return data.map((item) => {
const transformedItem = {
...item,
value: item.major_id,
label: `${item.major_title}`
};
// 如果存在 children递归处理
if (item.children && item.children.length > 0) {
transformedItem.children = transformData(item.children);
}
return transformedItem;
});
};
// 执行递归,获取选项数据
const data = transformData(res.data.majors.find((item) => item.major_id == 1).children);
this.options = [...data]; // 将选项数据赋给 options
});
}
}
};
</script>
<style scoped>
/* 你可以根据需要自定义样式 */
.cascader-container {
display: flex;
align-items: center;
justify-content: space-between;
}
::v-deep input[aria-hidden='true'] {
display: none !important;
}
</style>

View File

@@ -0,0 +1,207 @@
<template>
<div class="block commonMajor" style="width: 100%;overflow: hidden;">
<el-button type="primary" plain size="mini" @click="handleAdd" style="float:right;margin-bottom: 20px;"><i class="el-icon-plus" ></i>Add Field </el-button>
<div
v-for="(field, index) in fields"
:key="index"
class="cascader-container"
style="margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between"
>
<span style="margin-right: 10px; font-size: 12px; color: #006699; font-weight: bold">Field {{ Number(index+1) }} :</span>
<el-cascader
:ref="`cascader${index}`"
@change="handleChange(index)"
v-model="field.selectedValue"
:placeholder="'Please select Field '"
:options="options"
:props="getProps()"
style="width: calc(100% - 120px)"
></el-cascader>
<!-- Delete button -->
<el-button size="mini" type="danger" style="margin-left: 10px;" @click="handleDelete(index)"><i class="el-icon-delete"></i></el-button>
</div>
<!-- <el-dialog title="Add Field " :visible.sync="coreVisible1" width="780px" :close-on-click-modal="false">
<el-form :model="coreForm1" :rules="rules1" ref="core_Form1" label-width="140px" >
<el-form-item prop="major">
<span slot="label">
<i style="color: #f56c6c; margin-right: 4px">*</i>
Field
</span>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="coreVisible1 = false">Cancel</el-button>
<el-button type="primary" @click="onSubmit_core1(coreForm1)">Save</el-button>
</span>
</el-dialog> -->
<!-- 渲染多个 el-cascader 组件 -->
</div>
</template>
<script>
export default {
props: {
userId: {
type: String,
default: ''
},
list: {
type: Array,
default: []
}
},
watch: {
list: {
handler(e) {
this.fields=[...this.list]
},
immediate: true
},
},
data() {
return {
rules1:{},
coreVisible1: false,
coreForm1: {
majorList: []
},
fields: [], // 用于存储多个领域的选项数据
options: [] // 用于存储级联选择的选项数据
};
},
created() {
this.loadFields(); // 初始化时加载数据
},
methods: {
handleChange(i) {
console.log('.blur at line 45:');
console.log('i at line 40:', i);
this.$nextTick(() => {
this.$refs[`cascader${i}`][0].dropDownVisible = false;
this.coreForm1.majorList = this.fields[i].selectedValue;
this.$emit('load',this.fields)
this.$forceUpdate();
});
},
onSubmit_core1(coreForm) {
console.log('coreForm at line 1963:', coreForm);
if(!this.fields[0].selectedValue||this.fields[0].selectedValue.length == 0){
this.$message.error('Please select Field !');
return false;
}
this.$refs.core_Form1.validate((valid) => {
if (valid) {
this.$api
.post('api/User/addUserMajor', {
user_id: this.userId,
major_id: this.coreForm1.majorList[this.coreForm1.majorList.length - 1]
})
.then((res) => {
if (res.code == 0) {
this.$message.success('Personal information modified successfully!');
this.coreVisible1 = false;
// this.tipVisible = false;
this.$emit('load')
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
} else {
this.$message.error('error submit!!');
return false;
}
});
},
// 动态添加一个新的 Cascader
handleAdd() {
this.$nextTick(() => {
// this.fields=[]
this.fields.push({ selectedValue: [] }); // 添加一个新的字段
this.$emit('load',this.fields)
// this.coreVisible1 = true;
});
},
// 删除指定的 Cascader
handleDelete(index) {
this.fields.splice(index, 1); // 删除指定索引的字段
this.$emit('load',this.fields)
},
// 获取 Cascader 配置
getProps() {
return {
value: 'value',
label: 'label',
children: 'children',
checkStrictly: true, // 允许任意选择一级
expandTrigger: 'hover' // 使用 hover 触发展开
};
},
// API 调用,获取子节点数据
getMajor(majorId) {
return this.$api
.post('api/Ucenter/getMajor', { major_id: majorId })
.then((response) => response.data)
.catch((error) => {
console.error('API Error:', error);
return [];
});
},
// 加载多个领域数据
loadFields() {
this.$api.post('api/Major/getMajorList', {}).then((res) => {
const transformData = (data) => {
return data.map((item) => {
const transformedItem = {
...item,
value: item.major_id,
label: `${item.major_title}`
};
// 如果存在 children递归处理
if (item.children && item.children.length > 0) {
transformedItem.children = transformData(item.children);
}
return transformedItem;
});
};
// 执行递归,获取选项数据
const data = transformData(res.data.majors.find((item) => item.major_id == 1).children);
this.options = [...data]; // 将选项数据赋给 options
});
}
}
};
</script>
<style scoped>
/* 你可以根据需要自定义样式 */
.cascader-container {
width: 100%;
/* margin-top: 40px; */
display: flex;
align-items: center;
justify-content: space-between;
}
::v-deep input[aria-hidden='true'] {
display: none !important;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +1,51 @@
<template> <template>
<div> <div>
<div> <div>
<!--uploadWord |customButtonExportWord |customButtonExportImg -->
<tinymce
ref="tinymceChild"
:value="updatedHtml"
:typesettingType="typesettingType"
class="paste-area text-container"
toolbar=" bold italic | forecolor |subscript superscript|table tabledelete |customButtonExportWord |customButtonExportImg |customDropdown | clearButton"
style="
white-space: pre-line;
line-height: 12px;
max-height: 50vh;
overflow: auto;
font-size: 12px;
font-size: 7.5pt; /* 字体大小 */
margin-top: 0pt; /* 段前间距 */ <tinymce
margin-bottom: 0pt; /* 段后间距 */ type="table"
" :height="height"
></tinymce> :id="id"
ref="tinymceChild1"
:wordStyle="wordStyle"
:isAutomaticUpdate="isAutomaticUpdate"
@getContent="getContent"
@updateChange="updateChange"
:value="value"
:typesettingType="typesettingType"
class="paste-area text-container"
:toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|searchreplace|clearButton']"
style="
/* white-space: pre-line; */
line-height: 12px;
max-height: 60vh;
overflow: auto;
font-size: 12px;
font-size: 7.5pt; /* 字体大小 */
margin-top: 0pt; /* 段前间距 */
margin-bottom: 0pt; /* 段后间距 */
"
></tinymce>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Tinymce from '@/components/page/components/Tinymce'; import Tinymce from '@/components/page/components/Tinymce';
export default { export default {
props: ['lineStyle'], props: ['value','isAutomaticUpdate','height','id'],
components: { components: {
Tinymce Tinymce
}, },
watch: {
lineStyle() {}
},
data() { data() {
return { return {
tableData: [],
identity: localStorage.getItem('U_role'),
showToolbar: false, // 是否显示工具栏 showToolbar: false, // 是否显示工具栏
toolbarStyle: { toolbarStyle: {
top: '0px', top: '0px',
@@ -50,20 +59,30 @@ export default {
{ label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 } { label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 }
], ],
transform: null, transform: null,
typesettingType: 1 typesettingType: 1,
wordStyle: ``
}; };
}, },
mounted() { mounted() {
this.typesettingType = 1; this.typesettingType = 1;
if (this.lineStyle) {
console.log('newVal at line 37:', this.lineStyle);
} else {
this.updatedHtml = '';
}
}, },
methods: { methods: {
updateChange(content){
this.$emit('updateChange',content)
},
getTinymceContent(type) {
this.$refs.tinymceChild1.getContent(type);
},
getContent(type, content) {
this.$emit('getContent', type, content);
}
} }
}; };
</script> </script>
@@ -111,7 +130,7 @@ td input ::placeholder {
::v-deep .paste-area { ::v-deep .paste-area {
height: auto; /* A4纸高度 */ height: auto; /* A4纸高度 */
background: white; /* 纸张背景 */ background: white; /* 纸张背景 */
/* padding: 25.4mm 19.1mm; //内边距 */ /* padding: 25.4mm 19.1mm; //内边距 */
box-sizing: border-box; /* 确保内边距不会影响整体尺寸 */ box-sizing: border-box; /* 确保内边距不会影响整体尺寸 */
transform-origin: top left; transform-origin: top left;
@@ -141,8 +160,5 @@ td input ::placeholder {
overflow-wrap: break-word !important; overflow-wrap: break-word !important;
} }
.text-container { .text-container {
} }
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@@ -2,17 +2,16 @@
<div> <div>
<div> <div>
<!--uploadWord |customButtonExportWord |customButtonExportImg --> <!--uploadWord |customButtonExportWord |customButtonExportImg -->
<tinymce <tinymce
type="table" type="table"
ref="tinymceChild1" ref="tinymceChild1"
:wordStyle="wordStyle"
@getContent="getContent" @getContent="getContent"
:value="updatedHtml" :value="updatedHtml"
:typesettingType="typesettingType" :typesettingType="typesettingType"
class="paste-area text-container" class="paste-area text-container"
:toolbar="`undo redo | formatselect | bold italic ${ :toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|table tabledelete| searchreplace |clearButton']"
identity ? '| customBlue removeBlue' : ''
} |subscript superscript|table tabledelete ${identity ? '| customDropdown' : ''} | clearButton`"
style=" style="
/* white-space: pre-line; */ /* white-space: pre-line; */
line-height: 12px; line-height: 12px;
@@ -25,7 +24,6 @@
margin-bottom: 0pt; /* 段后间距 */ margin-bottom: 0pt; /* 段后间距 */
" "
></tinymce> ></tinymce>
</div> </div>
</div> </div>
</template> </template>
@@ -57,7 +55,9 @@ export default {
{ label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 } { label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 }
], ],
transform: null, transform: null,
typesettingType: 1 typesettingType: 1,
wordStyle: `
`
}; };
}, },
mounted() { mounted() {
@@ -76,8 +76,8 @@ export default {
text-align: center; text-align: center;
table-layout: auto;" table-layout: auto;"
>`; >`;
this.tableData.forEach((row) => { this.tableData.forEach((row,i) => {
modalContent += `<tr>`; modalContent += `<tr class="${this.isHeaderRow(i,this.tableData)?'table-header-row':''}">`;
row.forEach((cell) => { row.forEach((cell) => {
modalContent += ` modalContent += `
<td <td
@@ -100,16 +100,24 @@ export default {
} }
}, },
methods: { methods: {
isHeaderRow(rowIndex,table) {
var head=table[0]
return rowIndex < head[0].rowspan; // 假设前两行是表头
},
getTableContent(type) { getTableContent(type) {
this.$refs.tinymceChild1.getContent(type); this.$refs.tinymceChild1.getContent(type);
}, },
getContent(type, content) { getContent(type, content) {
if (content) { if (content) {
const container = document.createElement("div"); const container = document.createElement('div');
container.innerHTML = content; container.innerHTML = content;
this.$commonJS.parseTableToArray(content, (table) => { this.$commonJS.parseTableToArray(content, (table) => {
console.log('res at line 104:', table); console.log('res at line 104:', table);
this.$emit('getContent', type, { html_data: content, table: table }); this.$emit('getContent', type, { html_data: content, table: table });
}); });
} else { } else {

File diff suppressed because it is too large Load Diff

View File

@@ -202,7 +202,8 @@
text-align: center; text-align: center;
" "
> >
<tr v-for="(row, rowIndex) in table.table" :key="rowIndex"> <tr v-for="(row, rowIndex) in table.table" :key="rowIndex" >
<td <td
v-for="(cell, cellIndex) in row" v-for="(cell, cellIndex) in row"
:key="cellIndex" :key="cellIndex"
@@ -324,7 +325,7 @@ export default {
this.filterData(); this.filterData();
}, },
filterData(type) { filterData(type) {
console.log('type at line 374:', type);
if (type) { if (type) {
if (type == 'img') { if (type == 'img') {
this.imagesList = [...this.images]; this.imagesList = [...this.images];
@@ -541,7 +542,7 @@ export default {
this.$commonJS.createImageModal(index, modalContent, 'table', ''); this.$commonJS.createImageModal(index, modalContent, 'table', '');
}); });
} }
console.log('this.tables at line 533:', this.tables);
}); });
} }
}, },
@@ -581,6 +582,7 @@ export default {
::v-deep .wordTableHtml table { ::v-deep .wordTableHtml table {
cursor: pointer; cursor: pointer;
background-color: #fff !important; background-color: #fff !important;
border-bottom: 1px solid #000 !important;
} }
.el-menu-vertical-demo { .el-menu-vertical-demo {
width: 85px; width: 85px;

View File

@@ -1,9 +1,8 @@
<template> <template>
<!-- v-show="tables.length > 0 || images.length > 0" --> <!-- v-show="tables.length > 0 || images.length > 0" -->
<div <div
style="background-color: transparent !important; margin-top: 0px !important; height: 100%; padding: 0 !important; overflow: hidden" style="background-color: transparent !important; margin-top: 0px !important; height: 100%; padding: 0 !important; overflow: hidden"
class="ManuscirptList" class="ManuscirptList"
> >
<!-- 图片缩略图区域 --> <!-- 图片缩略图区域 -->
@@ -16,20 +15,20 @@
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
@select="handleSelectMenu" @select="handleSelectMenu"
> >
<el-menu-item index="1"> <!-- <el-menu-item index="1">
<i class="el-icon-message-solid" style="margin: 0 auto; color: #fc625d"></i> <i class="el-icon-message-solid" style="margin: 0 auto; color: #fc625d"></i>
<span slot="title" style="line-height: 30px">Annotations</span> <span slot="title" style="line-height: 30px">Annotations</span>
</el-menu-item> </el-menu-item> -->
<el-menu-item index="2"> <el-menu-item index="1">
<i class="el-icon-picture" color="#333639" style="margin: 0 auto"></i> <i class="el-icon-picture" color="#333639" style="margin: 0 auto"></i>
<span slot="title" style="line-height: 20px">Figures</span> <span slot="title" style="line-height: 20px">Figures</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="3"> <el-menu-item index="2">
<i class="el-icon-s-grid" color="#333639" style="margin: 0 auto"></i> <i class="el-icon-s-grid" color="#333639" style="margin: 0 auto"></i>
<span slot="title" style="line-height: 30px">Tables</span> <span slot="title" style="line-height: 30px">Tables</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="4"> <el-menu-item index="3">
<i class="el-icon-delete-solid" color="#333639" style="margin: 0 auto"></i> <i class="el-icon-delete-solid" color="#333639" style="margin: 0 auto"></i>
<span slot="title" style="line-height: 30px">Recycle Bin</span> <span slot="title" style="line-height: 30px">Recycle Bin</span>
</el-menu-item> </el-menu-item>
@@ -54,7 +53,7 @@
</ul> --> </ul> -->
<div style="width: 200px; float: right; padding: 10px; height: 100%; box-sizing: border-box; overflow-y: auto" class="arrlist"> <div style="width: 200px; float: right; padding: 10px; height: 100%; box-sizing: border-box; overflow-y: auto" class="arrlist">
<ul style="width: 100%; height: auto"> <ul style="width: 100%; height: auto">
<li v-show="currentMenu == 1"> <!-- <li v-show="currentMenu == 1">
<div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start"> <div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start">
<li v-for="(comment, index) in comments" :key="index" class="comment-item" style="width: 100%; padding: 6px 0"> <li v-for="(comment, index) in comments" :key="index" class="comment-item" style="width: 100%; padding: 6px 0">
<div @click.prevent="goToComment(comment.am_id)"> <div @click.prevent="goToComment(comment.am_id)">
@@ -74,18 +73,9 @@
<span style="color: #b8b7b7;font-size: 12px">{{ getTime(comment.ctime) }}</span> <span style="color: #b8b7b7;font-size: 12px">{{ getTime(comment.ctime) }}</span>
</p> </p>
<!-- isEditing true 显示可编辑的输入框 -->
<!-- <div v-if="isEditing === index">
<el-input
v-focus
type="textarea"
v-model="comment.remark"
@blur.stop="saveComment(index,comment)"
style="width: 100%; box-sizing: border-box; padding: 5px"
></el-input>
</div> -->
<!-- isEditing false 显示评论文本 -->
<div style="display: flex; align-items: center; justify-content: space-between"> <div style="display: flex; align-items: center; justify-content: space-between">
<p :style="isEditComment?'width: calc(100% - 40px)':'width: calc(100%)'" style="line-height:18px;min-height: 20px; width: calc(100%);white-space: normal;" v-html="comment.remark"> <p :style="isEditComment?'width: calc(100% - 40px)':'width: calc(100%)'" style="line-height:18px;min-height: 20px; width: calc(100%);white-space: normal;" v-html="comment.remark">
@@ -106,12 +96,12 @@
></i> ></i>
</div> </div>
<!-- 删除按钮 -->
</div> </div>
</li> </li>
</div> </div>
</li> </li> -->
<li v-show="currentMenu == 2"> <li v-show="currentMenu == 1">
<div style="" class="go-content-charts-item-box"> <div style="" class="go-content-charts-item-box">
<div class="item_box" style="width: 100%; height: auto; position: relative"> <div class="item_box" style="width: 100%; height: auto; position: relative">
<el-collapse v-if="isShowEdit"> <el-collapse v-if="isShowEdit">
@@ -139,6 +129,56 @@
<el-link> Figures {{ index + 1 }} </el-link> <el-link> Figures {{ index + 1 }} </el-link>
</p> --> </p> -->
</div> </div>
<div class="item_box" style="width: 100%; height: auto; position: relative">
<div class="list-center go-flex-center go-transition" style="width: 100%" @click="addImage">
<div class="title">
<span>Add Figure </span>
</div>
<div
class="thumbnailBox image list-img"
:style="`
border: 1px solid #ccccccb5;
width: 100%;
height: auto;
border-radius: 4px;
overflow: hidden;
position: relative;`"
>
<div style="width: 100%; height: 80px; display: flex; justify-content: center; align-items: center">
<!-- 图片内容 -->
<img src="@/assets/img/upload.png" style="width: 100px; height: 100%; object-fit: cover" />
</div>
<!-- 输入框 -->
</div>
</div>
<el-collapse v-if="isShowEdit">
<el-collapse-item name="1" style="margin-top: 4px">
<template slot="title">
<div style="width: 100%; display: flex; align-items: center; justify-content: space-between">
<span style="color: #777">Tables {{ index + 1 }}</span>
<span v-if="isShowEdit"><i class="el-icon-edit" v-if="isEdit"></i>Comments/ Suggestions</span>
</div>
</template>
<el-input
v-if="isShowEdit"
type="textarea"
placeholder="please input content"
:readonly="!isEdit"
:rows="4"
></el-input>
</el-collapse-item>
</el-collapse>
<!-- <p
style="color: #777; margin-top: 6px"
v-else
@click="img.has_selected == 1 ? goToListComment(img.article_image_id, 'img') : ''"
>
<el-link> Figures {{ index + 1 }} </el-link>
</p> -->
</div>
<div <div
class="item_box" class="item_box"
v-for="(img, index) in imagesList" v-for="(img, index) in imagesList"
@@ -220,7 +260,6 @@
/> />
</template> </template>
<template v-else> <template v-else>
<div <div
style=" style="
width: 140px; width: 140px;
@@ -269,8 +308,57 @@
</div> </div>
</div> </div>
</li> </li>
<li v-show="currentMenu == 3"> <li v-show="currentMenu == 2">
<div style="" class="go-content-charts-item-box"> <div style="" class="go-content-charts-item-box">
<div class="item_box" @click="addTable" style="width: 100%; height: auto; position: relative">
<div class="list-center go-flex-center go-transition" style="width: 100%">
<div class="title">
<span>Add Table </span>
</div>
<div
class="thumbnailBox image list-img"
:style="`
border: 1px solid #ccccccb5;
width: 100%;
height: auto;
border-radius: 4px;
overflow: hidden;
position: relative;`"
>
<div style="width: 100%; height: 80px; display: flex; justify-content: center; align-items: center">
<!-- 图片内容 -->
<img src="@/assets/img/uploadTable.png" style="width: 100px; height: 100%; object-fit: cover" />
</div>
</div>
</div>
<el-collapse v-if="isShowEdit">
<el-collapse-item name="1" style="margin-top: 4px">
<template slot="title">
<div style="width: 100%; display: flex; align-items: center; justify-content: space-between">
<span style="color: #777">Tables {{ index + 1 }}</span>
<span v-if="isShowEdit"><i class="el-icon-edit" v-if="isEdit"></i>Comments/ Suggestions</span>
</div>
</template>
<el-input
v-if="isShowEdit"
type="textarea"
placeholder="please input content"
:readonly="!isEdit"
:rows="4"
></el-input>
</el-collapse-item>
</el-collapse>
<!-- <p
style="color: #777; margin-top: 6px"
v-else
@click="img.has_selected == 1 ? goToListComment(img.article_image_id, 'img') : ''"
>
<el-link> Figures {{ index + 1 }} </el-link>
</p> -->
</div>
<div <div
class="item_box" class="item_box"
v-for="(table, index) in tablesList" v-for="(table, index) in tablesList"
@@ -383,7 +471,7 @@
</div> </div>
</div> </div>
</li> </li>
<li v-show="currentMenu == 4"> <li v-show="currentMenu == 3">
<div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start"> <div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start">
<div <div
v-for="(item, index) in content" v-for="(item, index) in content"
@@ -427,7 +515,6 @@ export default {
currentMenu: 1, currentMenu: 1,
mediaUrl, mediaUrl,
statusList: [ statusList: [
{ title: 'ALL', type: '0' }, { title: 'ALL', type: '0' },
@@ -476,22 +563,22 @@ export default {
}, },
// 保存评论修改 // 保存评论修改
saveComment(index,comment) { saveComment(index, comment) {
if (this.isEditComment) { if (this.isEditComment) {
this.$emit('addComment',comment) this.$emit('addComment', comment);
this.isEditing = null; // 退出编辑模式 this.isEditing = null; // 退出编辑模式
} }
}, },
onAddComment(comment) { onAddComment(comment) {
if (this.isEditComment) { if (this.isEditComment) {
this.$emit('onAddComment',comment.am_id) this.$emit('onAddComment', comment.am_id);
// this.isEditing = null; // 退出编辑模式 // this.isEditing = null; // 退出编辑模式
} }
}, },
// 删除评论 // 删除评论
deleteComment(comment, index) { deleteComment(comment, index) {
console.log('comment at line 480:', comment) console.log('comment at line 480:', comment);
if (this.isEditComment) { if (this.isEditComment) {
this.$confirm(this.$t('commonTable.removeAnnotations'), 'Prompt', { this.$confirm(this.$t('commonTable.removeAnnotations'), 'Prompt', {
confirmButtonText: 'Submit', confirmButtonText: 'Submit',
@@ -499,14 +586,13 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.$api this.$api
.post('api/Preaccept/clearMainsRemark', { .post('api/Preaccept/clearMainsRemark', {
am_id: comment.am_id am_id: comment.am_id
}) })
.then((res) => { .then((res) => {
this.getCommentList() this.getCommentList();
}); });
// this.comments.splice(index, 1); // 删除评论 // this.comments.splice(index, 1); // 删除评论
}) })
.catch(() => {}); .catch(() => {});
@@ -545,9 +631,14 @@ export default {
}) })
.then((res) => { .then((res) => {
this.comments = res.data.list; this.comments = res.data.list;
console.log('this.comments at line 537:', this.comments);
}); });
},
addImage() {
this.$emit('addImage');
},
addTable() {
this.$emit('addTable');
}, },
add(type) { add(type) {
this.$emit('add', type); this.$emit('add', type);
@@ -561,18 +652,18 @@ export default {
handleSelectMenu(v) { handleSelectMenu(v) {
this.currentMenu = v; this.currentMenu = v;
this.currentSelectType = '0'; this.currentSelectType = '0';
if (v == 1) { // if (v == 1) {
this.getCommentList(); // this.getCommentList();
} else { // } else {
this.filterData(); this.filterData();
} // }
}, },
selectType(v) { selectType(v) {
this.currentSelectType = v.type; this.currentSelectType = v.type;
this.filterData(); this.filterData();
}, },
filterData(type) { filterData(type) {
console.log('type at line 374:', type);
if (type) { if (type) {
if (type == 'img') { if (type == 'img') {
this.imagesList = [...this.images]; this.imagesList = [...this.images];
@@ -580,7 +671,7 @@ export default {
this.tablesList = [...this.tables]; this.tablesList = [...this.tables];
} }
} else { } else {
if (this.currentMenu == 2) { if (this.currentMenu == 1) {
switch (this.currentSelectType) { switch (this.currentSelectType) {
case '0': case '0':
this.imagesList = [...this.images]; this.imagesList = [...this.images];
@@ -592,7 +683,7 @@ export default {
this.imagesList = [...this.images].filter((e) => e.has_selected == 0); this.imagesList = [...this.images].filter((e) => e.has_selected == 0);
break; break;
} }
} else if (this.currentMenu == 3) { } else if (this.currentMenu == 2) {
switch (this.currentSelectType) { switch (this.currentSelectType) {
case '0': case '0':
this.tablesList = [...this.tables]; this.tablesList = [...this.tables];
@@ -656,7 +747,6 @@ export default {
}); });
}, },
onDragStart($event, item, index, type) { onDragStart($event, item, index, type) {
console.log('type at line 192:', index);
this.$emit('onDragStart', $event, item, index, type); this.$emit('onDragStart', $event, item, index, type);
}, },
changeActiveNames(e) { changeActiveNames(e) {
@@ -702,12 +792,10 @@ export default {
list.forEach((img, index) => { list.forEach((img, index) => {
var extension = img.image.split('.').pop().toLowerCase(); var extension = img.image.split('.').pop().toLowerCase();
// if (extension === 'tif' || extension === 'jpg' || extension === 'jpeg' || extension === 'png') { // if (extension === 'tif' || extension === 'jpg' || extension === 'jpeg' || extension === 'png') {
const modalContent = `<img src="${this.mediaUrl + img.image}" alt="Image ${index}" style="width:100%;" >`; const modalContent = `<img src="${this.mediaUrl + img.image}" alt="Image ${index}" style="width:100%;" >`;
this.$commonJS.createImageModal(index, modalContent, 'img'); this.$commonJS.createImageModal(index, modalContent, 'img');
// } // }
}); });
} }
this.images = list; this.images = list;
@@ -756,10 +844,12 @@ export default {
text-align: center; text-align: center;
table-layout: auto;" table-layout: auto;"
>`; >`;
table.table.forEach((row) => {
modalContent += `<tr>`; if (table.table&&table.table.length > 0) {
row.forEach((cell) => { table.table.forEach((row) => {
modalContent += ` modalContent += `<tr>`;
row.forEach((cell) => {
modalContent += `
<td <td
colspan="${cell.colspan || 1}" colspan="${cell.colspan || 1}"
rowspan="${cell.rowspan || 1}" rowspan="${cell.rowspan || 1}"
@@ -767,14 +857,16 @@ export default {
> >
<span>${cell.text}</span> <span>${cell.text}</span>
</td>`; </td>`;
});
modalContent += `</tr>`;
}); });
modalContent += `</tr>`; }
});
modalContent += `</table></div>`; modalContent += `</table></div>`;
this.$commonJS.createImageModal(index, modalContent, 'table', ''); this.$commonJS.createImageModal(index, modalContent, 'table', '');
}); });
} }
console.log('this.tables at line 533:', this.tables);
}); });
} }
}, },
@@ -816,6 +908,7 @@ export default {
::v-deep .wordTableHtml table { ::v-deep .wordTableHtml table {
cursor: pointer; cursor: pointer;
background-color: #fff !important; background-color: #fff !important;
border-bottom: 1px solid #000 !important;
} }
.el-menu-vertical-demo { .el-menu-vertical-demo {
width: 85px; width: 85px;

View File

@@ -313,5 +313,6 @@ export default {
::v-deep .wordTableHtml table { ::v-deep .wordTableHtml table {
cursor: pointer; cursor: pointer;
background-color: #fff !important; background-color: #fff !important;
border-bottom: 1px solid #000 !important;
} }
</style> </style>

View File

@@ -83,7 +83,7 @@
</el-table-column> </el-table-column>
<el-table-column label="state" width="55" align="center"> <el-table-column label="state" width="55" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="status ok" v-if="scope.row.refer_type == 'journal' && scope.row.doilink != '' || scope.row.refer_type == 'book' && scope.row.isbn != '' || scope.row.refer_type == 'other' && scope.row.refer_frag != '' && scope.row.refer_frag.length > 15" > <span class="status ok" v-if="scope.row.refer_type == 'journal' && scope.row.doilink != '' || scope.row.refer_type == 'book' && scope.row.isbn != '' " >
<i class="el-icon-circle-check"></i> <i class="el-icon-circle-check"></i>
</span> </span>
<span class="status warn" v-else > <span class="status warn" v-else >
@@ -549,6 +549,7 @@ export default {
if (res.code == 0) { if (res.code == 0) {
if (res.data.bf < 100) { if (res.data.bf < 100) {
this.refReal = res.data.bf this.refReal = res.data.bf
this.$forceUpdate()
} else { } else {
clearInterval(timeRef) clearInterval(timeRef)
this.refProcess = 0 this.refProcess = 0

View File

@@ -13,8 +13,9 @@ import 'babel-polyfill';
import api from './api/index.js'; import api from './api/index.js';
import Common from './components/common/common' import Common from './components/common/common'
Vue.prototype.$validateString = function (str) { Vue.prototype.$validateString = function (str) {
return /^[a-zA-Z\s-]+$/.test(str); return /^[a-zA-Z\s\u00C0-\u00FF\u0100-\u017F-]+$/.test(str);
} }
import VXETable from 'vxe-table' import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css' import 'vxe-table/lib/style.css'
@@ -73,6 +74,10 @@ Vue.component("Editor", Editor);
import commonTable from '@/components/page/components/table/table.vue' import commonTable from '@/components/page/components/table/table.vue'
Vue.component('common-table', commonTable); Vue.component('common-table', commonTable);
import commonMajor from '@/components/page/components/major/index.vue'
Vue.component('common-major', commonMajor);
import commonMajorList from '@/components/page/components/major/list.vue'
Vue.component('common-major-list', commonMajorList);
import commonPayPalButton from '@/components/page/components/pendingPayment/PayPalButton.vue' import commonPayPalButton from '@/components/page/components/pendingPayment/PayPalButton.vue'
Vue.component('common-paypal-button', commonPayPalButton); Vue.component('common-paypal-button', commonPayPalButton);
import commonTiff from '@/components/page/components/table/tiff.vue' import commonTiff from '@/components/page/components/table/tiff.vue'
@@ -80,6 +85,10 @@ Vue.component('common-tiff', commonTiff);
import commonContent from '@/components/page/components/table/content.vue' import commonContent from '@/components/page/components/table/content.vue'
Vue.component('common-content', commonContent); Vue.component('common-content', commonContent);
import commonWord from '@/components/page/components/table/word.vue' import commonWord from '@/components/page/components/table/word.vue'
Vue.component('common-comment', commonComment);
import commonEditTable from '@/components/page/components/table/editTable.vue'
Vue.component('common-edit-table', commonEditTable);
import commonComment from '@/components/page/components/table/comment.vue'
Vue.component('common-word', commonWord); Vue.component('common-word', commonWord);
import commonAnnotations from '@/components/page/components/table/annotations.vue' import commonAnnotations from '@/components/page/components/table/annotations.vue'
Vue.component('common-annotations', commonAnnotations); Vue.component('common-annotations', commonAnnotations);

View File

@@ -988,7 +988,8 @@ export default new Router({
path: '/GenerateCharts', //用户端预收录-引用编辑 path: '/GenerateCharts', //用户端预收录-引用编辑
component: () => import('../components/page/GenerateCharts'), component: () => import('../components/page/GenerateCharts'),
meta: { meta: {
title: 'HTML Proofread' title: 'Text Proofread',
hideSidebar: true
} }
}, },
{ {