pdf按钮生成
This commit is contained in:
@@ -56,5 +56,6 @@
|
|||||||
"less-loader": "^5.0.0",
|
"less-loader": "^5.0.0",
|
||||||
"sass-loader": "^7.3.1",
|
"sass-loader": "^7.3.1",
|
||||||
"vue-template-compiler": "^2.6.10"
|
"vue-template-compiler": "^2.6.10"
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -572,6 +572,7 @@ myfigure *,
|
|||||||
ed.on('paste', async (event) => {
|
ed.on('paste', async (event) => {
|
||||||
const rtf = event.clipboardData.getData('text/rtf');
|
const rtf = event.clipboardData.getData('text/rtf');
|
||||||
if (rtf && rtf.includes('\\pict')) {
|
if (rtf && rtf.includes('\\pict')) {
|
||||||
|
|
||||||
const extracted = extractHexImagesFromRTF(rtf);
|
const extracted = extractHexImagesFromRTF(rtf);
|
||||||
_this.totalUploadImages = extracted.length; // 设置总数
|
_this.totalUploadImages = extracted.length; // 设置总数
|
||||||
_this.uploadedImageCount = 0; // 重置已上传数
|
_this.uploadedImageCount = 0; // 重置已上传数
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<el-form-item style="">
|
<el-form-item style="">
|
||||||
|
|
||||||
<div style="position: relative; top: 4px; margin-left: 14px">
|
<div style="position: relative; top: 4px; margin-left: 14px">
|
||||||
|
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="uploadFile"
|
ref="uploadFile"
|
||||||
class="upload-demo up_newstyle"
|
class="upload-demo up_newstyle"
|
||||||
@@ -83,7 +84,7 @@ export default {
|
|||||||
figure_copyright: this.value,
|
figure_copyright: this.value,
|
||||||
user_id: localStorage.getItem('U_id'),
|
user_id: localStorage.getItem('U_id'),
|
||||||
type: 'figurecopyright',
|
type: 'figurecopyright',
|
||||||
url: this.value==1?this.fileList[0].url:'',
|
url: this.fileList[0].url,
|
||||||
// is_figure_copyright: this.value
|
// is_figure_copyright: this.value
|
||||||
}
|
}
|
||||||
var this_ = this;
|
var this_ = this;
|
||||||
|
|||||||
@@ -45,6 +45,13 @@
|
|||||||
$${{ latex }}$$</textarea
|
$${{ latex }}$$</textarea
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin-bottom: 15px;">
|
||||||
|
<p style="padding: 10px 0; color: #333;">Text Wrap</p>
|
||||||
|
<el-select v-model="wrapMode" placeholder="Select wrap mode" style="width: 100%">
|
||||||
|
<el-option label="Text above and below" value="block"></el-option>
|
||||||
|
<el-option label="Inline with text" value="inline"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
<div style="margin-top: 10px; overflow: hidden">
|
<div style="margin-top: 10px; overflow: hidden">
|
||||||
<el-button type="primary" @click="SaveyLatex" style="background-color: #1654f7 !important; float: right"
|
<el-button type="primary" @click="SaveyLatex" style="background-color: #1654f7 !important; float: right"
|
||||||
>Submit</el-button
|
>Submit</el-button
|
||||||
@@ -94,7 +101,8 @@ export default {
|
|||||||
list: formulaTemplates,
|
list: formulaTemplates,
|
||||||
latex: '', // 默认公式
|
latex: '', // 默认公式
|
||||||
mathFieldInstance: null,
|
mathFieldInstance: null,
|
||||||
showLatex: false // 控制 LaTeX 代码框的显示与隐藏
|
showLatex: false, // 控制 LaTeX 代码框的显示与隐藏
|
||||||
|
wrapMode: 'block',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -102,6 +110,9 @@ export default {
|
|||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
this.latex = this.$route.query.id;
|
this.latex = this.$route.query.id;
|
||||||
}
|
}
|
||||||
|
if (this.$route.query.wrap ) {
|
||||||
|
this.wrapMode = this.$route.query.wrap;
|
||||||
|
}
|
||||||
if (this.$refs.mathField) {
|
if (this.$refs.mathField) {
|
||||||
const mf = new MathfieldElement();
|
const mf = new MathfieldElement();
|
||||||
mf.style.width = '100%';
|
mf.style.width = '100%';
|
||||||
@@ -202,7 +213,8 @@ export default {
|
|||||||
type: 'update-wmath',
|
type: 'update-wmath',
|
||||||
latex: this.latex && this.latex != '' ? `$$${this.latex}$$` : '',
|
latex: this.latex && this.latex != '' ? `$$${this.latex}$$` : '',
|
||||||
editorId: editorId,
|
editorId: editorId,
|
||||||
wmathId: wmathId
|
wmathId: wmathId,
|
||||||
|
wrapMode: this.wrapMode
|
||||||
},
|
},
|
||||||
'*'
|
'*'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -976,7 +976,7 @@
|
|||||||
<div v-if="isEditComment" class="menu-item comment-feat" @mousedown="cacheSelection" @click="menuAction('comment')">
|
<div v-if="isEditComment" class="menu-item comment-feat" @mousedown="cacheSelection" @click="menuAction('comment')">
|
||||||
<i class="el-icon-chat-line-square"></i><span>{{ $t('commonTable.Annotations') }}</span>
|
<i class="el-icon-chat-line-square"></i><span>{{ $t('commonTable.Annotations') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-divider" v-if="isEditComment &¤tData.type == 0"></div>
|
<div class="row-divider" v-if="isEditComment && currentData.type == 0"></div>
|
||||||
|
|
||||||
<div class="menu-item menu-link" v-if="currentData.type == 0 && !currentTag" @click="menuAction('link')">
|
<div class="menu-item menu-link" v-if="currentData.type == 0 && !currentTag" @click="menuAction('link')">
|
||||||
<i class="el-icon-link"></i><span>{{ $t('commonTable.Association') }}</span>
|
<i class="el-icon-link"></i><span>{{ $t('commonTable.Association') }}</span>
|
||||||
@@ -1282,7 +1282,7 @@ export default {
|
|||||||
// 依然保留 trim() 后的文本判断,用来决定是否显示气泡
|
// 依然保留 trim() 后的文本判断,用来决定是否显示气泡
|
||||||
const plainText = selection.toString().trim();
|
const plainText = selection.toString().trim();
|
||||||
|
|
||||||
if (plainText !== ''&& selection.rangeCount > 0) {
|
if (plainText !== '' && selection.rangeCount > 0) {
|
||||||
// --- 1. 获取包含标签的 HTML 内容 ---
|
// --- 1. 获取包含标签的 HTML 内容 ---
|
||||||
const fragment = range.cloneContents();
|
const fragment = range.cloneContents();
|
||||||
const tempDiv = document.createElement('div');
|
const tempDiv = document.createElement('div');
|
||||||
@@ -1307,15 +1307,15 @@ export default {
|
|||||||
this.currentId = allIds[0];
|
this.currentId = allIds[0];
|
||||||
this.currentData = rootItem;
|
this.currentData = rootItem;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.currentTag= '';
|
this.currentTag = '';
|
||||||
this.currentTagData={};
|
this.currentTagData = {};
|
||||||
this.currentSelection={
|
this.currentSelection = {
|
||||||
label: '',
|
label: '',
|
||||||
mainId: '',
|
mainId: '',
|
||||||
index: 0,
|
index: 0,
|
||||||
content: {}
|
content: {}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -1472,7 +1472,6 @@ export default {
|
|||||||
|
|
||||||
this.bubbleVisible = true;
|
this.bubbleVisible = true;
|
||||||
|
|
||||||
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
handleGlobalClick(e) {
|
handleGlobalClick(e) {
|
||||||
@@ -1500,101 +1499,6 @@ export default {
|
|||||||
document.querySelectorAll('.glowing-border').forEach((el) => el.classList.remove('glowing-border'));
|
document.querySelectorAll('.glowing-border').forEach((el) => el.classList.remove('glowing-border'));
|
||||||
},
|
},
|
||||||
|
|
||||||
// handleMouseUp(e) {
|
|
||||||
// const selection = window.getSelection();
|
|
||||||
// // 1. 检查是否有文字选中
|
|
||||||
// if (selection.isCollapsed || selection.toString().trim() === '') {
|
|
||||||
// this.bubbleVisible = false;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// let selectedText = selection.toString().trim();
|
|
||||||
// // 2. 核心逻辑:只抓取选区“起点”所在的段落
|
|
||||||
// let anchorNode = selection.anchorNode;
|
|
||||||
// if (anchorNode.nodeType === 3) anchorNode = anchorNode.parentElement;
|
|
||||||
|
|
||||||
// // 向上寻找最近的带有 data-id 的主节点
|
|
||||||
// const mainNode = anchorNode.closest('[data-id]') || e.target.closest('[data-id]');
|
|
||||||
|
|
||||||
// if (mainNode) {
|
|
||||||
// // --- A. 提取 ID、Index 等关键信息 ---
|
|
||||||
// const id = mainNode.getAttribute('data-id');
|
|
||||||
// const mainId = mainNode.getAttribute('main-id');
|
|
||||||
// const index = parseInt(mainNode.getAttribute('data-index'));
|
|
||||||
// let typeNode = mainNode;
|
|
||||||
// let type = typeNode.getAttribute('type');
|
|
||||||
|
|
||||||
// // 如果当前节点没有 type,向上递归寻找,直到找到或到达顶层
|
|
||||||
// while (typeNode && !type) {
|
|
||||||
// typeNode = typeNode.parentElement;
|
|
||||||
// if (typeNode) {
|
|
||||||
// type = typeNode.getAttribute('type');
|
|
||||||
// } else {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 最终赋值,如果都没找到则默认为 'text'
|
|
||||||
// this.menuType = type || 'text';
|
|
||||||
|
|
||||||
// // --- B. 强制单一赋值 ---
|
|
||||||
// this.currentId = mainId || id;
|
|
||||||
// this.currentIndex = index;
|
|
||||||
// this.currentData = this.wordList[index];
|
|
||||||
|
|
||||||
// // --- C. 选区体验优化 (核心改进点) ---
|
|
||||||
// const range = selection.getRangeAt(0);
|
|
||||||
|
|
||||||
// // 逻辑:如果选区的结束点不在 mainNode 内部(说明选多了/跨段了)
|
|
||||||
// if (!mainNode.contains(range.endContainer)) {
|
|
||||||
// const newRange = document.createRange();
|
|
||||||
// newRange.setStart(range.startContainer, range.startOffset);
|
|
||||||
// // 强制将终点设置在当前段落的末尾
|
|
||||||
// newRange.setEndAfter(mainNode.lastChild);
|
|
||||||
|
|
||||||
// selection.removeAllRanges();
|
|
||||||
// selection.addRange(newRange);
|
|
||||||
|
|
||||||
// // 重新获取裁剪后的文本
|
|
||||||
// selectedText = selection.toString().trim();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // --- D. 记录选中的内容数据 ---
|
|
||||||
// this.currentSelection = {
|
|
||||||
// label: selectedText,
|
|
||||||
// mainId: this.currentId,
|
|
||||||
// index: index,
|
|
||||||
// content: this.wordList[index] ? this.wordList[index].content : ''
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // --- E. 业务初始化(拉取按钮数据) ---
|
|
||||||
// if (!this.isPreview) {
|
|
||||||
// this.getProofreadingList([id]);
|
|
||||||
// this.getPList(id);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // --- F. 定位逻辑 (Fixed 定位) ---
|
|
||||||
// const rect = selection.getRangeAt(0).getBoundingClientRect();
|
|
||||||
// const bubbleHeight = 75;
|
|
||||||
// const toolbarHeight = 125;
|
|
||||||
|
|
||||||
// // 判断是否被顶部工具栏挡住
|
|
||||||
// const isOverlappingToolbar = rect.top < toolbarHeight + bubbleHeight;
|
|
||||||
// this.bubbleDirection = isOverlappingToolbar ? 'bottom' : 'top';
|
|
||||||
// const finalTop = isOverlappingToolbar ? rect.bottom + 10 : rect.top - bubbleHeight - 5;
|
|
||||||
|
|
||||||
// this.bubbleStyle = {
|
|
||||||
// position: 'fixed',
|
|
||||||
// left: `${rect.left + rect.width / 2}px`,
|
|
||||||
// top: `${finalTop}px`,
|
|
||||||
// zIndex: 9999,
|
|
||||||
// display: 'block'
|
|
||||||
// };
|
|
||||||
|
|
||||||
// this.isMenuVisible = true;
|
|
||||||
// this.bubbleVisible = true;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
convertWordListToHtml() {
|
convertWordListToHtml() {
|
||||||
let htmlString = '';
|
let htmlString = '';
|
||||||
const mediaUrl = this.mediaUrl || ''; // 确保 mediaUrl 存在
|
const mediaUrl = this.mediaUrl || ''; // 确保 mediaUrl 存在
|
||||||
@@ -1844,11 +1748,6 @@ export default {
|
|||||||
async initMarkersList() {
|
async initMarkersList() {
|
||||||
await this.getPList();
|
await this.getPList();
|
||||||
await this.calcMarkers();
|
await this.calcMarkers();
|
||||||
// if (this.markers.length > 0) {
|
|
||||||
// this.totalItems = this.markers.length;
|
|
||||||
// // this.currentItem = 1;
|
|
||||||
// // await this.getProofreadingList([this.markers[this.currentItem - 1].am_id]);
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
async calcMarkers() {
|
async calcMarkers() {
|
||||||
const colors = { 2: '#f97316', 1: '#3b82f6', 3: '#10b981' }; // 可自定义
|
const colors = { 2: '#f97316', 1: '#3b82f6', 3: '#10b981' }; // 可自定义
|
||||||
@@ -2040,13 +1939,12 @@ export default {
|
|||||||
this.isMenuVisible = true;
|
this.isMenuVisible = true;
|
||||||
},
|
},
|
||||||
closeMenu() {
|
closeMenu() {
|
||||||
this.bubbleVisible = false;
|
this.bubbleVisible = false;
|
||||||
|
|
||||||
this.isMenuVisible = false;
|
this.isMenuVisible = false;
|
||||||
},
|
},
|
||||||
handleAIProofreading() {
|
handleAIProofreading() {
|
||||||
if (this.currentId) {
|
if (this.currentId) {
|
||||||
|
|
||||||
this.$api
|
this.$api
|
||||||
.post('api/Proofread/proofReadByLine', {
|
.post('api/Proofread/proofReadByLine', {
|
||||||
am_id: this.currentId,
|
am_id: this.currentId,
|
||||||
@@ -2078,12 +1976,12 @@ export default {
|
|||||||
case 'jump':
|
case 'jump':
|
||||||
this.handleClickJump();
|
this.handleClickJump();
|
||||||
break;
|
break;
|
||||||
case 'editLink':
|
case 'editLink':
|
||||||
this.handleEditLink();
|
this.handleEditLink();
|
||||||
break;
|
break;
|
||||||
case 'unbindLink':
|
case 'unbindLink':
|
||||||
this.handleUnbindLink();
|
this.handleUnbindLink();
|
||||||
break;
|
break;
|
||||||
case 'proofreading':
|
case 'proofreading':
|
||||||
this.handleAIProofreading();
|
this.handleAIProofreading();
|
||||||
break;
|
break;
|
||||||
@@ -2553,7 +2451,6 @@ export default {
|
|||||||
// 确保选择到最外层 div
|
// 确保选择到最外层 div
|
||||||
const outerDiv = e.target.closest('.drop-target') || e.target;
|
const outerDiv = e.target.closest('.drop-target') || e.target;
|
||||||
|
|
||||||
|
|
||||||
if (outerDiv) {
|
if (outerDiv) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2838,7 +2735,6 @@ export default {
|
|||||||
await this.initializeEditor(event, item.am_id, 'text', item, index);
|
await this.initializeEditor(event, item.am_id, 'text', item, index);
|
||||||
},
|
},
|
||||||
initializeEditor: throttle(async function (event, id, type, data, index) {
|
initializeEditor: throttle(async function (event, id, type, data, index) {
|
||||||
|
|
||||||
this.isInternalAction = true; // 开启锁定
|
this.isInternalAction = true; // 开启锁定
|
||||||
if (event && event.stopPropagation) {
|
if (event && event.stopPropagation) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@@ -2874,8 +2770,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isInternalAction = false;
|
this.isInternalAction = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
}, 100),
|
}, 100),
|
||||||
dblclickEdit(id, type, data, index) {
|
dblclickEdit(id, type, data, index) {
|
||||||
if (!this.isPreview) {
|
if (!this.isPreview) {
|
||||||
@@ -2931,12 +2827,11 @@ export default {
|
|||||||
await this.goToComment(data.am_id, fn);
|
await this.goToComment(data.am_id, fn);
|
||||||
},
|
},
|
||||||
divOnScroll() {
|
divOnScroll() {
|
||||||
|
|
||||||
// if (this.isInternalAction) return; // 如果是内部点击引起的微调,直接跳过
|
// if (this.isInternalAction) return; // 如果是内部点击引起的微调,直接跳过
|
||||||
const newScrollTop = this.$refs.scrollDiv.scrollTop;
|
const newScrollTop = this.$refs.scrollDiv.scrollTop;
|
||||||
// 如果滚动距离变化极小(可能是点击微调),则跳过
|
// 如果滚动距离变化极小(可能是点击微调),则跳过
|
||||||
if (Math.abs(newScrollTop - (this.lastScrollTop || 0)) < 10) return;
|
if (Math.abs(newScrollTop - (this.lastScrollTop || 0)) < 10) return;
|
||||||
this.lastScrollTop = newScrollTop;
|
this.lastScrollTop = newScrollTop;
|
||||||
|
|
||||||
this.clearHighlight();
|
this.clearHighlight();
|
||||||
|
|
||||||
@@ -4307,7 +4202,8 @@ export default {
|
|||||||
}
|
}
|
||||||
.table-box tr:first-child td {
|
.table-box tr:first-child td {
|
||||||
border-top: 1px solid #000 !important;
|
border-top: 1px solid #000 !important;
|
||||||
}.tableNote {
|
}
|
||||||
|
.tableNote {
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
@@ -4449,9 +4345,13 @@ wmath {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.menu-jump {
|
.menu-jump {
|
||||||
color: #67c23a;
|
color: #67c23a;
|
||||||
}
|
}
|
||||||
.pMain{
|
.pMain {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
::v-deep wmath[data-wrap='inline'] {
|
||||||
|
display: inline-block !important;
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user