Merge branch 'master' of https://gitee.com/wjl2008_admin/tougao_web into pay
@@ -512,7 +512,7 @@ a {
|
||||
}
|
||||
|
||||
.kuang_communtion .kuang_communtion_conmt {
|
||||
/* max-height: 350px;
|
||||
/* max-height: 350px;
|
||||
overflow-y: auto; */
|
||||
word-break: normal;
|
||||
}
|
||||
@@ -1072,115 +1072,365 @@ a {
|
||||
line-height: 24px;
|
||||
} */
|
||||
|
||||
.wordTableHtml b span {
|
||||
font-weight: bold !important;
|
||||
.wordTableHtml b span {
|
||||
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 {
|
||||
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 {
|
||||
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;
|
||||
border: 0px !important;
|
||||
border-bottom: 1px solid #000 !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;
|
||||
}
|
||||
|
||||
.wordTableHtml table td,
|
||||
.wordTableHtml table th{
|
||||
padding: 5px;
|
||||
text-align: left !important;
|
||||
|
||||
word-wrap: break-word; /* 长单词自动换行 */
|
||||
word-break: break-word;
|
||||
font-family: 'Charis SIL' !important;
|
||||
font-size: 7.5pt !important;
|
||||
mso-font-kerning: 1pt !important;
|
||||
line-height: 10pt !important;
|
||||
mos-line-height: 10pt !important;
|
||||
.wordTableHtml table th {
|
||||
padding: 5px;
|
||||
text-align: left !important;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
.wordTableHtml 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;
|
||||
/* text-align: justify !important; */
|
||||
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;
|
||||
/* text-align: justify !important; */
|
||||
}
|
||||
|
||||
.wordTableHtml table tr td p {
|
||||
display: flex;
|
||||
text-align: left !important;
|
||||
align-items: center;
|
||||
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;
|
||||
display: flex;
|
||||
text-align: left !important;
|
||||
align-items: center;
|
||||
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;
|
||||
}
|
||||
|
||||
.wordTableHtml 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;
|
||||
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;
|
||||
}
|
||||
|
||||
.wordTableHtml 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;
|
||||
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;
|
||||
}
|
||||
|
||||
.wordTableHtml table blue {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
.wordTableHtml table tr:first-child td {
|
||||
border-top: 1px solid #000 !important;
|
||||
|
||||
border-bottom: 1px solid #000 !important;
|
||||
|
||||
|
||||
.wordTableHtml table tr:first-child td {
|
||||
border-top: 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;
|
||||
|
||||
}
|
||||
|
||||
.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;
|
||||
/* 设置字体颜色 */
|
||||
}
|
||||
BIN
src/assets/img/carriageReturn.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/img/deleteComment.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/img/replyComment.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/assets/img/selectComment.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/img/solveComment.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,7 +1,8 @@
|
||||
import Vue from 'vue';
|
||||
import JSZip from 'jszip';
|
||||
import Common from '@/components/common/common'
|
||||
import Tiff from 'tiff.js';
|
||||
var mediaUrl = Common.mediaUrl+'articleImage/';
|
||||
var mediaUrl = Common.mediaUrl + 'articleImage/';
|
||||
// var mediaUrl1 = 'https://submission.tmrjournals.com/public/articleImage/';
|
||||
|
||||
const fs = require('fs');
|
||||
@@ -17,13 +18,19 @@ const capitalizeFirstLetter = function (text) {
|
||||
});
|
||||
};
|
||||
export default {
|
||||
decodeHtml(html) {
|
||||
var txt = document.createElement('textarea');
|
||||
txt.innerHTML = html;
|
||||
return txt.value;
|
||||
},
|
||||
//去掉最外层自定义的span标签
|
||||
extractContentWithoutOuterSpan(cell) {
|
||||
var str = ''
|
||||
// 获取单元格的 HTML 内容
|
||||
let htmlContent = cell.innerHTML.trim();
|
||||
|
||||
str = this.transformHtmlString(htmlContent)
|
||||
|
||||
|
||||
// 创建一个临时的 DOM 元素来解析 HTML
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = htmlContent;
|
||||
@@ -42,10 +49,26 @@ export default {
|
||||
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)) {
|
||||
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 内容
|
||||
return str;
|
||||
},
|
||||
@@ -54,7 +77,7 @@ export default {
|
||||
// 创建临时 DOM 容器
|
||||
const tempDiv = document.createElement("div");
|
||||
tempDiv.innerHTML = pastedHtml; // 插入粘贴的 HTML 内容
|
||||
|
||||
|
||||
// 获取表格
|
||||
const tables = tempDiv.querySelectorAll("table");
|
||||
if (tables.length === 0) {
|
||||
@@ -62,31 +85,31 @@ export default {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const allTables = []; // 存储所有表格的二维数组
|
||||
|
||||
|
||||
for (const table of tables) {
|
||||
const rows = table.querySelectorAll("tr");
|
||||
const tableArray = []; // 当前表格的二维数组
|
||||
|
||||
|
||||
// 存储合并单元格信息
|
||||
const mergeMap = {};
|
||||
|
||||
|
||||
rows.forEach((row, rowIndex) => {
|
||||
const cells = row.querySelectorAll("td, th");
|
||||
const rowArray = [];
|
||||
|
||||
|
||||
let colIndex = 0;
|
||||
|
||||
|
||||
cells.forEach((cell) => {
|
||||
// 跳过被合并的单元格
|
||||
while (mergeMap[`${rowIndex},${colIndex}`]) {
|
||||
colIndex++;
|
||||
}
|
||||
|
||||
|
||||
// 获取单元格内容,如果为空则设置为默认值
|
||||
let cellText = cell.innerText.trim() || " "; // 处理空值
|
||||
|
||||
|
||||
// 处理样式
|
||||
if (cell.style.fontWeight === "bold") {
|
||||
cellText = `<b>${cellText}</b>`;
|
||||
@@ -100,18 +123,18 @@ export default {
|
||||
if (cell.style.verticalAlign === "sub") {
|
||||
cellText = `<sub>${cellText}</sub>`;
|
||||
}
|
||||
|
||||
|
||||
// 检查合并单元格属性
|
||||
const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
|
||||
const rowspan = parseInt(cell.getAttribute("rowspan") || "1", 10);
|
||||
|
||||
|
||||
// 保存当前单元格信息
|
||||
rowArray[colIndex] = {
|
||||
text: cellText,
|
||||
colspan: colspan,
|
||||
rowspan: rowspan,
|
||||
};
|
||||
|
||||
|
||||
// 更新合并单元格信息
|
||||
if (rowspan > 1 || colspan > 1) {
|
||||
for (let i = 0; i < rowspan; i++) {
|
||||
@@ -121,16 +144,16 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
colIndex++; // 移动到下一列
|
||||
});
|
||||
|
||||
|
||||
tableArray.push(rowArray); // 添加当前行到表格数组
|
||||
});
|
||||
|
||||
|
||||
allTables.push(tableArray); // 添加当前表格到所有表格数组
|
||||
}
|
||||
|
||||
|
||||
console.log("解析后的表格数组:", allTables);
|
||||
callback(allTables); // 返回处理后的数组
|
||||
} catch (error) {
|
||||
@@ -138,7 +161,7 @@ export default {
|
||||
callback([]);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
async extractWordTablesToArrays(file, callback) {
|
||||
const Zip = new JSZip();
|
||||
try {
|
||||
@@ -272,11 +295,30 @@ export default {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -324,11 +366,12 @@ export default {
|
||||
}
|
||||
},
|
||||
transformHtmlString(inputHtml) {
|
||||
|
||||
inputHtml = inputHtml.replace(/(<[^>]+) style="[^"]*"/g, '$1'); // 移除style属性
|
||||
inputHtml = inputHtml.replace(/(<[^>]+) class="[^"]*"/g, '$1'); // 移除class属性
|
||||
|
||||
// 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>` 标签,去掉内部样式并保留内容
|
||||
inputHtml = inputHtml.replace(/<span[^>]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签
|
||||
@@ -444,23 +487,23 @@ export default {
|
||||
console.log('numberingMap at line 232:', numberingMap)
|
||||
// 提取表格
|
||||
// 获取所有的段落
|
||||
const paragraphs = xmlDoc.getElementsByTagName("w:p");
|
||||
// 获取所有的表格
|
||||
const tables = xmlDoc.getElementsByTagName("w:tbl");
|
||||
const paragraphs = xmlDoc.getElementsByTagName("w:p");
|
||||
// 获取所有的表格
|
||||
const tables = xmlDoc.getElementsByTagName("w:tbl");
|
||||
|
||||
// 找到表格前的段落
|
||||
let previousParagraphs = [];
|
||||
let tableIndex = 0;
|
||||
// 找到表格前的段落
|
||||
let previousParagraphs = [];
|
||||
let tableIndex = 0;
|
||||
|
||||
// 遍历段落,找到第一个表格之前的段落
|
||||
for (let i = 0; i < paragraphs.length; i++) {
|
||||
if (tableIndex < tables.length && paragraphs[i].nextSibling === tables[tableIndex]) {
|
||||
break; // 找到表格
|
||||
// 遍历段落,找到第一个表格之前的段落
|
||||
for (let i = 0; i < paragraphs.length; i++) {
|
||||
if (tableIndex < tables.length && paragraphs[i].nextSibling === tables[tableIndex]) {
|
||||
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)
|
||||
const tableHtml = this.convertTablesToHtml(tables, numberingMap);
|
||||
console.log('tableHtml at line 18:', tableHtml)
|
||||
@@ -477,45 +520,45 @@ const previousHtml = this.convertParagraphsToHtml(previousParagraphs);
|
||||
callback("<p>文件解析失败,请检查文件格式。</p>");
|
||||
}
|
||||
},
|
||||
// 转换段落为 HTML
|
||||
convertParagraphsToHtml(paragraphs) {
|
||||
let html = "";
|
||||
paragraphs.forEach(p => {
|
||||
let paragraphHtml = "";
|
||||
|
||||
// 处理段落中的所有子元素
|
||||
const runs = p.getElementsByTagName("w:r"); // 获取段落中的所有文本运行(可能包含上标、下标等)
|
||||
|
||||
Array.from(runs).forEach(run => {
|
||||
let text = "";
|
||||
|
||||
// 获取文本内容
|
||||
const textNodes = run.getElementsByTagName("w:t");
|
||||
Array.from(textNodes).forEach(t => {
|
||||
text += t.textContent || t.text;
|
||||
// 转换段落为 HTML
|
||||
convertParagraphsToHtml(paragraphs) {
|
||||
let html = "";
|
||||
paragraphs.forEach(p => {
|
||||
let paragraphHtml = "";
|
||||
|
||||
// 处理段落中的所有子元素
|
||||
const runs = p.getElementsByTagName("w:r"); // 获取段落中的所有文本运行(可能包含上标、下标等)
|
||||
|
||||
Array.from(runs).forEach(run => {
|
||||
let text = "";
|
||||
|
||||
// 获取文本内容
|
||||
const textNodes = run.getElementsByTagName("w:t");
|
||||
Array.from(textNodes).forEach(t => {
|
||||
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>`;
|
||||
} else if (isSubscript) {
|
||||
text = `<sub>${text}</sub>`;
|
||||
}
|
||||
|
||||
// 拼接到段落 HTML 中
|
||||
paragraphHtml += text;
|
||||
// 将运行的文本拼接成完整的段落
|
||||
html += `<p>${paragraphHtml}</p>`;
|
||||
});
|
||||
|
||||
// 将运行的文本拼接成完整的段落
|
||||
html += `<p>${paragraphHtml}</p>`;
|
||||
});
|
||||
|
||||
return html;
|
||||
}
|
||||
,
|
||||
return html;
|
||||
}
|
||||
,
|
||||
convertTablesToHtml(tables, numberingMap) {
|
||||
const namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
||||
let html = "";
|
||||
@@ -773,7 +816,7 @@ convertParagraphsToHtml(paragraphs) {
|
||||
if (['jpg', 'jpeg', 'png'].includes(extension)) {
|
||||
thumbnailContent = `<img src="${mediaUrl + img.image}" alt="Image ${index}" style="width: 100%; height: auto;">`;
|
||||
} 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 {
|
||||
thumbnailContent = `<a href="${mediaUrl + img.image}" style="color: #75abf1;width:100%; height: 100%;">
|
||||
<div
|
||||
@@ -947,7 +990,7 @@ convertParagraphsToHtml(paragraphs) {
|
||||
|
||||
//更新传入所有表格样式
|
||||
updateTableStyles(container, type, setTopBottomBorder) {
|
||||
|
||||
|
||||
var typesettingType = type ? type : 1
|
||||
const tables = container.querySelectorAll('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(/ /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); // 延迟执行,确保按钮渲染完成
|
||||
}
|
||||
|
||||
|
||||
// 通用递归方法
|
||||
|
||||
};
|
||||
|
||||
@@ -1,45 +1,47 @@
|
||||
<template>
|
||||
<div class="header">
|
||||
<!-- 折叠按钮 -->
|
||||
<div class="collapse-btn" @click="collapseChage">
|
||||
<i v-if="!collapse" class="el-icon-s-fold"></i>
|
||||
<i v-else class="el-icon-s-unfold"></i>
|
||||
</div>
|
||||
<div class="logo">
|
||||
<div>
|
||||
<img src="../../assets/img/logo.png" />
|
||||
<p>{{ $t('system.title_1') }}</p>
|
||||
</div>
|
||||
<div>
|
||||
{{ $t('system.title_2') }}
|
||||
</div>
|
||||
<!-- {{ $t('system.title') }} -->
|
||||
</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>
|
||||
<!-- 消息中心 -->
|
||||
<div class="header">
|
||||
<!-- 折叠按钮 -->
|
||||
<div class="collapse-btn" @click="collapseChage" v-if="!home">
|
||||
<i v-if="!collapse" class="el-icon-s-fold"></i>
|
||||
<i v-else class="el-icon-s-unfold"></i>
|
||||
</div>
|
||||
<div class="collapse-btn" @click="goHome" v-if="home">
|
||||
<i class="el-icon-s-home"></i>
|
||||
</div>
|
||||
<div class="logo">
|
||||
<div>
|
||||
<img src="../../assets/img/logo.png" />
|
||||
<p>{{ $t('system.title_1') }}</p>
|
||||
</div>
|
||||
<div>
|
||||
{{ $t('system.title_2') }}
|
||||
</div>
|
||||
<!-- {{ $t('system.title') }} -->
|
||||
</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>
|
||||
<!-- 身份切换 -->
|
||||
<!-- <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>
|
||||
@@ -63,343 +65,346 @@
|
||||
</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>
|
||||
<!-- 用户头像 -->
|
||||
<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 {
|
||||
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: {
|
||||
// 用户名下拉菜单选择事件
|
||||
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;
|
||||
},
|
||||
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
|
||||
}
|
||||
}
|
||||
};
|
||||
// 倒计时
|
||||
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 {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
.header {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.collapse-btn {
|
||||
float: left;
|
||||
padding: 0 15px 0 21px;
|
||||
cursor: pointer;
|
||||
line-height: 70px;
|
||||
}
|
||||
.collapse-btn {
|
||||
float: left;
|
||||
padding: 0 15px 0 21px;
|
||||
cursor: pointer;
|
||||
line-height: 70px;
|
||||
}
|
||||
|
||||
.header .logo {
|
||||
float: left;
|
||||
padding-top: 19px;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
}
|
||||
.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 img {
|
||||
width: 84px;
|
||||
height: 20px;
|
||||
margin-top: -4px;
|
||||
margin-right: 15px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.header .logo>div {
|
||||
float: left;
|
||||
height: 40px;
|
||||
}
|
||||
.header .logo > div {
|
||||
float: left;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.header .logo p {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
.header .logo p {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
float: right;
|
||||
padding-right: 50px;
|
||||
}
|
||||
.header-right {
|
||||
float: right;
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
.header-user-con {
|
||||
display: flex;
|
||||
height: 70px;
|
||||
align-items: center;
|
||||
}
|
||||
.header-user-con {
|
||||
display: flex;
|
||||
height: 70px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-fullscreen {
|
||||
transform: rotate(45deg);
|
||||
margin-right: 5px;
|
||||
font-size: 24px;
|
||||
}
|
||||
.btn-fullscreen {
|
||||
transform: rotate(45deg);
|
||||
margin-right: 5px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.changelang {
|
||||
position: relative;
|
||||
width: 90px;
|
||||
height: 30px;
|
||||
}
|
||||
.changelang {
|
||||
position: relative;
|
||||
width: 90px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.btn-fullscreen {
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.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: #fff;
|
||||
}
|
||||
.btn-bell-badge {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -2px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: #f56c6c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-bell .el-icon-bell {
|
||||
color: #fff;
|
||||
}
|
||||
.btn-bell .el-icon-bell {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.user-name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.user-avator {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.user-avator {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.user-avator img {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.user-avator img {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.el-dropdown-link {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
.el-dropdown-link {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-dropdown-menu__item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#colgreen {
|
||||
color: rgb(142, 150, 74);
|
||||
}
|
||||
.el-dropdown-menu__item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#colgreen {
|
||||
color: rgb(142, 150, 74);
|
||||
}
|
||||
</style>
|
||||
|
||||
403
src/components/common/Header2.vue
Normal 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>
|
||||
@@ -1,23 +1,41 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<v-head></v-head>
|
||||
<v-sidebar></v-sidebar>
|
||||
<div class="content-box" :class="{ 'content-collapse': collapse }">
|
||||
<v-tags></v-tags>
|
||||
<div class="content">
|
||||
<transition name="move" mode="out-in">
|
||||
<keep-alive :include="tagsList">
|
||||
<router-view ></router-view>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<el-backtop target=".content"></el-backtop>
|
||||
<template v-if="!this.$route.meta.hideSidebar">
|
||||
<v-head></v-head>
|
||||
|
||||
<v-sidebar></v-sidebar>
|
||||
<div class="content-box" :class="{ 'content-collapse': collapse }">
|
||||
<v-tags></v-tags>
|
||||
<div class="content">
|
||||
<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>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vHead from './Header.vue';
|
||||
import vHead2 from './Header2.vue';
|
||||
import vSidebar from './Sidebar.vue';
|
||||
import vTags from './Tags.vue';
|
||||
import bus from './bus';
|
||||
@@ -30,6 +48,7 @@ export default {
|
||||
},
|
||||
components: {
|
||||
vHead,
|
||||
vHead2,
|
||||
vSidebar,
|
||||
vTags
|
||||
},
|
||||
|
||||
@@ -636,6 +636,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
localStorage.setItem('collapse', this.collapse);
|
||||
if (this.userrole == 2) {
|
||||
//其余的身份(显示作者)
|
||||
|
||||
@@ -355,6 +355,11 @@ const en = {
|
||||
},
|
||||
commonTable: {
|
||||
add: 'Add',
|
||||
delete: 'Delete',
|
||||
reply: 'Reply',
|
||||
solve: 'Solve',
|
||||
cancelsolve: 'Cancel resolved',
|
||||
Resolved: 'Resolved',
|
||||
preview: 'Preview',
|
||||
link: 'Positioning',
|
||||
Typed: 'Typed',
|
||||
@@ -373,7 +378,10 @@ const en = {
|
||||
removeAnnotations:'Are you sure you want to delete this Annotation?',
|
||||
removeContent:'Are you sure you want to delete 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:{
|
||||
title:'Title',
|
||||
|
||||
@@ -348,6 +348,11 @@ const zh = {
|
||||
},
|
||||
commonTable: {
|
||||
add: '新增',
|
||||
delete: '删除',
|
||||
reply: '答复',
|
||||
solve: '解决',
|
||||
cancelsolve: '取消解决',
|
||||
Resolved: '已解决',
|
||||
preview: '预览',
|
||||
positioning: '定位',
|
||||
edit: '编辑',
|
||||
@@ -366,7 +371,10 @@ const zh = {
|
||||
removeAnnotations: '确定要删除这条批注吗?',
|
||||
removeContent: '确定要删除这条内容吗?',
|
||||
reContent: '确定要恢复这条内容吗?',
|
||||
uploadImageInfo: 'Figures 只能上传 JPG、JPEG 和 PNG 格式的文件'
|
||||
uploadImageInfo: 'Figures 只能上传 JPG、JPEG 和 PNG 格式的文件',
|
||||
selectComment: '请选择要添加批注的文本',
|
||||
selectWord:'请只选中单个单词!',
|
||||
alreadyCommented:'文本中已有批注内容请重新选择',
|
||||
},
|
||||
pendingPayment: {
|
||||
title: 'Title',
|
||||
|
||||
@@ -270,12 +270,16 @@ export default {
|
||||
},
|
||||
// 跳转到图表编辑页面
|
||||
goGenerateCharts(id) {
|
||||
this.$router.push({
|
||||
path: 'GenerateCharts',
|
||||
window.open(this.$router.resolve({ path: '/GenerateCharts',
|
||||
query: {
|
||||
id: id
|
||||
}
|
||||
});
|
||||
} }).href, '_blank');
|
||||
// this.$router.push({
|
||||
// path: 'GenerateCharts',
|
||||
// query: {
|
||||
// id: id
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
// 隐藏alert
|
||||
|
||||
@@ -215,6 +215,7 @@
|
||||
localStorage.setItem('U_role', 'superadmin');
|
||||
localStorage.setItem('U_name', res.userinfo.account);
|
||||
localStorage.setItem('U_id', res.userinfo.user_id);
|
||||
return false
|
||||
// localStorage.setItem('U_id', res.userinfo.admin_id);
|
||||
this.$router.push('/');
|
||||
} else if (res.data.roles.includes('editor')) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="tab_post">
|
||||
<div class="tab_post" >
|
||||
|
||||
|
||||
|
||||
<div style="margin-bottom: 10px">
|
||||
<p
|
||||
v-if="feeStatus == 0"
|
||||
@@ -50,7 +53,7 @@
|
||||
<p v-else>
|
||||
<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>
|
||||
HTML Proofread
|
||||
Text Proofread
|
||||
</el-button>
|
||||
</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">
|
||||
<h4>{{ tabsList[0].name }}</h4>
|
||||
<div class="liter_ture" v-if="0 == 2">
|
||||
@@ -401,7 +404,8 @@ import { quillEditor } from 'vue-quill-editor';
|
||||
import { Loading } from 'element-ui';
|
||||
import timetalk from './time_talk';
|
||||
export default {
|
||||
data() {
|
||||
props:['type'],
|
||||
data() {
|
||||
return {
|
||||
feeStatus: null,
|
||||
isShowCommit: false,
|
||||
@@ -452,7 +456,7 @@ export default {
|
||||
// rongCont: 'Modify the article body.'
|
||||
// },
|
||||
{
|
||||
name: 'Html',
|
||||
name: 'Text Proofread',
|
||||
refName: 'setTwoRef',
|
||||
rongCont: 'HTML layout.'
|
||||
}
|
||||
@@ -1668,12 +1672,11 @@ export default {
|
||||
|
||||
// 6----校对文章
|
||||
htmlContet() {
|
||||
this.$router.push({
|
||||
path: '/GenerateCharts',
|
||||
window.open(this.$router.resolve({ path: '/GenerateCharts',
|
||||
query: {
|
||||
id: this.$route.query.id
|
||||
}
|
||||
});
|
||||
} }).href, '_blank');
|
||||
|
||||
},
|
||||
|
||||
// 6----修改时间为年月日
|
||||
|
||||
2780
src/components/page/PreIngestedEditorProduce.vue
Normal file
@@ -103,7 +103,7 @@
|
||||
<el-table-column type="index" label="No." width="55" align="center"></el-table-column>
|
||||
<el-table-column label="state" width="55" align="center">
|
||||
<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>
|
||||
</span>
|
||||
<span class="status warn" v-else >
|
||||
|
||||
3398
src/components/page/articleAdd - 副本.vue
Normal file
@@ -56,8 +56,9 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Major :" :required="true" prop="major_a">
|
||||
<el-select
|
||||
<el-form-item label="Research areas :" prop="major">
|
||||
<common-major-list :list="majorValueList" @load="(e)=>this.majorValueList=e"></common-major-list>
|
||||
<!-- <el-select
|
||||
v-model="form.major_a"
|
||||
placeholder="Please select major"
|
||||
@change="majorChange(1)"
|
||||
@@ -99,7 +100,7 @@
|
||||
:label="item.major_title"
|
||||
:value="item.major_id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="Manuscript Title :" prop="title">
|
||||
<el-input v-model="form.title" placeholder="Please enter title"></el-input>
|
||||
@@ -966,6 +967,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
majorValueList:[],
|
||||
baseUrl: this.Common.baseUrl,
|
||||
usercap: localStorage.getItem('U_role'),
|
||||
ms_alias: localStorage.getItem('ms_journal_alias'),
|
||||
@@ -1194,11 +1196,21 @@ export default {
|
||||
}
|
||||
],
|
||||
major: [
|
||||
{
|
||||
required: true,
|
||||
message: 'Please select major',
|
||||
trigger: 'blur'
|
||||
}
|
||||
{
|
||||
required: true,
|
||||
validator: (rule, value, callback) => {
|
||||
console.log('value at line 1202:', this.form);
|
||||
var major=this.majorValueList.map(item => item.selectedValue[item.selectedValue.length - 1]).toString(',')
|
||||
if (major=='') {
|
||||
callback(new Error('Please select the Research areas'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
// 如果你需要在此处使用 this 访问 Vue 实例的数据,使用箭头函数保持上下文
|
||||
// 其他逻辑
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
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) => {
|
||||
if (valid) {
|
||||
if (e == 1) {
|
||||
@@ -2617,7 +2633,13 @@ export default {
|
||||
}
|
||||
}
|
||||
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) => {
|
||||
|
||||
if (res.code == 0) {
|
||||
this.stagingID = res.data.article_id;
|
||||
this.form.article_id = res.data.article_id;
|
||||
@@ -2702,8 +2724,15 @@ export default {
|
||||
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.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) => {
|
||||
|
||||
if (res.code == 0) {
|
||||
this.stagingID = res.data.article_id;
|
||||
this.form.article_id = res.data.article_id;
|
||||
@@ -2840,44 +2869,48 @@ export default {
|
||||
console.log(res.data.base);
|
||||
// this.form.topics = res.data.base.topics
|
||||
// 领域
|
||||
this.$api
|
||||
.post('api/Major/getMajorForAddArticle', {
|
||||
journal_id: this.form.journal,
|
||||
major_id: 1
|
||||
})
|
||||
.then((res) => {
|
||||
this.majors_a = res.data.majors;
|
||||
});
|
||||
this.form.major_a = res.data.major.major_id;
|
||||
this.$api
|
||||
.post('api/Major/getMajorForAddArticle', {
|
||||
journal_id: this.form.journal,
|
||||
major_id: this.form.major_a
|
||||
})
|
||||
.then((ref) => {
|
||||
this.majors_b = ref.data.majors;
|
||||
this.majors_c = [];
|
||||
this.form.major_b = '';
|
||||
this.form.major_c = '';
|
||||
this.majorChange_panduan();
|
||||
if (res.data.major.child != undefined) {
|
||||
this.form.major_b = res.data.major.child.major_id;
|
||||
this.$api
|
||||
.post('api/Major/getMajorForAddArticle', {
|
||||
journal_id: this.form.journal,
|
||||
major_id: this.form.major_b
|
||||
})
|
||||
.then((ref) => {
|
||||
this.majors_c = ref.data.majors;
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
this.majorValueList = res.data.majors.map(item => ({
|
||||
|
||||
selectedValue: Array.isArray(item.major) ? item.major : (typeof item.major === 'string' ? item.major.split(',').map(Number) : [item.major])
|
||||
})); console.log('this.majorValueList at line 2853:', this.majorValueList)
|
||||
// this.$api
|
||||
// .post('api/Major/getMajorForAddArticle', {
|
||||
// journal_id: this.form.journal,
|
||||
// major_id: 1
|
||||
// })
|
||||
// .then((res) => {
|
||||
// this.majors_a = res.data.majors;
|
||||
// });
|
||||
// this.form.major_a = res.data.major.major_id;
|
||||
// this.$api
|
||||
// .post('api/Major/getMajorForAddArticle', {
|
||||
// journal_id: this.form.journal,
|
||||
// major_id: this.form.major_a
|
||||
// })
|
||||
// .then((ref) => {
|
||||
// this.majors_b = ref.data.majors;
|
||||
// this.majors_c = [];
|
||||
// this.form.major_b = '';
|
||||
// this.form.major_c = '';
|
||||
// this.majorChange_panduan();
|
||||
// if (res.data.major.child != undefined) {
|
||||
// this.form.major_b = res.data.major.child.major_id;
|
||||
// this.$api
|
||||
// .post('api/Major/getMajorForAddArticle', {
|
||||
// journal_id: this.form.journal,
|
||||
// major_id: this.form.major_b
|
||||
// })
|
||||
// .then((ref) => {
|
||||
// this.majors_c = ref.data.majors;
|
||||
// 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(',');
|
||||
this.keywordsList = [];
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<p v-if="form.special_num > 0">
|
||||
<font>Special Issues :</font><b>{{ form.special_title }}</b>
|
||||
</p>
|
||||
|
||||
|
||||
<el-collapse class="auth_colla auth_collna_ew">
|
||||
<el-collapse-item :title="authorList_name" name="1">
|
||||
<div v-for="(item, index) in form.authorList" class="auth_mess">
|
||||
@@ -108,6 +108,7 @@
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<el-collapse class="auth_colla auth_collna_ew" style="margin-top: -15px">
|
||||
<el-collapse-item name="2">
|
||||
<template slot="title">
|
||||
@@ -126,6 +127,42 @@
|
||||
</p>
|
||||
</el-collapse-item>
|
||||
</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 class="art_file_">
|
||||
@@ -178,7 +215,7 @@
|
||||
<h4>Manuscirpt :</h4>
|
||||
<p class="fi_new">
|
||||
<!-- <template v-for="item in manuscirptFileList"> -->
|
||||
<!-- <a href="#">
|
||||
<!-- <a href="#">
|
||||
<img
|
||||
src="../../assets/img/icon_0.png"
|
||||
@click="openDrawer(item, mediaUrl + item.file_url)"
|
||||
@@ -193,14 +230,14 @@
|
||||
<i class="el-icon-download download"></i>
|
||||
</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" />
|
||||
<span>
|
||||
<font>Uploader : </font>{{ form.username }}
|
||||
<i><i class="el-icon-time"></i>{{ formatDate(item.ctime) }}</i>
|
||||
</span>
|
||||
<i class="el-icon-download download"></i>
|
||||
</a>
|
||||
</a>
|
||||
<!-- </template> -->
|
||||
</p>
|
||||
<br clear="both" />
|
||||
@@ -241,12 +278,8 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<common-word-html
|
||||
:articleId="$route.query.id"
|
||||
style=" box-sizing: border-box"
|
||||
|
||||
|
||||
></common-word-html>
|
||||
|
||||
<common-word-html :articleId="$route.query.id" style="box-sizing: border-box"></common-word-html>
|
||||
</div>
|
||||
<!-- 被拒稿件操作 --->
|
||||
<div class="art_caozuo_" v-if="opname == 'rejectArticles'">
|
||||
@@ -626,6 +659,7 @@ export default {
|
||||
ad_content: ''
|
||||
},
|
||||
talkMsgs: [],
|
||||
majorsList: [],
|
||||
opname: '', // 稿件详细类型
|
||||
editorJournalList: [], // 编辑期刊列表
|
||||
resubmitJournal: {
|
||||
@@ -805,7 +839,7 @@ export default {
|
||||
});
|
||||
},
|
||||
openDrawer(data, url) {
|
||||
console.log('url at line 799:',data, url)
|
||||
console.log('url at line 799:', data, url);
|
||||
this.previewData = {
|
||||
...data,
|
||||
previewUrl: url,
|
||||
@@ -899,7 +933,29 @@ export default {
|
||||
|
||||
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() {
|
||||
if (this.form.state == 0) {
|
||||
@@ -948,7 +1004,16 @@ export default {
|
||||
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() {
|
||||
this.now_year = new Date().getFullYear();
|
||||
@@ -957,7 +1022,9 @@ export default {
|
||||
articleId: this.editform.articleId,
|
||||
human: 'editor'
|
||||
})
|
||||
|
||||
.then((res) => {
|
||||
this.initMajor();
|
||||
this.form.username = res.article.account;
|
||||
this.form.title = res.article.title;
|
||||
this.form.journal = res.article.journal_id;
|
||||
|
||||
@@ -961,7 +961,7 @@
|
||||
"
|
||||
>
|
||||
<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>
|
||||
</el-drawer>
|
||||
|
||||
|
||||
@@ -420,11 +420,13 @@
|
||||
|
||||
<!-- 参考文献 -->
|
||||
<div :ref="tabsList[3].refName" class="scroll-item">
|
||||
<div class="bor_style_onli">
|
||||
|
||||
<div class="bor_style_onli">
|
||||
<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">
|
||||
<!-- 1 -->
|
||||
|
||||
<div :class="showB_step ==1?'C_style':''">
|
||||
<h3><span>1</span>Check References and Doi</h3>
|
||||
<div v-if="showB_step ==1">
|
||||
@@ -454,7 +456,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2 -->
|
||||
|
||||
<div :class="showB_step ==2?'C_style':''">
|
||||
<h3><span>2</span>Check Standard</h3>
|
||||
<div v-if="showB_step ==2">
|
||||
@@ -532,8 +534,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-progress :text-inside="true" :stroke-width="24" :percentage="refReal"
|
||||
@@ -544,7 +545,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -828,12 +829,15 @@
|
||||
import 'quill/dist/quill.core.css';
|
||||
import 'quill/dist/quill.snow.css';
|
||||
import 'quill/dist/quill.bubble.css';
|
||||
|
||||
import {
|
||||
quillEditor
|
||||
} from 'vue-quill-editor';
|
||||
import {
|
||||
Loading
|
||||
} from 'element-ui';
|
||||
import PreIngestedEditorProduce from './PreIngestedEditorProduce.vue'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -2738,7 +2742,7 @@
|
||||
},
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
quillEditor,PreIngestedEditorProduce
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
getDate() {console.log('at line 189:',localStorage.getItem('U_pointJour') )
|
||||
this.$api
|
||||
.post('api/Article/getJournal', {
|
||||
// username: this.query.username
|
||||
username: this.query.username
|
||||
})
|
||||
.then((res) => {
|
||||
this.jourList = res;
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
<p v-html="scope.row.title"></p>
|
||||
</template>
|
||||
</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">
|
||||
<p style="cursor: pointer; color: #006699 !important" @click="goCite(scope.row)">
|
||||
{{ 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>
|
||||
</span>
|
||||
</span> -->
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -80,14 +80,37 @@
|
||||
<p v-html="scope.row.sort"></p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="" width="190px" align="center">
|
||||
<el-table-column label="" width="220px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="EditDetail(scope.row)"> Edit</el-button>
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-notebook-2" @click="htmlContet(scope.row)"> Html</el-button>
|
||||
<p style="margin-top: 10px">
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-tickets" @click="ChoseRelated(scope.row)">
|
||||
Relevant</el-button
|
||||
<p style="display: flex; align-items: center; justify-content: space-around">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -281,12 +304,12 @@
|
||||
<span style="margin-left: 15px; color: #0b4b6a" v-if="mains != ''">Typesetting completed</span>
|
||||
<template v-if="mains != ''">
|
||||
<el-button
|
||||
v-if="html_type == 2&&tg_article_id!=0"
|
||||
v-if="html_type == 2 && tg_article_id != 0"
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-document-copy"
|
||||
@click.stop
|
||||
@click=" htmlLayout2()"
|
||||
@click="htmlLayout2()"
|
||||
style="margin-left: 20px"
|
||||
>
|
||||
<font>Edit Html Proofread</font>
|
||||
@@ -367,10 +390,12 @@
|
||||
</div>
|
||||
<div class="titHtml titHtml1" v-if="htmlContent && html_type == 2">
|
||||
<common-word
|
||||
:readonly="true"
|
||||
:isPreview="true"
|
||||
v-if="htmlContent"
|
||||
ref="commonWord"
|
||||
:value="htmlContent"
|
||||
:contentList="mains"
|
||||
|
||||
:wordStyle="wordStyle"
|
||||
style="width: calc(100%); height: 50vh"
|
||||
:style="`100%`"
|
||||
@@ -410,24 +435,24 @@
|
||||
<el-table-column type="index" align="center" width="50"> </el-table-column>
|
||||
<el-table-column label="CONTENT" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p class="wrongLine" style="text-align: left" v-if="scope.row.author == ''">
|
||||
{{ scope.row.refer_frag }}
|
||||
</p>
|
||||
<div v-else>
|
||||
<div style="text-align: left" v-if="scope.row.refer_type == 'journal'">
|
||||
<p>
|
||||
{{ scope.row.author }},{{ scope.row.title }}, <em>{{ scope.row.joura }}</em> ,{{
|
||||
scope.row.dateno
|
||||
}}<br />
|
||||
</p>
|
||||
<a class="doiLink" :href="scope.row.doilink" target="_blank">{{ scope.row.doilink }}</a>
|
||||
<p class="wrongLine" style="text-align: left" v-if="scope.row.author == ''">
|
||||
{{ scope.row.refer_frag }}
|
||||
</p>
|
||||
<div v-else>
|
||||
<div style="text-align: left" v-if="scope.row.refer_type == 'journal'">
|
||||
<p>
|
||||
{{ scope.row.author }},{{ scope.row.title }}, <em>{{ scope.row.joura }}</em> ,{{
|
||||
scope.row.dateno
|
||||
}}<br />
|
||||
</p>
|
||||
<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 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>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -1001,104 +1026,71 @@ export default {
|
||||
});
|
||||
},
|
||||
getWord() {
|
||||
var htmlContent = ``;
|
||||
htmlContent += this.mains
|
||||
.map((item) => {
|
||||
//批注
|
||||
let contentHtml = '';
|
||||
var isRemark = ``;
|
||||
// var htmlContent = ``;
|
||||
// htmlContent += this.mains
|
||||
// .map((item) => {
|
||||
// //批注
|
||||
// let contentHtml = '';
|
||||
// var isRemark = ``;
|
||||
|
||||
// 判断是否是图片
|
||||
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>
|
||||
// // 判断是否是图片
|
||||
// if (item.type == 1) {
|
||||
// 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 +'articleImage/'+ 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 if (item.type == 2) {
|
||||
// var tableList = JSON.parse(item.table.table_data);
|
||||
|
||||
<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>`;
|
||||
// }
|
||||
|
||||
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;
|
||||
// return contentHtml;
|
||||
// })
|
||||
// .join('');
|
||||
this.htmlContent = 'true';
|
||||
|
||||
},
|
||||
getMainsInfo2(e) {
|
||||
this.loadHtml = true;
|
||||
@@ -1109,11 +1101,12 @@ export default {
|
||||
.then((res) => {
|
||||
this.loadHtml = false;
|
||||
if (res.code == 0) {
|
||||
// console.log(res,'res')
|
||||
console.log(res,'res')
|
||||
|
||||
this.mains = '';
|
||||
if (res.data.list.length > 0) {
|
||||
this.mains = res.data.list;
|
||||
console.log('this.mains at line 1108:', this.mains)
|
||||
this.getWord();
|
||||
} else {
|
||||
this.mains = '';
|
||||
@@ -1156,37 +1149,42 @@ export default {
|
||||
},
|
||||
// 文章html弹出层
|
||||
async htmlContet(e) {
|
||||
console.log('e at line 1151:', e)
|
||||
this.htmlContent=''
|
||||
this.articleId = e.article_id;
|
||||
this.tg_article_id = e.tg_article_id;
|
||||
// this.articleId = '3444';
|
||||
this.UpHtpFIle.article_id = e.article_id;
|
||||
|
||||
this.refersList = await this.getRefersList();
|
||||
// this.UpHtpFIle.refers = e.refers
|
||||
this.UpHtpFIle.p_article_id = e.p_article_id;
|
||||
this.UpHtpFIle.doi = e.doi;
|
||||
this.UpHtpFIle.htmlfile = e.file_html;
|
||||
this.UpHtpFIle.title = e.title;
|
||||
this.UpHtpFIle.mains = e.mains;
|
||||
this.UpLoadFile.article_id = e.article_id;
|
||||
this.html_type = e.html_type;
|
||||
// this.html_type = 2;
|
||||
|
||||
if (this.html_type == 2) {
|
||||
if (e.has_html == 1) {
|
||||
await this.getMainsInfo2();
|
||||
|
||||
this.HtmlVisible = true;
|
||||
} else {
|
||||
this.mains = '';
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
} else {
|
||||
await this.getMainsInfo(e);
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
await this.$api
|
||||
.post('api/Publish/getPublishArticleDetail', {
|
||||
article_id: e.article_id
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
console.log('res.code at line 1148:', res.code);
|
||||
this.html_type = res.data.detail.html_type;
|
||||
if (this.html_type == 2) {
|
||||
if ( res.data.detail.has_html == 1) {
|
||||
await this.getMainsInfo2();
|
||||
this.HtmlVisible = true;
|
||||
} else {
|
||||
this.mains = '';
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
} else {
|
||||
await this.getMainsInfo(e);
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 生成html
|
||||
// CreateHtml(){
|
||||
// const loading = this.$loading({
|
||||
@@ -1206,6 +1204,7 @@ export default {
|
||||
// this.htmlLayout()
|
||||
// }
|
||||
// })
|
||||
|
||||
// },
|
||||
// 修改文章html
|
||||
async htmlLayout2(type) {
|
||||
@@ -1217,16 +1216,21 @@ export default {
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
await this.creatMains();
|
||||
this.html_type = 2;
|
||||
await this.getMainsInfo2();
|
||||
loading.close();
|
||||
} else {
|
||||
this.HtmlVisible = false;
|
||||
this.$router.push({
|
||||
path: '/GenerateCharts',
|
||||
query: {
|
||||
id: this.tg_article_id
|
||||
}
|
||||
});
|
||||
window.open(this.$router.resolve({ path: '/GenerateCharts',
|
||||
query: {
|
||||
id: this.tg_article_id
|
||||
} }).href, '_blank');
|
||||
// this.$router.push({
|
||||
// path: '/GenerateCharts',
|
||||
// query: {
|
||||
// id: this.tg_article_id
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
htmlLayout() {
|
||||
|
||||
@@ -1022,13 +1022,14 @@ export default {
|
||||
str = 'With reviewer';
|
||||
break;
|
||||
case 1:
|
||||
str = 'Revision';
|
||||
str = 'Major';
|
||||
break;
|
||||
case 2:
|
||||
str = 'Reject';
|
||||
break;
|
||||
case 3:
|
||||
str = 'Accept';
|
||||
// str = 'Accept';
|
||||
str = 'Minor';
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
|
||||
299
src/components/page/comArtHtmlCreatNew copy.vue
Normal 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>
|
||||
@@ -68,9 +68,7 @@ const tableStyle = ` b span{
|
||||
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;
|
||||
text-align: justify !important; // 设置两端对齐
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ const tableStyle = ` b span{
|
||||
border-left:1px dashed #dcdfe6 !important;
|
||||
border-right:1px dashed #dcdfe6 !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 {
|
||||
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;;
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -133,11 +140,7 @@ export default {
|
||||
},
|
||||
isEdit: {},
|
||||
toolbar: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
required: false
|
||||
},
|
||||
menubar: {
|
||||
default: 'file edit insert view format table '
|
||||
@@ -154,6 +157,10 @@ export default {
|
||||
},
|
||||
isShowArtWorkButton: {
|
||||
default: false
|
||||
},
|
||||
wordStyle: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -262,9 +269,11 @@ export default {
|
||||
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
initTinymce() {
|
||||
const _this = this;
|
||||
var _this = this;
|
||||
window.tinymce.init({
|
||||
inline: false, // 使用 iframe 模式
|
||||
selector: `#${this.tinymceId}`,
|
||||
content_css: false, // 禁用默认样式
|
||||
table_resize_bars: true, // 启用拖动调整功能
|
||||
@@ -329,17 +338,19 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
content_style: `${tableStyle} table span blue {
|
||||
color: rgb(0, 130, 170) !important;
|
||||
}blue {
|
||||
color: rgb(0, 130, 170) !important;
|
||||
}`,
|
||||
content_style: `
|
||||
${tableStyle}
|
||||
${_this.wordStyle}
|
||||
|
||||
|
||||
|
||||
|
||||
`,
|
||||
|
||||
formats: {
|
||||
bold: { inline: 'b' },
|
||||
italic: { inline: 'i' }
|
||||
},
|
||||
|
||||
body_class: 'panel-body ',
|
||||
object_resizing: false,
|
||||
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
||||
@@ -347,112 +358,20 @@ export default {
|
||||
statusbar: false, // 关闭底部状态栏
|
||||
custom_colors: false,
|
||||
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,
|
||||
content_css: 'default', // 加载 TinyMCE 默认样式表
|
||||
mathjax: {
|
||||
// 配置 MathJax 用于渲染数学公式
|
||||
path: 'https://cdn.mathjax.org/mathjax/latest/MathJax.js',
|
||||
config: 'TeX-AMS-MML_HTMLorMML'
|
||||
},
|
||||
//设置自定义按钮 myCustomToolbarButton
|
||||
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', {
|
||||
text: 'Word',
|
||||
icon: 'import-word', // 使用自定义图标
|
||||
@@ -478,47 +397,51 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
ed.ui.registry.addMenuButton('customDropdown', {
|
||||
text: _this.$t('commonTable.PaperRotation'), // 下拉框标题
|
||||
fetch: function (callback) {
|
||||
// 定义下拉框的内容
|
||||
const items = [..._this.typesettingTypeOptions];
|
||||
const menuItems = items.map((item) => ({
|
||||
type: 'menuitem',
|
||||
text: item.label,
|
||||
onAction: function () {
|
||||
_this.typesettingType = item.value;
|
||||
_this.changeTable();
|
||||
// ed.execCommand(item.value); // 执行命令
|
||||
}
|
||||
}));
|
||||
callback(menuItems);
|
||||
}
|
||||
});
|
||||
// ed.ui.registry.addMenuButton('customDropdown', {
|
||||
// text: _this.$t('commonTable.PaperRotation'), // 下拉框标题
|
||||
// fetch: function (callback) {
|
||||
// // 定义下拉框的内容
|
||||
// const items = [..._this.typesettingTypeOptions];
|
||||
// const menuItems = items.map((item) => ({
|
||||
// type: 'menuitem',
|
||||
// text: item.label,
|
||||
// onAction: function () {
|
||||
// _this.typesettingType = item.value;
|
||||
// _this.changeTable();
|
||||
// // ed.execCommand(item.value); // 执行命令
|
||||
// }
|
||||
// }));
|
||||
// callback(menuItems);
|
||||
// }
|
||||
// });
|
||||
|
||||
ed.on('init', function () {
|
||||
_this.$commonJS.inTinymceButtonClass();
|
||||
const editorBody = ed.getBody();
|
||||
// 创建 MutationObserver 监听内容变化
|
||||
const observer = new MutationObserver(() => {
|
||||
const currentContent = ed.getContent();
|
||||
|
||||
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 });
|
||||
});
|
||||
// 定义自定义按钮
|
||||
ed.ui.registry.addButton('clearButton', {
|
||||
text: 'Empty',
|
||||
// // 定义自定义按钮
|
||||
// ed.ui.registry.addButton('clearButton', {
|
||||
// text: 'Empty',
|
||||
|
||||
onAction: () => {
|
||||
// 插入自定义表格到编辑器中
|
||||
ed.setContent('');
|
||||
}
|
||||
});
|
||||
// onAction: () => {
|
||||
// // 插入自定义表格到编辑器中
|
||||
// ed.setContent('');
|
||||
// }
|
||||
// });
|
||||
|
||||
// 定义自定义按钮
|
||||
ed.ui.registry.addButton('customButtonExportWord', {
|
||||
@@ -590,13 +513,16 @@ export default {
|
||||
window.tinymce.get(this.tinymceId).setContent(value);
|
||||
},
|
||||
//获取内容
|
||||
getContent(type) {
|
||||
async getContent(type) {
|
||||
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(/<em>/g, '<i>').replace(/<\/em>/g, '</i>');
|
||||
content = content.replace(/ /g, ' '); // 将所有 替换为空格
|
||||
this.$emit('getContent', type, content);
|
||||
console.log('window.tinymce.get(this.tinymceId).getContent() at line 431:', content);
|
||||
this.$emit('getContent', type, content);
|
||||
|
||||
},
|
||||
|
||||
async export(type, data) {
|
||||
|
||||
@@ -131,10 +131,12 @@
|
||||
</div>
|
||||
<div class="titHtml titHtml1" v-if="htmlContent && html_type == 2">
|
||||
<common-word
|
||||
:readonly="true"
|
||||
v-if="htmlContent"
|
||||
ref="commonWord"
|
||||
:value="htmlContent"
|
||||
:isPreview="true"
|
||||
v-if="htmlContent"
|
||||
ref="commonWord"
|
||||
:value="htmlContent"
|
||||
:contentList="mains"
|
||||
|
||||
:wordStyle="wordStyle"
|
||||
style="width: calc(100%); height: 50vh"
|
||||
:style="`100%`"
|
||||
@@ -755,104 +757,70 @@ export default {
|
||||
});
|
||||
},
|
||||
getWord() {
|
||||
var htmlContent = ``;
|
||||
htmlContent += this.mains
|
||||
.map((item) => {
|
||||
//批注
|
||||
let contentHtml = '';
|
||||
var isRemark = ``;
|
||||
// var htmlContent = ``;
|
||||
// htmlContent += this.mains
|
||||
// .map((item) => {
|
||||
// //批注
|
||||
// let contentHtml = '';
|
||||
// var isRemark = ``;
|
||||
|
||||
// 判断是否是图片
|
||||
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>
|
||||
// // 判断是否是图片
|
||||
// if (item.type == 1) {
|
||||
// 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 +'articleImage/'+ 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 if (item.type == 2) {
|
||||
// var tableList = JSON.parse(item.table.table_data);
|
||||
|
||||
<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>`;
|
||||
// }
|
||||
|
||||
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;
|
||||
// return contentHtml;
|
||||
// })
|
||||
// .join('');
|
||||
this.htmlContent = 'true';
|
||||
console.log('this.htmlContent at line 820:', this.htmlContent)
|
||||
},
|
||||
getMainsInfo2(e) {
|
||||
this.loadHtml = true;
|
||||
@@ -910,38 +878,43 @@ export default {
|
||||
},
|
||||
// 文章html弹出层
|
||||
async htmlContet(e) {
|
||||
console.log('e at line 923:', e);
|
||||
this.htmlContent=''
|
||||
this.articleId = e.article_id;
|
||||
this.tg_article_id = e.tg_article_id;
|
||||
// this.articleId = '3444';
|
||||
this.UpHtpFIle.article_id = e.article_id;
|
||||
|
||||
this.refersList = await this.getRefersList();
|
||||
// this.UpHtpFIle.refers = e.refers
|
||||
this.UpHtpFIle.p_article_id = e.p_article_id;
|
||||
this.UpHtpFIle.doi = e.doi;
|
||||
this.UpHtpFIle.htmlfile = e.file_html;
|
||||
this.UpHtpFIle.title = e.title;
|
||||
this.UpHtpFIle.mains = e.mains;
|
||||
this.UpLoadFile.article_id = e.article_id;
|
||||
this.html_type = e.html_type;
|
||||
// this.html_type = 2;
|
||||
|
||||
if (this.html_type == 2) {
|
||||
if (e.has_html == 1) {
|
||||
await this.getMainsInfo2();
|
||||
|
||||
this.HtmlVisible = true;
|
||||
} else {
|
||||
this.mains = '';
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
} else {
|
||||
await this.getMainsInfo(e);
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
await this.$api
|
||||
.post('api/Publish/getPublishArticleDetail', {
|
||||
article_id: e.article_id
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
console.log('res.code at line 1148:', res.code);
|
||||
this.html_type = res.data.detail.html_type;
|
||||
if (this.html_type == 2) {
|
||||
if ( res.data.detail.has_html == 1) {
|
||||
await this.getMainsInfo2();
|
||||
this.HtmlVisible = true;
|
||||
} else {
|
||||
this.mains = '';
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
} else {
|
||||
await this.getMainsInfo(e);
|
||||
this.HtmlVisible = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 生成html
|
||||
// CreateHtml(){
|
||||
// const loading = this.$loading({
|
||||
@@ -972,16 +945,21 @@ export default {
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
await this.creatMains();
|
||||
this.html_type=2;
|
||||
await this.getMainsInfo2();
|
||||
loading.close();
|
||||
} else {
|
||||
this.HtmlVisible = false;
|
||||
this.$router.push({
|
||||
path: '/GenerateCharts',
|
||||
query: {
|
||||
id: this.tg_article_id
|
||||
}
|
||||
});
|
||||
window.open(this.$router.resolve({ path: '/GenerateCharts',
|
||||
query: {
|
||||
id: this.tg_article_id
|
||||
} }).href, '_blank');
|
||||
// this.$router.push({
|
||||
// path: '/GenerateCharts',
|
||||
// query: {
|
||||
// id: this.tg_article_id
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
htmlLayout() {
|
||||
|
||||
201
src/components/page/components/major/index.vue
Normal 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>
|
||||
207
src/components/page/components/major/list.vue
Normal 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>
|
||||
1022
src/components/page/components/table/comment.vue
Normal file
@@ -1,42 +1,51 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
<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; /* 字体大小 */
|
||||
<!--uploadWord |customButtonExportWord |customButtonExportImg -->
|
||||
|
||||
margin-top: 0pt; /* 段前间距 */
|
||||
margin-bottom: 0pt; /* 段后间距 */
|
||||
"
|
||||
></tinymce>
|
||||
<tinymce
|
||||
type="table"
|
||||
:height="height"
|
||||
: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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Tinymce from '@/components/page/components/Tinymce';
|
||||
export default {
|
||||
props: ['lineStyle'],
|
||||
props: ['value','isAutomaticUpdate','height','id'],
|
||||
components: {
|
||||
Tinymce
|
||||
},
|
||||
watch: {
|
||||
lineStyle() {}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
identity: localStorage.getItem('U_role'),
|
||||
showToolbar: false, // 是否显示工具栏
|
||||
toolbarStyle: {
|
||||
top: '0px',
|
||||
@@ -50,20 +59,30 @@ export default {
|
||||
{ label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 }
|
||||
],
|
||||
transform: null,
|
||||
typesettingType: 1
|
||||
typesettingType: 1,
|
||||
wordStyle: ``
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.typesettingType = 1;
|
||||
if (this.lineStyle) {
|
||||
console.log('newVal at line 37:', this.lineStyle);
|
||||
|
||||
} else {
|
||||
this.updatedHtml = '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
updateChange(content){
|
||||
this.$emit('updateChange',content)
|
||||
},
|
||||
getTinymceContent(type) {
|
||||
this.$refs.tinymceChild1.getContent(type);
|
||||
},
|
||||
getContent(type, content) {
|
||||
|
||||
|
||||
|
||||
|
||||
this.$emit('getContent', type, content);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -111,7 +130,7 @@ td input ::placeholder {
|
||||
::v-deep .paste-area {
|
||||
height: auto; /* A4纸高度 */
|
||||
background: white; /* 纸张背景 */
|
||||
|
||||
|
||||
/* padding: 25.4mm 19.1mm; //内边距 */
|
||||
box-sizing: border-box; /* 确保内边距不会影响整体尺寸 */
|
||||
transform-origin: top left;
|
||||
@@ -141,8 +160,5 @@ td input ::placeholder {
|
||||
overflow-wrap: break-word !important;
|
||||
}
|
||||
.text-container {
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
1320
src/components/page/components/table/editTable.vue
Normal file
@@ -2,17 +2,16 @@
|
||||
<div>
|
||||
<div>
|
||||
<!--uploadWord |customButtonExportWord |customButtonExportImg -->
|
||||
|
||||
|
||||
<tinymce
|
||||
type="table"
|
||||
type="table"
|
||||
ref="tinymceChild1"
|
||||
:wordStyle="wordStyle"
|
||||
@getContent="getContent"
|
||||
:value="updatedHtml"
|
||||
:typesettingType="typesettingType"
|
||||
class="paste-area text-container"
|
||||
:toolbar="`undo redo | formatselect | bold italic ${
|
||||
identity ? '| customBlue removeBlue' : ''
|
||||
} |subscript superscript|table tabledelete ${identity ? '| customDropdown' : ''} | clearButton`"
|
||||
:toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|table tabledelete| searchreplace |clearButton']"
|
||||
style="
|
||||
/* white-space: pre-line; */
|
||||
line-height: 12px;
|
||||
@@ -25,7 +24,6 @@
|
||||
margin-bottom: 0pt; /* 段后间距 */
|
||||
"
|
||||
></tinymce>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -57,7 +55,9 @@ export default {
|
||||
{ label: this.$t('commonTable.typesettingType2'), value: 2, pageWidth: 297 }
|
||||
],
|
||||
transform: null,
|
||||
typesettingType: 1
|
||||
typesettingType: 1,
|
||||
wordStyle: `
|
||||
`
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -76,8 +76,8 @@ export default {
|
||||
text-align: center;
|
||||
table-layout: auto;"
|
||||
>`;
|
||||
this.tableData.forEach((row) => {
|
||||
modalContent += `<tr>`;
|
||||
this.tableData.forEach((row,i) => {
|
||||
modalContent += `<tr class="${this.isHeaderRow(i,this.tableData)?'table-header-row':''}">`;
|
||||
row.forEach((cell) => {
|
||||
modalContent += `
|
||||
<td
|
||||
@@ -100,16 +100,24 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isHeaderRow(rowIndex,table) {
|
||||
|
||||
|
||||
var head=table[0]
|
||||
|
||||
|
||||
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
||||
},
|
||||
getTableContent(type) {
|
||||
this.$refs.tinymceChild1.getContent(type);
|
||||
},
|
||||
getContent(type, content) {
|
||||
if (content) {
|
||||
const container = document.createElement("div");
|
||||
container.innerHTML = content;
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = content;
|
||||
this.$commonJS.parseTableToArray(content, (table) => {
|
||||
console.log('res at line 104:', table);
|
||||
|
||||
|
||||
this.$emit('getContent', type, { html_data: content, table: table });
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -202,7 +202,8 @@
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
<tr v-for="(row, rowIndex) in table.table" :key="rowIndex">
|
||||
<tr v-for="(row, rowIndex) in table.table" :key="rowIndex" >
|
||||
|
||||
<td
|
||||
v-for="(cell, cellIndex) in row"
|
||||
:key="cellIndex"
|
||||
@@ -324,7 +325,7 @@ export default {
|
||||
this.filterData();
|
||||
},
|
||||
filterData(type) {
|
||||
console.log('type at line 374:', type);
|
||||
|
||||
if (type) {
|
||||
if (type == 'img') {
|
||||
this.imagesList = [...this.images];
|
||||
@@ -541,7 +542,7 @@ export default {
|
||||
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 {
|
||||
cursor: pointer;
|
||||
background-color: #fff !important;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
}
|
||||
.el-menu-vertical-demo {
|
||||
width: 85px;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<!-- v-show="tables.length > 0 || images.length > 0" -->
|
||||
<!-- v-show="tables.length > 0 || images.length > 0" -->
|
||||
<div
|
||||
style="background-color: transparent !important; margin-top: 0px !important; height: 100%; padding: 0 !important; overflow: hidden"
|
||||
class="ManuscirptList"
|
||||
|
||||
>
|
||||
<!-- 图片缩略图区域 -->
|
||||
|
||||
@@ -16,20 +15,20 @@
|
||||
class="el-menu-vertical-demo"
|
||||
@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>
|
||||
<span slot="title" style="line-height: 30px">Annotations</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="2">
|
||||
</el-menu-item> -->
|
||||
<el-menu-item index="1">
|
||||
<i class="el-icon-picture" color="#333639" style="margin: 0 auto"></i>
|
||||
<span slot="title" style="line-height: 20px">Figures</span>
|
||||
</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>
|
||||
<span slot="title" style="line-height: 30px">Tables</span>
|
||||
</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>
|
||||
<span slot="title" style="line-height: 30px">Recycle Bin</span>
|
||||
</el-menu-item>
|
||||
@@ -54,7 +53,7 @@
|
||||
</ul> -->
|
||||
<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">
|
||||
<li v-show="currentMenu == 1">
|
||||
<!-- <li v-show="currentMenu == 1">
|
||||
<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">
|
||||
<div @click.prevent="goToComment(comment.am_id)">
|
||||
@@ -74,18 +73,9 @@
|
||||
<span style="color: #b8b7b7;font-size: 12px">{{ getTime(comment.ctime) }}</span>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<!-- 删除按钮 -->
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</li>
|
||||
<li v-show="currentMenu == 2">
|
||||
</li> -->
|
||||
<li v-show="currentMenu == 1">
|
||||
<div style="" class="go-content-charts-item-box">
|
||||
<div class="item_box" style="width: 100%; height: auto; position: relative">
|
||||
<el-collapse v-if="isShowEdit">
|
||||
@@ -139,6 +129,56 @@
|
||||
<el-link> Figures {{ index + 1 }} </el-link>
|
||||
</p> -->
|
||||
</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
|
||||
class="item_box"
|
||||
v-for="(img, index) in imagesList"
|
||||
@@ -220,7 +260,6 @@
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
||||
<div
|
||||
style="
|
||||
width: 140px;
|
||||
@@ -269,8 +308,57 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li v-show="currentMenu == 3">
|
||||
<li v-show="currentMenu == 2">
|
||||
<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
|
||||
class="item_box"
|
||||
v-for="(table, index) in tablesList"
|
||||
@@ -383,7 +471,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li v-show="currentMenu == 4">
|
||||
<li v-show="currentMenu == 3">
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start">
|
||||
<div
|
||||
v-for="(item, index) in content"
|
||||
@@ -427,7 +515,6 @@ export default {
|
||||
currentMenu: 1,
|
||||
|
||||
mediaUrl,
|
||||
|
||||
|
||||
statusList: [
|
||||
{ title: 'ALL', type: '0' },
|
||||
@@ -476,22 +563,22 @@ export default {
|
||||
},
|
||||
|
||||
// 保存评论修改
|
||||
saveComment(index,comment) {
|
||||
saveComment(index, comment) {
|
||||
if (this.isEditComment) {
|
||||
this.$emit('addComment',comment)
|
||||
this.$emit('addComment', comment);
|
||||
this.isEditing = null; // 退出编辑模式
|
||||
}
|
||||
},
|
||||
onAddComment(comment) {
|
||||
if (this.isEditComment) {
|
||||
this.$emit('onAddComment',comment.am_id)
|
||||
this.$emit('onAddComment', comment.am_id);
|
||||
// this.isEditing = null; // 退出编辑模式
|
||||
}
|
||||
},
|
||||
|
||||
// 删除评论
|
||||
deleteComment(comment, index) {
|
||||
console.log('comment at line 480:', comment)
|
||||
console.log('comment at line 480:', comment);
|
||||
if (this.isEditComment) {
|
||||
this.$confirm(this.$t('commonTable.removeAnnotations'), 'Prompt', {
|
||||
confirmButtonText: 'Submit',
|
||||
@@ -499,14 +586,13 @@ export default {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
this.$api
|
||||
.post('api/Preaccept/clearMainsRemark', {
|
||||
am_id: comment.am_id
|
||||
})
|
||||
.then((res) => {
|
||||
this.getCommentList()
|
||||
});
|
||||
.post('api/Preaccept/clearMainsRemark', {
|
||||
am_id: comment.am_id
|
||||
})
|
||||
.then((res) => {
|
||||
this.getCommentList();
|
||||
});
|
||||
// this.comments.splice(index, 1); // 删除评论
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -545,9 +631,14 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
this.comments = res.data.list;
|
||||
console.log('this.comments at line 537:', this.comments);
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
addImage() {
|
||||
this.$emit('addImage');
|
||||
},
|
||||
addTable() {
|
||||
this.$emit('addTable');
|
||||
},
|
||||
add(type) {
|
||||
this.$emit('add', type);
|
||||
@@ -561,18 +652,18 @@ export default {
|
||||
handleSelectMenu(v) {
|
||||
this.currentMenu = v;
|
||||
this.currentSelectType = '0';
|
||||
if (v == 1) {
|
||||
this.getCommentList();
|
||||
} else {
|
||||
this.filterData();
|
||||
}
|
||||
// if (v == 1) {
|
||||
// this.getCommentList();
|
||||
// } else {
|
||||
this.filterData();
|
||||
// }
|
||||
},
|
||||
selectType(v) {
|
||||
this.currentSelectType = v.type;
|
||||
this.filterData();
|
||||
},
|
||||
filterData(type) {
|
||||
console.log('type at line 374:', type);
|
||||
|
||||
if (type) {
|
||||
if (type == 'img') {
|
||||
this.imagesList = [...this.images];
|
||||
@@ -580,7 +671,7 @@ export default {
|
||||
this.tablesList = [...this.tables];
|
||||
}
|
||||
} else {
|
||||
if (this.currentMenu == 2) {
|
||||
if (this.currentMenu == 1) {
|
||||
switch (this.currentSelectType) {
|
||||
case '0':
|
||||
this.imagesList = [...this.images];
|
||||
@@ -592,7 +683,7 @@ export default {
|
||||
this.imagesList = [...this.images].filter((e) => e.has_selected == 0);
|
||||
break;
|
||||
}
|
||||
} else if (this.currentMenu == 3) {
|
||||
} else if (this.currentMenu == 2) {
|
||||
switch (this.currentSelectType) {
|
||||
case '0':
|
||||
this.tablesList = [...this.tables];
|
||||
@@ -656,7 +747,6 @@ export default {
|
||||
});
|
||||
},
|
||||
onDragStart($event, item, index, type) {
|
||||
console.log('type at line 192:', index);
|
||||
this.$emit('onDragStart', $event, item, index, type);
|
||||
},
|
||||
changeActiveNames(e) {
|
||||
@@ -702,12 +792,10 @@ export default {
|
||||
list.forEach((img, index) => {
|
||||
var extension = img.image.split('.').pop().toLowerCase();
|
||||
// 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;
|
||||
@@ -756,10 +844,12 @@ export default {
|
||||
text-align: center;
|
||||
table-layout: auto;"
|
||||
>`;
|
||||
table.table.forEach((row) => {
|
||||
modalContent += `<tr>`;
|
||||
row.forEach((cell) => {
|
||||
modalContent += `
|
||||
|
||||
if (table.table&&table.table.length > 0) {
|
||||
table.table.forEach((row) => {
|
||||
modalContent += `<tr>`;
|
||||
row.forEach((cell) => {
|
||||
modalContent += `
|
||||
<td
|
||||
colspan="${cell.colspan || 1}"
|
||||
rowspan="${cell.rowspan || 1}"
|
||||
@@ -767,14 +857,16 @@ export default {
|
||||
>
|
||||
<span>${cell.text}</span>
|
||||
</td>`;
|
||||
});
|
||||
modalContent += `</tr>`;
|
||||
});
|
||||
modalContent += `</tr>`;
|
||||
});
|
||||
}
|
||||
|
||||
modalContent += `</table></div>`;
|
||||
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 {
|
||||
cursor: pointer;
|
||||
background-color: #fff !important;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
}
|
||||
.el-menu-vertical-demo {
|
||||
width: 85px;
|
||||
|
||||
@@ -313,5 +313,6 @@ export default {
|
||||
::v-deep .wordTableHtml table {
|
||||
cursor: pointer;
|
||||
background-color: #fff !important;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="state" width="55" align="center">
|
||||
<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>
|
||||
</span>
|
||||
<span class="status warn" v-else >
|
||||
@@ -549,6 +549,7 @@ export default {
|
||||
if (res.code == 0) {
|
||||
if (res.data.bf < 100) {
|
||||
this.refReal = res.data.bf
|
||||
this.$forceUpdate()
|
||||
} else {
|
||||
clearInterval(timeRef)
|
||||
this.refProcess = 0
|
||||
|
||||
11
src/main.js
@@ -13,8 +13,9 @@ import 'babel-polyfill';
|
||||
import api from './api/index.js';
|
||||
import Common from './components/common/common'
|
||||
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 'vxe-table/lib/style.css'
|
||||
|
||||
@@ -73,6 +74,10 @@ Vue.component("Editor", Editor);
|
||||
|
||||
import commonTable from '@/components/page/components/table/table.vue'
|
||||
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'
|
||||
Vue.component('common-paypal-button', commonPayPalButton);
|
||||
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'
|
||||
Vue.component('common-content', commonContent);
|
||||
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);
|
||||
import commonAnnotations from '@/components/page/components/table/annotations.vue'
|
||||
Vue.component('common-annotations', commonAnnotations);
|
||||
|
||||
@@ -988,7 +988,8 @@ export default new Router({
|
||||
path: '/GenerateCharts', //用户端预收录-引用编辑
|
||||
component: () => import('../components/page/GenerateCharts'),
|
||||
meta: {
|
||||
title: 'HTML Proofread'
|
||||
title: 'Text Proofread',
|
||||
hideSidebar: true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||