9 Commits

Author SHA1 Message Date
e1d0ed6561 tijiao 2025-12-26 11:30:31 +08:00
a0d1402e19 Merge branch 'master' of https://git.nuttyreading.com/wangjinlei/tougao_web into Editorial-Board 2025-12-25 09:20:34 +08:00
2c6c3ec183 tijiao 2025-12-25 09:20:17 +08:00
8bf2389e14 Merge branch 'master' of https://git.nuttyreading.com/wangjinlei/tougao_web into Editorial-Board 2025-12-24 16:22:22 +08:00
1129050654 提交 2025-12-23 15:39:17 +08:00
b1b1996648 提交 2025-12-23 14:55:16 +08:00
530470d138 提交 2025-12-19 14:09:27 +08:00
68423be22a 提交 2025-12-19 10:22:03 +08:00
6a5fecc177 终审分数 2025-12-17 09:22:33 +08:00
16 changed files with 3417 additions and 2577 deletions

View File

@@ -1,3 +1,9 @@
:root {
--primary-comment-deep: #00BFFF; /* 深天蓝:用于边框、标题、重要按钮 */
--primary-comment-main: #87CEEB; /* 天蓝色:主色调,用于普通高亮 */
--primary-comment-light: #B0E2FF; /* 浅天蓝:用于鼠标悬停 (hover) 效果 */
--primary-comment-bg: #F0F8FF; /* 爱丽丝蓝:最浅底色,用于批注框背景 */
}
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -24,9 +30,179 @@ a {
text-decoration: none text-decoration: none
} }
.w-auto {
width: auto !important;
}
.w-full {
width: 100% !important;
}
/* 动态宽度类 */
.dynamic-width {
width: calc(100% - var(--minus-w, 300px)) !important;
}
.base-flex {
display: flex !important;
/* 垂直对齐:如果不传 --ai则不设置或保持默认 */
align-items: var(--fl-ai, initial) !important;
/* 水平对齐:如果不传 --jc则不设置 */
justify-content: var(--fl-jc, initial) !important;
/* 换行:如果不传 --wrap则不设置 */
flex-wrap: var(--fl-wrap, initial) !important;
/* 方向:如果不传 --direction则不设置 */
flex-direction: var(--fl-direction, initial) !important;
/* 间隙:这是 Flex 布局中非常好用的属性,建议加上 */
gap: var(--gap, initial) !important;
}
/* 2. 快捷全居中类(最常用,默认就是全居中) */
.base-flex-center {
display: flex ;
align-items: var(--fl-ai, center);
justify-content: var(--fl-jc, center);
}
.base-pos {
/* 定位类型:默认 absolute可选 relative, fixed, sticky */
position: var(--pos, absolute);
/* 默认 initial只有在 style 里传了参,对应的方位才会生效 */
top: var(--p-t, initial);
right: var(--p-r, initial);
bottom: var(--p-b, initial);
left: var(--p-l, initial);
}
.abs-left {
left: var(--left-dist, 10px);
}
.base-font-size {
font-size: var(--f-s, 14px) !important;
color: var(--f-c, #333) !important;
}
/* common.css */
.b-box {
box-sizing: border-box !important;
}
.base-border {
--b-w: 1px;
--b-s: solid;
--b-c: #d8d8d8;
border-top: var(--bt, 0) var(--b-s) var(--b-c);
border-right: var(--br, 0) var(--b-s) var(--b-c);
border-bottom: var(--bb, 0) var(--b-s) var(--b-c);
border-left: var(--bl, 0) var(--b-s) var(--b-c);
}
.base-border-all {
--b-w: 1px;
/* 宽度 */
--b-s: solid;
/* 样式 */
--b-c: #d8d8d8;
/* 颜色 */
border: var(--b-w) var(--b-s) var(--b-c);
}
/* common.css */
.base-padding {
/* 定义默认值(如果没传参,默认是 0 */
--p-t: 0px;
--p-r: 0px;
--p-b: 0px;
--p-l: 0px;
padding-top: var(--p-t);
padding-right: var(--p-r);
padding-bottom: var(--p-b);
padding-left: var(--p-l);
}
.base-padding-all {
padding: var(--p);
/* 默认四周 10px也可以通过 --p 传参 */
}
.base-bg {
background-color: var(--bg, #fff);
}
/* 专门用于“必须生效”场景的类 */
.base-bg-imp {
background-color: var(--bg, #fff) !important;
}
.base-margin {
--m-t: 0px;
--m-r: 0px;
--m-b: 0px;
--m-l: 0px;
margin-top: var(--m-t);
margin-right: var(--m-r);
margin-bottom: var(--m-b);
margin-left: var(--m-l);
}
.base-margin-all {
margin: var(--m);
}
.float-var {
float: var(--f, none) var(--f-imp, );
}
.clearfix::after {
content: "";
display: block;
clear: both;
}
.page-container { .page-container {
min-width: 1200px; min-width: 1200px;
} }
.content-box { .content-box {
position: absolute; position: absolute;
left: 260px; left: 260px;
@@ -1149,9 +1325,9 @@ a {
mso-border-top-alt: none !important; mso-border-top-alt: none !important;
border-bottom: none !important; border-bottom: none !important;
mso-border-bottom-alt: none !important; mso-border-bottom-alt: none !important;
border: 1px dashed #dcdfe6 !important; /* border: 1px dashed #dcdfe6 !important;
border-left: 1px dashed #dcdfe6 !important; border-left: 1px dashed #dcdfe6 !important;
border-right: 1px dashed #dcdfe6 !important; border-right: 1px dashed #dcdfe6 !important; */
word-break: keep-all !important; word-break: keep-all !important;
/* text-align: justify !important; */ /* text-align: justify !important; */
} }
@@ -1283,7 +1459,7 @@ a {
} }
.word-container table tbody tr td { .word-container table tbody tr td {
text-align: left !important; text-align: center !important;
border-left: none !important; border-left: none !important;
mso-border-left-alt: none !important; mso-border-left-alt: none !important;
border-right: none !important; border-right: none !important;
@@ -1292,9 +1468,9 @@ a {
mso-border-top-alt: none !important; mso-border-top-alt: none !important;
border-bottom: none !important; border-bottom: none !important;
mso-border-bottom-alt: none !important; mso-border-bottom-alt: none !important;
border: 1px dashed #dcdfe6 !important; /* border: 1px dashed #dcdfe6 !important;
border-left: 1px dashed #dcdfe6 !important; border-left: 1px dashed #dcdfe6 !important;
border-right: 1px dashed #dcdfe6 !important; border-right: 1px dashed #dcdfe6 !important; */
word-break: keep-all !important; word-break: keep-all !important;
white-space: pre-wrap !important; white-space: pre-wrap !important;
/* text-align: justify !important; */ /* text-align: justify !important; */
@@ -1330,12 +1506,7 @@ a {
mos-line-height: 20px !important; mos-line-height: 20px !important;
} }
.word-container table tr:first-child td { .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 { .word-container table tr:last-of-type {
border-bottom: 1pt solid #000 !important; border-bottom: 1pt solid #000 !important;
@@ -1408,18 +1579,13 @@ a {
color: #fff !important; color: #fff !important;
/* 设置字体颜色 */ /* 设置字体颜色 */
fill: #fff !important; fill: #fff !important;
/* font-size:16px!important; */
/* 设置字体颜色 */
} }
.tinymce-custom-button-addrow { .tinymce-custom-button-addrow {
font-weight: bold !important; font-weight: bold !important;
background-color: #cbccd1 !important; background-color: #cbccd1 !important;
/* color: #fff !important; */
/* 设置字体颜色 */
/* fill: #fff !important; */
/* font-size:16px!important; */
/* 设置字体颜色 */
} }
.tinymce-custom-button-save svg { .tinymce-custom-button-save svg {
@@ -1452,11 +1618,13 @@ wmath {
z-index: 99999 !important; z-index: 99999 !important;
position: fixed !important; position: fixed !important;
} }
.sticky-header { .sticky-header {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1000; /* 保证在上层 */ z-index: 1000;
/* 保证在上层 */
background-color: transparent; background-color: transparent;
/* padding: 10px; */ /* padding: 10px; */
box-shadow: 0 2px 2px rgba(221, 221, 221, 0.2); box-shadow: 0 2px 2px rgba(221, 221, 221, 0.2);
} }

102
src/common/js/TableUtils.js Normal file
View File

@@ -0,0 +1,102 @@
/**
* 表格数据处理工具
*/
export const TableUtils = {
/**
* 判断是否为表头行
* @param {number} rowIndex
* @param {Array} table
*/
isHeaderRow(rowIndex, table) {
if (!table || table.length === 0) return false;
const head = table[0];
// 健壮性检查确保第一行第一个单元格存在且有rowspan
const headerSpan = (head && head[0] && head[0].rowspan) ? head[0].rowspan : 1;
return rowIndex < headerSpan;
},
/**
* 拆分表头和表体
*/
splitTable(tableList) {
if (!Array.isArray(tableList) || tableList.length === 0) {
return { header: [], content: [] };
}
const header = [];
const content = [];
let cellIdCounter = 0;
tableList.forEach((row, rowIndex) => {
if (Array.isArray(row)) {
row.forEach((cell) => {
if (cell && typeof cell === 'object') {
cell.cellId = `cell-${cellIdCounter++}`;
}
});
}
if (this.isHeaderRow(rowIndex, tableList)) {
header.push(row);
} else {
content.push(row);
}
});
return { header, content };
},
/**
* 处理合并单元格后的逻辑行 ID用于斑马纹等
*/
addRowIdToData(content) {
if (!content || content.length === 0) return { rowData: [], rowIds: [] };
const data = JSON.parse(JSON.stringify(content));
const rowIdMap = {};
const usedRows = new Set();
let idCounter = 0;
// 1. 建立逻辑行映射
for (let i = 0; i < data.length; i++) {
if (usedRows.has(i)) continue;
const rowId = `row-${idCounter++}`;
rowIdMap[i] = rowId;
usedRows.add(i);
const row = data[i];
for (let j = 0; j < row.length; j++) {
const cell = row[j];
if (cell && cell.rowspan > 1) {
for (let k = 1; k < cell.rowspan; k++) {
const nextRowIndex = i + k;
if (nextRowIndex < data.length && !rowIdMap[nextRowIndex]) {
rowIdMap[nextRowIndex] = rowId;
usedRows.add(nextRowIndex);
}
}
}
}
}
// 2. 注入 rowId 并提取唯一 ID 列表
const seenIds = [];
data.forEach((row, i) => {
const rowId = rowIdMap[i];
row.rowId = rowId; // 直接赋值给行对象
row.forEach(cell => {
if (cell) cell.rowId = rowId;
});
if (rowId && !seenIds.includes(rowId)) {
seenIds.push(rowId);
}
});
// 取奇数或偶数 ID 用于斑马纹(根据你的需求 index % 2 === 0
const rowIds = seenIds.filter((_, index) => index % 2 === 0);
return { rowData: data, rowIds };
}
};

View File

@@ -2153,7 +2153,32 @@ ed.ui.registry.addButton('myuppercasea', {
ed.insertContent(''); ed.insertContent('');
} }
}); });
ed.ui.registry.addMenuButton('MoreSymbols', {
text: '···', // 按钮显示的三个点
tooltip: 'More Special Characters',
onAction: () => {}, // 菜单主按钮点击通常不执行操作,由子菜单执行
fetch: (callback) => {
const items = [
{
type: 'menuitem',
text: 'en-dash (短划线)',//短划线
onAction: () => ed.insertContent('')
},
{
type: 'menuitem',
text: 'minus sign (减号)',//减号
onAction: () => ed.insertContent('')
},
{
type: 'menuitem',
text: 'hyphen (连接符)',
onAction: () => ed.insertContent('-')
},
];
callback(items);
}
});
ed.ui.registry.addButton('removeBlue', { ed.ui.registry.addButton('removeBlue', {
text: 'Blue', // 按钮文本 text: 'Blue', // 按钮文本

View File

@@ -2,12 +2,12 @@
//记得切换 //记得切换
//正式 //正式
// const mediaUrl = '/public/'; const mediaUrl = '/public/';
// const baseUrl = '/'; const baseUrl = '/';
const mediaUrl = 'https://submission.tmrjournals.com/public/'; // const mediaUrl = 'https://submission.tmrjournals.com/public/';
// const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; // // const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
const baseUrl = '/api' // const baseUrl = '/api'
// const mediaUrl = 'http://tougaotest.tmrjournals.com/public/'; // const mediaUrl = 'http://tougaotest.tmrjournals.com/public/';
// // const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; // // const mediaUrl = 'http://zmzm.tougao.dev.com/public/';

View File

@@ -1307,16 +1307,19 @@ export default {
}, },
handleImageAdd(type) { handleImageAdd(type) {
this.picStyle = { note: '', picUrl: '', title: '' }; this.picStyle = { note: '', picUrl: '', title: '' };
this.picStyle1 = { note: '', picUrl: '', title: '' };
this.picStyle.visiTitle = 'Add Figure'; this.picStyle.visiTitle = 'Add Figure';
this.pictVisible = true; this.pictVisible = true;
}, },
handleTableAdd(type) { handleTableAdd(type) {
this.lineStyle = { note: '', table_data: '', html_data: '' }; this.lineStyle = { note: '', table_data: '', html_data: '' };
this.lineStyle1 = { note: '', table_data: '', html_data: '' };
this.lineStyle.visiTitle = 'Add Table'; this.lineStyle.visiTitle = 'Add Table';
this.threeVisible = true; this.threeVisible = true;
}, },
addUploadWordTable(data) { addUploadWordTable(data) {
this.lineStyle = { note: '', table: data.table_data, html_data: data.html_data }; this.lineStyle = { note: '', table: data.table_data, html_data: data.html_data };
this.lineStyle1 = { note: '', table: data.table_data, html_data: data.html_data };
this.lineStyle.visiTitle = 'Add Table'; this.lineStyle.visiTitle = 'Add Table';
this.threeVisible = true; this.threeVisible = true;
@@ -1330,13 +1333,18 @@ export default {
this.pictVisible = true; this.pictVisible = true;
} else if (type == 'table') { } else if (type == 'table') {
this.lineStyle = {}; this.lineStyle = {};
this.lineStyle = { this.lineStyle1 = {};
// 1. 提取处理逻辑
const formattedData = {
...data, ...data,
table: JSON.parse(data.table_data), table: JSON.parse(data.table_data),
html_data: data.html_data, // 如果 data 中已经包含了 html_data, note, title且不需要特殊处理
note: data.note, // 解构赋值 (...data) 其实已经把它们带进来了。
title: data.title };
};
// 2. 统一赋值
this.lineStyle = formattedData;
this.lineStyle1 = { ...formattedData }; // 使用浅拷贝确保两个变量指向不同引用(如果需要独立修改)
this.lineStyle.visiTitle = 'Edit Table'; this.lineStyle.visiTitle = 'Edit Table';
this.threeVisible = true; this.threeVisible = true;
} }

View File

@@ -2,14 +2,66 @@
<div style="height: 100%"> <div style="height: 100%">
<div <div
class="container" class="container"
style="
height: 100%;
min-width: calc(1000px);
width: calc(100%);
background-color: #fafafa;
padding: 0px 0 0 0;
box-sizing: border-box;
position: relative;
box-sizing: border-box;
"
> >
<div <div
class="right-side" class="right-side"
style="
width: 285px;
float: left;
height: 100%;
background-color: #fff;
box-shadow: 0 1px 3px rgb(16 17 19 / 6%);
border-radius: 4px;
overflow-y: auto;
"
> >
<!-- <p style="padding: 10px 10px; box-sizing: border-box; font-weight: bold"> -->
<!-- <b class="MaxBtn" style="right: 80px; top: 5px; padding: 0"><common-drag-word @tables="getTables"></common-drag-word></b> -->
<!-- <b class="MaxBtn" @click="MTxtPic()" style="background-color: #13bc20; right: 40px; top: 5px">
<svg
t="1684978324047"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1967"
width="15"
height="15"
>
<path
d="M512 46.208a42.666667 42.666667 0 0 1 4.992 85.077333L512 131.541333H174.208a42.666667 42.666667 0 0 0-42.368 37.717334l-0.298667 4.949333v487.850667L307.2 501.12a88.874667 88.874667 0 0 1 112.042667-6.570667l5.845333 4.608 150.442667 128.896 101.973333-101.888a88.874667 88.874667 0 0 1 110.122667-12.373333l6.058666 4.138667 104.832 78.592V512a42.666667 42.666667 0 0 1 85.077334-4.992l0.298666 4.992v342.698667a128 128 0 0 1-120.490666 127.786666l-7.509334 0.213334H174.208a128 128 0 0 1-127.786667-120.490667l-0.213333-7.509333V174.208a128 128 0 0 1 120.490667-127.786667l7.509333-0.213333H512zM366.378667 563.2l-1.536 0.853333-233.301334 213.76v76.885334a42.666667 42.666667 0 0 0 37.717334 42.368l4.949333 0.298666H855.893333a42.666667 42.666667 0 0 0 42.368-37.717333l0.298667-4.949333v-151.808l-3.285333-2.090667-152.789334-114.602667a3.541333 3.541333 0 0 0-3.2-0.554666l-1.450666 0.853333-97.28 97.28 76.970666 66.048a42.666667 42.666667 0 0 1-51.2 68.010667l-4.309333-3.2-292.437333-250.666667a3.541333 3.541333 0 0 0-3.2-0.768z m415.829333-516.992a42.666667 42.666667 0 0 1 42.410667 37.717333l0.256 4.949334v96h96a42.666667 42.666667 0 0 1 4.992 85.077333l-4.992 0.256h-96v96a42.666667 42.666667 0 0 1-85.034667 4.992l-0.298667-4.992v-96h-96a42.666667 42.666667 0 0 1-4.949333-85.034667l4.949333-0.298666h96v-96a42.666667 42.666667 0 0 1 42.666667-42.666667z"
fill="#ffffff"
p-id="1968"
></path>
</svg> </b
><b class="MaxBtn" @click="MTxtTable()" style="background-color: #e07404; right: 0px; top: 5px">
<i class="el-icon-document-add"></i>
</b> -->
<!-- </p> -->
<div class="unfetteredBox" style="height: 100%"> <div class="unfetteredBox" style="height: 100%">
<commonCatalogue
<catalogue
:content="Main_List"
:articleId="articleId"
ref="catalogue"
@getTables="getTables"
@goToListComment="goToListComment"
style="width: 100%; height: 100%; padding: 0 0px; box-sizing: border-box; background-color: #fff"
>
</catalogue>
<common-word-html-type-setting
:urlList="{ :urlList="{
img: 'api/Preaccept/getMainImages', img: 'api/Preaccept/getMainImages',
table: 'api/Preaccept/getMainTables' table: 'api/Preaccept/getMainTables'
@@ -19,7 +71,6 @@
ref="commonWordHtmlTypeSetting" ref="commonWordHtmlTypeSetting"
@onDragStart="onDragStart" @onDragStart="onDragStart"
@huifu="huifu" @huifu="huifu"
:catalogueList="tableData"
@onAddComment="onAddComment" @onAddComment="onAddComment"
@addImage="handleImageAdd" @addImage="handleImageAdd"
@addTable="handleTableAdd" @addTable="handleTableAdd"
@@ -30,19 +81,24 @@
@goToListComment="goToListComment" @goToListComment="goToListComment"
style="width: 100%; height: 100%; padding: 0 0px; box-sizing: border-box; background-color: #fff" style="width: 100%; height: 100%; padding: 0 0px; box-sizing: border-box; background-color: #fff"
> >
</commonCatalogue> </common-word-html-type-setting>
<input type="file" ref="fileInput" style="display: none" @change="handleFileChange" /> <input type="file" ref="fileInput" style="display: none" @change="handleFileChange" />
</div> </div>
</div> </div>
<div style="" class="right-content-box"> <div style="width: 100%; width: calc(100% - 285px); float: right; height: calc(100% - 0px); background-color: #e4e9ed">
<!-- <div class="toolbar">
<div class="toolbar_item" @click="handleImageAdd('img')">
<img src="@/assets/img/upload.png" style="object-fit: contain" />
<span>Add Figure </span>
</div>
<div class="toolbar_item" @click="handleTableAdd('table')">
<img src="@/assets/img/uploadTable.png" style="object-fit: contain" />
<span>Add Table </span>
</div>
</div> -->
<common-reference <common-word
ref="commonReference1"
:tableData="tableData"
></common-reference>
<!-- <common-word
v-if="htmlContent" v-if="htmlContent"
ref="commonWord" ref="commonWord"
:value="htmlContent" :value="htmlContent"
@@ -55,6 +111,7 @@
@loaded="loadedWord" @loaded="loadedWord"
@onEdit="onEdit" @onEdit="onEdit"
@addContent="onAddContent" @addContent="onAddContent"
@changeSort="changeSort" @changeSort="changeSort"
@onDelete="onDelete" @onDelete="onDelete"
@onDeletes="onDeletes" @onDeletes="onDeletes"
@@ -78,7 +135,10 @@
<template slot="comment"> <template slot="comment">
<div style="" class="commentList annotations"></div> <div style="" class="commentList annotations"></div>
</template> </template>
</common-word> --> <template slot="refrences">
<reference ref="commonRef" :articleId="articleId" :p_article_id="p_article_id"></reference>
</template>
</common-word>
</div> </div>
</div> </div>
@@ -157,7 +217,8 @@
size="80vw" size="80vw"
> >
<el-form ref="editMes" :model="lineStyle" label-width="80px"> <el-form ref="editMes" :model="lineStyle" label-width="80px">
<!-- <common-late-x></common-late-x> -->
<!-- :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`" -->
<el-form-item label="Title:"> <el-form-item label="Title:">
<common-content <common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`" :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`"
@@ -186,7 +247,7 @@
></common-table> ></common-table>
</el-form-item> </el-form-item>
<el-form-item label="Note:"> <el-form-item label="Note:">
<!-- :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`" -->
<common-content <common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`" :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`"
:isAutomaticUpdate="true" :isAutomaticUpdate="true"
@@ -362,28 +423,19 @@
</template> </template>
<script> <script>
import commonCatalogue from '@/components/page/components/OnlineProofreading/catalogue.vue';
import commonReference from '@/components/page/components/OnlineProofreading/reference.vue';
import bus from '@/components/common/bus'; import bus from '@/components/common/bus';
import { del, isShallow } from 'vue'; import { del, isShallow } from 'vue';
import Tiff from 'tiff.js'; import Tiff from 'tiff.js';
import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑 import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑
import Tinymce from '@/components/page/components/Tinymce'; import Tinymce from '@/components/page/components/Tinymce';
import bottomTinymce from '@/components/page/components/Tinymce'; import bottomTinymce from '@/components/page/components/Tinymce';
import catalogue from '@/components/page/components/OnlineProofreading/catalogue.vue';
import reference from '@/components/page/components/OnlineProofreading/reference.vue';
export default { export default {
data() { data() {
return { return {
tableData: [ p_article_id:3452,
// { title: 'Title ', key: '1' },
// { title: 'Author name', key: '2' },
// { title: 'Affialition', key: '3' },
// { title: 'Abstract & Keywords', key: '4' },
// { title: 'Main text', key: '5' },
// { title: 'Back Matter', key: '6' },
// { title: 'Editorial inforation', key: '7' },
// { title: 'Reference ', key: '8' },
],
zoomNum: (window.innerWidth * 0.38) / 850, zoomNum: (window.innerWidth * 0.38) / 850,
uploadWordTables: [], uploadWordTables: [],
tablesHtmlVisible: false, tablesHtmlVisible: false,
@@ -507,12 +559,13 @@ export default {
components: { components: {
Tinymce, Tinymce,
bottomTinymce, bottomTinymce,
commonCatalogue, catalogue,
commonReference reference,
}, },
computed: { computed: {
combinedValue() { combinedValue() {
// 将两个值组合成一个新的值,可以是字符串、数组、对象等
// return `${this.isFirstComponentLoaded}-${this.isWordComponentLoaded}`;
} }
}, },
watch: { watch: {
@@ -541,41 +594,45 @@ export default {
localStorage.removeItem('scrollPosition'); localStorage.removeItem('scrollPosition');
this.isShowEditComment(); this.isShowEditComment();
this.getDate(); this.getDate();
this.getRefData();
this.getCommentList(); this.getCommentList();
// this.loadDictionary().catch(console.error); this.getReferenceList();
}, },
mounted() {}, mounted() {},
async activated() { async activated() {
this.isShowEditComment(); this.isShowEditComment();
this.getDate(); this.getDate();
this.getRefData();
this.getCommentList(); this.getCommentList();
this.getReferenceList();
}, },
methods: { methods: {
// 获取引用文献信息 getReferenceList() {
getRefData() {
this.$api this.$api
.post('api/Preaccept/getArticleReferences', { article_id: this.$route.query.id }) .post('api/Production/getReferList', {
p_article_id: this.p_article_id
})
.then((res) => { .then((res) => {
console.log(res); this.referenceList = res.data.refers;
if (res.code == 0 && res.data.refers.length > 0) {
this.tableData = res.data.refers;
}
this.$nextTick(() => {
// 更新引用列表
// this.$refs.commonRef.init(this.referenceList);
});
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}, },
async copyArray(data) { async copyArray(data) {
try { try {
// 将数组内容转换为字符串,使用换行符分隔
const textToCopy = JSON.stringify(data); const textToCopy = JSON.stringify(data);
// 使用 Clipboard API 复制文本
await navigator.clipboard.writeText(textToCopy); await navigator.clipboard.writeText(textToCopy);
alert('数组内容已复制到剪贴板!'); alert('数组内容已复制到剪贴板!');
} catch (err) { } catch (err) {
@@ -814,14 +871,22 @@ export default {
// 编辑评论,显示文本框 // 编辑评论,显示文本框
goToListComment(id, type) { goToListComment(id, type) {
var am_id;
if (type == 'img') {
this.goToComment(id); am_id = this.Main_List.find((item) => item.ami_id == id).am_id;
}else if (type == 'content') {
am_id=id
}
else {
am_id = this.Main_List.find((item) => item.amt_id == id).am_id;
}
if (am_id) {
this.goToComment(am_id);
}
}, },
goToComment(mainId) { goToComment(mainId) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.commonReference1.goToComment(mainId); this.$refs.commonWord.goToComment(mainId);
}); });
}, },
getTables(tables, html) { getTables(tables, html) {
@@ -1166,19 +1231,21 @@ export default {
}, },
async onAddRow(mainId) { async onAddRow(mainId) {
await this.$api await this.$api
.post(this.urlList.addRow, { .post(this.urlList.addRow, {
am_id: mainId, am_id: mainId,
article_id: this.articleId article_id: this.articleId
}) })
.then(async (res) => { .then(async (res) => {
if (res.code == 0) { if(res.code == 0){
this.getDate(); this.getDate();
this.getCommentList(); this.getCommentList();
} else { }else{
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((err) => { .catch((err) => {
this.$message.error(err.msg); this.$message.error(err.msg);
@@ -1251,6 +1318,7 @@ export default {
}, },
deleteProofreading(data, index) { deleteProofreading(data, index) {
console.log('comment at line 480:', data); console.log('comment at line 480:', data);
}, },
async cancelSolveComment(data) { async cancelSolveComment(data) {
@@ -1446,10 +1514,13 @@ export default {
}); });
}, },
getWord() { getWord() {
this.htmlContent = 'true'; this.htmlContent = 'true';
}, },
// 获取数据 // 获取数据
async getDate() { async getDate() {
this.imagesList = []; this.imagesList = [];
let urlLInk = ''; let urlLInk = '';
let urlTask = {}; let urlTask = {};
@@ -1469,7 +1540,7 @@ export default {
.post(urlLInk, urlTask) .post(urlLInk, urlTask)
.then(async (res) => { .then(async (res) => {
if (res.code == 0) { if (res.code == 0) {
this.Main_List = res.data.list.map((e) => { this.Main_List = res.data.list.map(e=>{
e.checked = false; e.checked = false;
return e; return e;
}); });
@@ -1477,13 +1548,14 @@ export default {
for (let i = 0; i < this.Main_List.length; i++) { for (let i = 0; i < this.Main_List.length; i++) {
this.Main_List[i].text = this.Main_List[i].content; this.Main_List[i].text = this.Main_List[i].content;
this.Main_List[i].getnum = 0; this.Main_List[i].getnum = 0;
// this.Main_List[i].checked = false;
} }
// setTimeout(async () => { // setTimeout(async () => {
this.$nextTick(async () => { this.$nextTick(async () => {
await this.getWord(); await this.getWord();
loading.close(); loading.close();
}); });
// }, 1000); // }, 1000);
@@ -1842,11 +1914,12 @@ export default {
}, },
handleAvatarError(res, file) {}, handleAvatarError(res, file) {},
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
// const isLt2M = file.size / 1024 / 1024 < 10; const isLt2M = file.size / 1024 / 1024 < 20;
// if (!isLt2M) { if (!isLt2M) {
// this.$message.error('Picture size cannot exceed 10M!'); this.$message.error('Picture size cannot exceed 20M!');
// } return false;
// return isLt2M; }
const isValidFormat = ['image/jpeg', 'image/png', 'image/tiff'].includes(file.type); const isValidFormat = ['image/jpeg', 'image/png', 'image/tiff'].includes(file.type);
if (!isValidFormat) { if (!isValidFormat) {
this.$message.error(this.$t('commonTable.uploadImageInfo')); this.$message.error(this.$t('commonTable.uploadImageInfo'));
@@ -1871,28 +1944,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
.container{
height: 100%;
min-width: calc(1000px);
width: calc(100%);
background-color: #fafafa;
padding: 0px 0 0 0;
box-sizing: border-box;
position: relative;
box-sizing: border-box;
}
.right-side{
width: 280px;
float: left;
height: 100%;
background-color: #fff;
box-shadow: 0 1px 3px rgb(16 17 19 / 6%);
border-radius: 4px;
overflow-y: auto;
}
.right-content-box{
width: 100%; width: calc(100% - 285px); float: right; height: calc(100% - 0px); background-color: #e4e9ed
}
.lineStyle { .lineStyle {
border-top: 1px solid #0066994d; border-top: 1px solid #0066994d;
padding: 20px 20px 40px 20px; padding: 20px 20px 40px 20px;

View File

@@ -1847,31 +1847,35 @@ export default {
}, },
// 算平均分 // 算平均分
avegeCount(arry) { avegeCount(arry) {
// 1. 计算有有效评分的数量
var ratedLength = arry.map(item => item.rated).filter(rated => rated && rated > 0).length;
let all = 0;
// 2. 累加总分
for (let i = 0; i < arry.length; i++) {
all += Number(arry[i].rated || 0); // 加上 || 0 防止出现 undefined 导致计算失败
}
// 3. 核心判断逻辑
// 如果没有评分的人(ratedLength 为 0),或者总分就是 0直接返回 "-"
// 否则计算平均分并保留一位小数
let str = (ratedLength > 0 && all > 0)
? (all / ratedLength).toFixed(1)
: "-";
return str;
},
// 算终审分
finalCount(arry) {
var ratedLength = arry.map(item => item.rated).filter(rated => rated&&rated>0).length; var ratedLength = arry.map(item => item.rated).filter(rated => rated&&rated>0).length;
let str = 0; let str = 0;
let all = 0; let all = 0;
let sgr = 0;
for (let i = 0; i < arry.length; i++) { for (let i = 0; i < arry.length; i++) {
all += Number(arry[i].rated); all += Number(arry[i].rated);
} }
str = (all / ratedLength).toFixed(1); str = (all / ratedLength).toFixed(1);
return str;
},
// 算终审分
finalCount(arry) {
let str = 0;
let sgr = 0;
let all = 0;
let j = 0; // null 评分人数
for (let i = 0; i < arry.length; i++) {
if (arry[i].rated == null) {
j += 1;
continue;
} else {
all += Number(arry[i].rated);
}
}
str = (all / (arry.length - j)).toFixed(1);
sgr = ((Number(str) + Number(this.form.scoring)) / 2).toFixed(1); sgr = ((Number(str) + Number(this.form.scoring)) / 2).toFixed(1);
return sgr; return sgr;
}, },

View File

@@ -1458,15 +1458,25 @@ export default {
}, },
// 算平均分 // 算平均分
avegeCount(arry) { avegeCount(arry) {
var ratedLength = arry.map(item => item.rated).filter(rated => rated&&rated>0).length; // 1. 计算有有效评分的数量
let str = 0; var ratedLength = arry.map(item => item.rated).filter(rated => rated && rated > 0).length;
let all = 0; let all = 0;
// 2. 累加总分
for (let i = 0; i < arry.length; i++) { for (let i = 0; i < arry.length; i++) {
all += Number(arry[i].rated); all += Number(arry[i].rated || 0); // 加上 || 0 防止出现 undefined 导致计算失败
} }
str = (all / ratedLength).toFixed(1);
// 3. 核心判断逻辑
// 如果没有评分的人(ratedLength 为 0),或者总分就是 0直接返回 "-"
// 否则计算平均分并保留一位小数
let str = (ratedLength > 0 && all > 0)
? (all / ratedLength).toFixed(1)
: "-";
return str; return str;
}, },
toggleShowAll(item, i) { toggleShowAll(item, i) {
this.$set(this.tableData[i], 'showAll', !item.showAll); this.$set(this.tableData[i], 'showAll', !item.showAll);
this.$forceUpdate(); this.$forceUpdate();

View File

@@ -95,11 +95,16 @@
<el-table-column label="State" align="center" width="130"> <el-table-column label="State" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="font-size: 16px;"v-html="revstate(scope.row)"></span> <span style="font-size: 16px;"v-html="revstate(scope.row)"></span>
<!-- 0初始1小改后接收2拒稿3通过4过期5邀请 -->
<font <font
style="color: #aaa; display: block; line-height: 18px; font-size: 13px; " style="color: #aaa; display: block; line-height: 18px; font-size: 13px; "
v-html="formatDate(scope.row.ctime)"
> >
<span v-html="formatDate(scope.row.ctime)" v-if="[5].includes(scope.row.state)"></span>
<span v-html="formatDate(scope.row.agree_review_time>0?scope.row.agree_review_time:scope.row.ctime)" v-if="[0].includes(scope.row.state)"></span>
<span v-html="formatDate(scope.row.refuse_review_time>0?scope.row.refuse_review_time:scope.row.ctime)" v-if="[4].includes(scope.row.state)"></span>
<span v-html="formatDate(scope.row.review_time>0?scope.row.review_time:scope.row.ctime)" v-if="[1,2,3].includes(scope.row.state)"></span>
</font> </font>
</template> </template>
</el-table-column> </el-table-column>

View File

@@ -1,44 +1,20 @@
<template> <template>
<!-- v-show="tables.length > 0 || images.length > 0" --> <div class="ManuscirptList">
<div class="arrlist">
<ul class="catalogue-ul">
<li class="catalogue-li">
<div <div
style="" @click="goToListComment(item.am_id,'content')"
class="ManuscirptList"
>
<!-- 图片缩略图区域 -->
<div class="title">
Reference List
</div>
<div
style=""
class="arrlist"
>
<ul style="width: 100%; height: auto">
<li >
<div style="display: flex; flex-wrap: wrap; gap: 10px; justify-content: start">
<div @click="goToListComment(item.p_refer_id)"
v-for="(item, index) in catalogueList" v-for="(item, index) in catalogueList"
style="width: calc(100%); display: flex; align-items: center; justify-content: space-between; color: #606266" :key="index"
:class="['catalogue-item', 'level-' + item.level]"
> >
<div class="doi_box"><span style="color: #888;margin-right: 5px;">{{ index+1 }}.</span> <span class="doi">{{ item.refer_doi }}</span></div> <div class="title-content-wrapper">
<div class="title-content" v-html="item.content"></div>
<!-- <div
style="
width: calc(100% - 50px);
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis;
"
>
<p
v-html="index + 1 + '. ' + item.content"
style="font-size: 14px; width: 100%; overflow: hidden; line-height: 30px"
></p>
</div> -->
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
@@ -49,9 +25,18 @@
<script> <script>
import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑 import { mediaUrl } from '@/common/js/commonJS.js'; // 引入通用逻辑
export default { export default {
props: ['articleId', 'imgWidth', 'imgHeight', 'scale', 'isEdit', 'isShowEdit', 'urlList', 'content','catalogueList'], props: ['articleId', 'imgWidth', 'imgHeight', 'scale', 'isEdit', 'isShowEdit', 'urlList', 'content'],
watch: {
content: {
handler(newVal, oldVal) {
if(this.content.length > 0)this.getCatalogueList();
},
deep: true
}
},
data() { data() {
return { return {
catalogueList: [],
isShowComment: false, isShowComment: false,
isCollapse: false, isCollapse: false,
isEditComment: false, isEditComment: false,
@@ -91,6 +76,33 @@ export default {
} }
}, },
methods: { methods: {
getCatalogueList() {
this.catalogueList = this.content.filter(item => {
return item.is_h1 == 1 || item.is_h2 == 1 ;
}).map(item => {
// 增加一个 level 字段进行标记
let level = 1;
if (item.is_h2 == 1) level = 2;
return {
...item,
level: level // 1, 2, 或 3
};
})
this.catalogueList=[...this.catalogueList,{
am_id:'References',
content:'References',
level:1,
}]
// this.catalogueList = res.data;
},
changeIsCollapse(e) { changeIsCollapse(e) {
localStorage.setItem('isCollapse', e); localStorage.setItem('isCollapse', e);
}, },
@@ -254,6 +266,7 @@ export default {
} }
}, },
goToListComment(id, type) { goToListComment(id, type) {
console.log('id at line 399:', id);
this.$emit('goToListComment', id, type); this.$emit('goToListComment', id, type);
}, },
async refresh(type) { async refresh(type) {
@@ -459,217 +472,151 @@ export default {
<style scoped> <style scoped>
.ManuscirptList { .ManuscirptList {
background-color: none !important; height: 100%;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0); padding: 0;
color: #333639; box-sizing: border-box;
background-color: transparent !important; margin-top: 0px !important; height: 100%; padding: 0 !important; overflow: hidden background-color: #f5f5f5 !important; /* Word 导航栏通常是白色的 */
} border-right: 1px solid #e1e1e1;
.ManuscirptList div {
cursor: pointer;
background-color: none !important;
}
::v-deep .wordTableHtml table {
cursor: pointer;
background-color: #fff !important;
border-bottom: 1px solid #000 !important;
}
.el-menu-vertical-demo {
width: 85px;
}
.el-menu-vertical-demo li {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 6px !important;
font-size: 14px !important;
text-align: center;
}
::v-deep .el-menu-vertical-demo.el-menu-item:focus,
.el-menu-item:hover {
background-color: #f8f8f9 !important;
}
::v-deep .el-menu-item.is-active {
background-color: #2196f32e !important;
}
.isSelectType {
background-color: #2196f32e !important;
color: #006699;
}
li {
list-style: none;
}
.item_box {
background-color: #f2f3f5;
border: 1px solid rgba(0, 0, 0, 0);
border-radius: 6px;
overflow: hidden;
}
.go-transition .title {
background-color: #e5e6eb;
color: #767c82;
font-size: 13px;
padding: 2px 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.go-transition .list-img {
padding: 6px 0;
background-color: #f2f3f5;
box-sizing: border-box;
}
.go-transition .list-img :hover {
transition: all 0.4s;
}
.go-content-charts-item-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 9px;
transition: all 0.7s linear;
}
.arraylist {
background-color: #f8f8f9;
}
.arrlist {
width: 280px; padding: 14px; height: calc(100% - 30px); box-sizing: border-box; overflow-y: auto;
border-top: 1px solid #ddd;
}
.arrlist li{
line-height: 30px
}
.arrlist::-webkit-scrollbar-thumb {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
min-height: 12px;
border: 4px solid transparent;
background-clip: content-box;
border-radius: 7px;
background-color: #c8d5e1;
}
.badge {
background-color: #f56c6c;
border-radius: 10px;
color: #fff;
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
padding: 0 6px;
text-align: center;
white-space: nowrap;
border: 1px solid #fff;
position: absolute;
}
.comments-section {
padding: 10px;
box-sizing: border-box;
border: 1px solid #cecfd3;
border-left: 2px solid #cecfd3;
/* border-radius: 5px; */
background-color: #f9f9f9;
box-shadow: rgba(16, 17, 19, 0.06) 0px 1px 3px;
width: 300px;
background-color: #fafafa;
float: right;
position: absolute;
right: -302px;
top: 0px;
z-index: 999;
} }
.comment-item { /* 模拟 Word 导航标题 */
padding: 5px 0; .word-navigation-header {
border-bottom: 1px solid #ddd; padding: 12px 16px 0 16px;
cursor: pointer;
box-sizing: border-box;
font-size: 14px; font-size: 14px;
color: #333;
font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
} }
.comment-item:last-child { .word-tabs {
border-bottom: none; display: flex;
margin-top: 10px;
border-bottom: 1px solid #e1e1e1;
} }
.comment-details { .word-tabs span {
margin-top: 20px; padding: 4px 12px;
padding: 10px; font-size: 12px;
border: 1px solid #ddd; color: #666;
border-radius: 5px;
background-color: #f9f9f9;
}
.comment-details h3 {
margin-bottom: 10px;
}
.comment-details p {
margin-bottom: 10px;
}
.comment-details button {
padding: 5px 10px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer; cursor: pointer;
position: relative;
} }
.comment-details button:hover { .word-tabs span.active {
background-color: #0056b3; color: #2b579a; /* Word 经典蓝色 */
}
.comments-section ul,
.comments-section li {
list-style: none;
margin: 0;
padding: 0;
}
::v-deep.pizhu.el-link--default:hover {
border-color: #fc625d !important;
}
.go-mt {
/* background-color: #f2f3f5;
height: 28px; */
width: 200px;
float: right;
}
.double .item_box {
width: 46% !important;
}
.double .item_box .previewbox {
display: none;
}
.double .item_box .imgbox {
height: 50px !important;
width: auto !important;
}
.double .item_box .imgbox img {
height: 60px !important;
width: auto !important;
}
.double .go-transition .title {
font-size: 12px !important;
padding: 0 2px !important;
line-height: 20px !important;
}
.single {
}
.title{
line-height: 28px;
padding: 10px 10px;
font-size: 18px;
font-weight: bold; font-weight: bold;
} }
.doi_box{
width: 100%; .word-tabs span.active::after {
display: flex;align-items: center; content: "";
font-size: 14px; position: absolute;
line-height: 16px; bottom: -1px;
left: 0;
right: 0;
height: 2px;
background-color: #2b579a;
} }
.doi{
width: calc(100% ); /* 列表容器 */
.arrlist {
flex: 1;
overflow-y: auto;
padding-top: 8px;
}
.catalogue-ul {
width: 100%;
list-style: none;
padding: 0;
margin: 0;
}
/* 基础条目样式 - 模拟 Word 悬浮效果 */
.catalogue-item {
position: relative;
width: 100%;
/* padding: 6px 16px; */
cursor: pointer;
display: flex;
align-items: flex-start;
box-sizing: border-box;
transition: background-color 0.1s;
}
.catalogue-item:hover {
background-color: #eff3f9; /* Word 淡淡的选中蓝 */
}
/* Word 样式的左侧小箭头 */
.word-icon-arrow {
width: 0;
height: 0;
border-left: 5px solid #666;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
margin-right: 8px;
margin-top: 6px;
}
.title-content-wrapper {
flex: 1;
overflow: hidden;
}
/* 重点Word 常用排版字体 */
.title-content {
font-weight: bold !important;
font-style: normal !important;
font-size: 13px !important;
line-height: 1.3;
white-space: nowrap; white-space: nowrap;
display: inline-block; padding: 4px 0px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
/* Times New Roman 增加学术感 */
font-family: "Charis SIL" !important;
color: #333;
}
/* 保持 v-html 内部样式 */
::v-deep .title-content b { font-weight: bold; }
::v-deep .title-content i { font-style: italic; }
/* --- Word 风格的层级缩进 --- */
/* 1级标题 */
.level-1 {
padding-left: 16px;
}
.level-1 .title-content{
font-style: italic !important;
}
/* 2级标题 */
.level-2 {
padding-left: 36px;
}
.level-2 .title-content {
font-size: 14px;
}
/* 3级标题 */
.level-3 {
padding-left: 56px;
}
.level-3 .title-content {
font-size: 14px;
color: #666;
}
/* 隐藏滚动条 */
.arrlist::-webkit-scrollbar {
width: 5px;
}
.arrlist::-webkit-scrollbar-thumb {
background: #cdcdcd;
} }
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,10 @@ import htmlDocx from 'html-docx-js/dist/html-docx.js';
import { Document, Packer, PageOrientation, Paragraph, TextRun } from 'docx'; // 引入 docx.js import { Document, Packer, PageOrientation, Paragraph, TextRun } from 'docx'; // 引入 docx.js
import html2canvas from 'html2canvas'; import html2canvas from 'html2canvas';
const tableStyle = ` b span{ const tableStyle = `*{
font-family: 'Charis SIL';
}
b span{
font-weight: bold !important; font-weight: bold !important;
} }
i span{ i span{

View File

@@ -0,0 +1 @@

View File

@@ -16,7 +16,7 @@
:value="value" :value="value"
:typesettingType="typesettingType" :typesettingType="typesettingType"
class="paste-area text-container" class="paste-area text-container"
:toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX| myuppercase myuppercasea Line|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue| myuppercase myuppercasea Line|subscript superscript|clearButton|searchreplace']" :toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue| myuppercase myuppercasea Line|subscript superscript|clearButton|searchreplace']"
style=" style="
/* white-space: pre-line; */ /* white-space: pre-line; */
line-height: 12px; line-height: 12px;

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,5 @@
<template> <template>
<div> <div>
<div class="liter_ture"> <div class="liter_ture">
<p v-if="role == 'editor'" style="text-indent: 2em; position: absolute; right: 0px; top: -60px"> <p v-if="role == 'editor'" style="text-indent: 2em; position: absolute; right: 0px; top: -60px">
<el-button type="text" @click="showDialogSpecial">Special way to add</el-button> <el-button type="text" @click="showDialogSpecial">Special way to add</el-button>
@@ -33,8 +32,8 @@
<i class="el-icon-edit-outline"></i> <i class="el-icon-edit-outline"></i>
Crossref Crossref
</el-button> </el-button>
to open the website and get the correct DOI. Finally, copy the Crossref-verified references and place them in the to open the website and get the correct DOI. Finally, copy the Crossref-verified references and place them in
box. the box.
</p> </p>
<br /> <br />
@@ -60,10 +59,10 @@
>. >.
</p> </p>
<div class="template-info" v-if="role == 'editor'" style="margin-left: 30px;"> <div class="template-info" v-if="role == 'editor'" style="margin-left: 30px">
<span class="template-title">Article from a Journal (General format)</span> <br /> <span class="template-title">Article from a Journal (General format)</span> <br />
Author(s) Last Name First Initial.&nbsp;Title of article.&nbsp;<i>Abbreviated Journal Title</i>.&nbsp;Year;Volume(issue):Inclusive page Author(s) Last Name First Initial.&nbsp;Title of article.&nbsp;<i>Abbreviated Journal Title</i
numbers.<br /> >.&nbsp;Year;Volume(issue):Inclusive page numbers.<br />
<br /> <br />
<span class="template-title">For example:</span><br /> <span class="template-title">For example:</span><br />
Article with More than Six Authors<br /> Article with More than Six Authors<br />
@@ -104,7 +103,6 @@
</div> </div>
<!-- 新的 --> <!-- 新的 -->
<div v-if="showB_step == 2"> <div v-if="showB_step == 2">
<div class="duplicateRefBox" v-if="chanFerFormRepeatList.length > 0"> <div class="duplicateRefBox" v-if="chanFerFormRepeatList.length > 0">
<el-tooltip class="item" effect="dark" content="Duplicate references" placement="top"> <el-tooltip class="item" effect="dark" content="Duplicate references" placement="top">
<img src="../../assets/img/repeat.png" alt="" style="width: 22px; height: 22px" /> <img src="../../assets/img/repeat.png" alt="" style="width: 22px; height: 22px" />
@@ -156,8 +154,8 @@
class="status ok" class="status ok"
:class="scope.row.refer_type == 'journal' ? getJournalDateno(scope.row.dateno, 'status') : ''" :class="scope.row.refer_type == 'journal' ? getJournalDateno(scope.row.dateno, 'status') : ''"
v-if=" v-if="
(scope.row.refer_type == 'journal' && scope.row.doilink != '') || (scope.row.refer_type == 'journal' && scope.row.doilink != ''&&scope.row.cs==1) ||
(scope.row.refer_type == 'book' && scope.row.isbn != '') (scope.row.refer_type == 'book' && scope.row.isbn != ''&&scope.row.cs==1)
" "
> >
<i class="el-icon-circle-check"></i> <i class="el-icon-circle-check"></i>
@@ -283,8 +281,8 @@
@close="cancelSave" @close="cancelSave"
> >
<p class="yinyongPre c888" style="margin-bottom: 20px; color: #888; line-height: 24px"> <p class="yinyongPre c888" style="margin-bottom: 20px; color: #888; line-height: 24px">
You may add or modify the references. The system will automatically identify and retrieve the reference information. Please You may add or modify the references. The system will automatically identify and retrieve the reference information.
note that if the reference type is set to “Other”, the “Parse” button will not be available. Please note that if the reference type is set to “Other”, the “Parse” button will not be available.
</p> </p>
<el-form :model="refenceForm" :rules="refenceFormrules" ref="refenceForm" label-width="150px" class="editForm mt10"> <el-form :model="refenceForm" :rules="refenceFormrules" ref="refenceForm" label-width="150px" class="editForm mt10">
@@ -335,8 +333,8 @@
placeholder="Patel NM, Stottlemyer BA, Gray MP, Boyce RD, Kane Gill SL" placeholder="Patel NM, Stottlemyer BA, Gray MP, Boyce RD, Kane Gill SL"
></el-input> ></el-input>
<p class="zhushi"> <p class="zhushi">
Six or less authors are required to list all authors while more than six authors are required to list three Six or less authors are required to list all authors while more than six authors are required to list
of them with “et al.” three of them with “et al.”
</p> </p>
</el-form-item> </el-form-item>
<el-form-item :label="SourceType == 'journal' ? 'Title:' : 'Book'" required prop="title"> <el-form-item :label="SourceType == 'journal' ? 'Title:' : 'Book'" required prop="title">
@@ -474,7 +472,6 @@
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
@@ -489,9 +486,7 @@ export default {
ue: null, ue: null,
wordText: '', wordText: '',
editorConfig: { editorConfig: {
// 访问 UEditor 静态资源的根路径,可参考 https://hc199421.gitee.io/vue-ueditor-wrap/#/faq
UEDITOR_HOME_URL: '/UEditor/', UEDITOR_HOME_URL: '/UEditor/',
// serverUrl: "//ueditor.zhenghaochuan.com/cos",
serverUrl: '' serverUrl: ''
}, },
wordTextArr: [], // 识别出的word引用数组 wordTextArr: [], // 识别出的word引用数组
@@ -575,30 +570,22 @@ export default {
}, },
methods: { methods: {
getJournalDateno(dateno, type) { getJournalDateno(dateno, type) {
// 先判断 dateno 是否存在且为字符串类型(避免非字符串值导致的错误)
if (dateno && typeof dateno === 'string') { if (dateno && typeof dateno === 'string') {
// 核心判断要么没有冒号要么有冒号但冒号后无有效内容trim() 去除空格) const hasInvalidColon = !dateno.includes(':') || (dateno.includes(':') && dateno.split(':').pop().trim() === '');
const hasInvalidColon = !dateno.includes(':') ||
(dateno.includes(':') && dateno.split(':').pop().trim() === '');
if (hasInvalidColon) { if (hasInvalidColon) {
// 根据 type 返回对应类名type 为 title 返回复盖样式,否则返回 warn
return type === 'title' ? 'text-highlight' : 'warn'; return type === 'title' ? 'text-highlight' : 'warn';
} }
} }
// 有冒号且后面有值,或 dateno 无效 → 返回空字符串
return ''; return '';
}, },
getParsingInfo(data, index) { getParsingInfo(data, index) {
//console.log('index at line 457:', data,index)
const targetSubArr = this.chanFerFormRepeatList.find((subArr) => subArr.includes(index)); const targetSubArr = this.chanFerFormRepeatList.find((subArr) => subArr.includes(index));
if (targetSubArr) { if (targetSubArr) {
let warningText = 'Please note that '; let warningText = 'Please note that ';
const refElements = targetSubArr.map((ref, refIndex) => { const refElements = targetSubArr.map((ref, refIndex) => {
return `${ref + 1}`; return `${ref + 1}`;
}); });
if (refElements.length > 0) { if (refElements.length > 0) {
if (refElements.length === 1) { if (refElements.length === 1) {
warningText += `ref. ${refElements[0]} is a duplicate.`; warningText += `ref. ${refElements[0]} is a duplicate.`;
@@ -607,16 +594,10 @@ export default {
warningText += `ref. ${refElements.join(', ')} and ${lastRef} are duplicates.`; warningText += `ref. ${refElements.join(', ')} and ${lastRef} are duplicates.`;
} }
} }
//console.log(warningText);
return warningText; return warningText;
} }
//console.log('this.chanFerFormRepeatList at line 459:', this.chanFerFormRepeatList)
}, },
// 父容器事件委托处理
handleContainerClick(e) { handleContainerClick(e) {
// 判断点击的是否是目标 span通过标签名或自定义类名筛选
if (e.target.tagName === 'SPAN' && e.target.hasAttribute('data-ref')) { if (e.target.tagName === 'SPAN' && e.target.hasAttribute('data-ref')) {
const ref = Number(e.target.getAttribute('data-ref')); // 获取存储的 ref 值 const ref = Number(e.target.getAttribute('data-ref')); // 获取存储的 ref 值
this.handleClickRef(ref); // 触发实际逻辑 this.handleClickRef(ref); // 触发实际逻辑
@@ -627,7 +608,6 @@ export default {
getRepeatRefHtml() { getRepeatRefHtml() {
let warningText = 'Please note that '; let warningText = 'Please note that ';
this.chanFerFormRepeatList.forEach((pair, index) => { this.chanFerFormRepeatList.forEach((pair, index) => {
// 处理单个 pair 数组,例如 [1, 2, 3]
let singlePairText = ''; let singlePairText = '';
pair.forEach((ref, refIndex) => { pair.forEach((ref, refIndex) => {
singlePairText += `<span style="font-weight: bold;color: #F56C6C;cursor: pointer;" data-ref="${ref}" >${ singlePairText += `<span style="font-weight: bold;color: #F56C6C;cursor: pointer;" data-ref="${ref}" >${
@@ -644,8 +624,6 @@ export default {
warningText += ', and '; warningText += ', and ';
} }
}); });
//console.log(warningText);
return warningText; return warningText;
}, },
getParsingData() { getParsingData() {
@@ -665,15 +643,12 @@ export default {
}) })
.then((res) => { .then((res) => {
loading.close(); loading.close();
this.isShowParsing = false; this.isShowParsing = false;
(this.isShowParsingData = true), (this.refenceForm.joura = res.data.joura); (this.isShowParsingData = true), (this.refenceForm.joura = res.data.joura);
this.refenceForm.author = res.data.author; this.refenceForm.author = res.data.author;
this.refenceForm.dateno = res.data.dateno; this.refenceForm.dateno = res.data.dateno;
this.refenceForm.doilink = res.data.doilink; this.refenceForm.doilink = res.data.doilink;
// if(this.dialogTitle == 'Add'&&this.SourceType == 'journal'){
this.refenceForm.doi = res.data.doi; this.refenceForm.doi = res.data.doi;
// }
this.refenceForm.title = res.data.title; this.refenceForm.title = res.data.title;
this.refenceForm.isbn = this.refenceForm.refer_type == 'book' ? res.data.doilink : res.data.isbn; this.refenceForm.isbn = this.refenceForm.refer_type == 'book' ? res.data.doilink : res.data.isbn;
}) })
@@ -690,18 +665,13 @@ export default {
p_refer_id: id p_refer_id: id
}) })
.then((res) => { .then((res) => {
//console.log('res at line 499:', res)
if (res.status == 1) { if (res.status == 1) {
return res.data; return res.data;
} else {
this.$message.error(res.msg);
return Promise.reject(res.msg);
} }
throw res.msg;
}) })
.catch((err) => { .catch((err) => {
this.$message.error(err); this.$message.error(err);
// 确保错误被向上传递
return Promise.reject(err); return Promise.reject(err);
}); });
}, },
@@ -1021,12 +991,12 @@ export default {
this.dialogTitle = optitle; this.dialogTitle = optitle;
this.isShowParsing = false; this.isShowParsing = false;
this.isShowParsingData = false; this.isShowParsingData = false;
try {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: 'Loading...', text: 'Loading...',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
try {
var data = await this.getRefData(row.p_refer_id); var data = await this.getRefData(row.p_refer_id);
this.SourceType = data.refer_type ? data.refer_type : ''; this.SourceType = data.refer_type ? data.refer_type : '';