数字公式优化
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
//记得切换
|
||||
|
||||
//正式
|
||||
const mediaUrl = '/public/';
|
||||
const baseUrl = '/';
|
||||
// const mediaUrl = '/public/';
|
||||
// const baseUrl = '/';
|
||||
|
||||
//正式环境
|
||||
|
||||
// const mediaUrl = 'https://submission.tmrjournals.com/public/';
|
||||
// // const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
|
||||
// const baseUrl = '/api'
|
||||
const mediaUrl = 'https://submission.tmrjournals.com/public/';
|
||||
// const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
|
||||
const baseUrl = '/api'
|
||||
|
||||
//测试环境
|
||||
|
||||
|
||||
@@ -2614,5 +2614,10 @@ export default {
|
||||
wmath[data-wrap='inline'] {
|
||||
display: inline-block !important;
|
||||
width: auto !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
wmath[data-wrap='inline'] mjx-container {
|
||||
display: inline-block !important;
|
||||
margin: 0 2px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -641,6 +641,18 @@ export default {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
wmath {
|
||||
pointer-events: auto !important;
|
||||
cursor: pointer !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
wmath[contenteditable="false"] {
|
||||
cursor: pointer !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
@keyframes blueGlow {
|
||||
0%,
|
||||
100% {
|
||||
@@ -731,35 +743,24 @@ export default {
|
||||
e.preventDefault();
|
||||
_this.pasteClipboardAsMath(ed);
|
||||
});
|
||||
var currentWmathElement = null;
|
||||
|
||||
ed.on('click', function (e) {
|
||||
const wmathElement = e.target.closest('wmath');
|
||||
const wmathElement = _this.$commonJS.findWmathFromTarget
|
||||
? _this.$commonJS.findWmathFromTarget(e.target, ed.getBody())
|
||||
: null;
|
||||
if (wmathElement) {
|
||||
currentWmathElement = wmathElement; // 保存当前点击的元素
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
_this.$commonJS.editInlineMathWithMathlive(ed, wmathElement);
|
||||
}
|
||||
});
|
||||
|
||||
// 1. 提取内容:获取 LaTeX
|
||||
const latexContentRaw = wmathElement.getAttribute('data-latex') || '';
|
||||
const latexContent = latexContentRaw.replace(/\$/g, '').trim();
|
||||
const encoded = encodeURIComponent(latexContent);
|
||||
|
||||
// 2. 提取状态:获取之前的 wrap 模式 👈 重要新增
|
||||
const wrapMode = wmathElement.getAttribute('data-wrap') || 'block';
|
||||
|
||||
// 3. 处理唯一 ID
|
||||
let wmathId = wmathElement.getAttribute('data-id');
|
||||
if (!wmathId) {
|
||||
wmathId = 'wmath-' + Math.random().toString(36).substr(2, 9);
|
||||
wmathElement.setAttribute('data-id', wmathId);
|
||||
}
|
||||
|
||||
const editorId = ed.id;
|
||||
|
||||
// 4. 打开窗口:在 URL 参数中增加 wrap 模式 👈 这样弹窗就知道该默认选哪个了
|
||||
window.open(
|
||||
`/LateX?id=${encoded}&wmathId=${wmathId}&editorId=${editorId}&wrap=${wrapMode}`,
|
||||
'_blank',
|
||||
'width=1000,height=800,scrollbars=no,resizable=no'
|
||||
);
|
||||
ed.on('contextmenu', function (e) {
|
||||
const wmathElement = _this.$commonJS.findWmathFromTarget
|
||||
? _this.$commonJS.findWmathFromTarget(e.target, ed.getBody())
|
||||
: null;
|
||||
if (wmathElement) {
|
||||
_this.$commonJS.openWmathContextMenu(ed, wmathElement, e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -240,4 +240,29 @@ export default {
|
||||
|
||||
.table-fade-enter-active, .table-fade-leave-active { transition: opacity 0.3s ease; }
|
||||
.table-fade-enter, .table-fade-leave-to { opacity: 0; }
|
||||
|
||||
/* 表格预览:行内公式与文字同一行 */
|
||||
.table-paper-view ::v-deep wmath[data-wrap='inline'] {
|
||||
display: inline !important;
|
||||
width: auto !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.table-paper-view ::v-deep wmath[data-wrap='inline'] mjx-container {
|
||||
display: inline-block !important;
|
||||
width: auto !important;
|
||||
margin: 0 2px !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.table-paper-view ::v-deep wmath[data-wrap='inline'] mjx-container[display='true'] {
|
||||
display: inline-block !important;
|
||||
margin: 0 2px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.table-paper-view ::v-deep wmath[data-wrap='block'] {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -16,7 +16,7 @@
|
||||
:value="value"
|
||||
:typesettingType="typesettingType"
|
||||
class="paste-area text-container"
|
||||
:toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']"
|
||||
:toolbar="!isAutomaticUpdate?['bold italic |customBlue removeBlue|LateX Latex2| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']:['bold italic |customBlue removeBlue|Latex2| myuppercase myuppercasea Line MoreSymbols|subscript superscript|clearButton|searchreplace']"
|
||||
style="
|
||||
/* white-space: pre-line; */
|
||||
line-height: 12px;
|
||||
|
||||
Reference in New Issue
Block a user