数字公式优化
This commit is contained in:
@@ -1702,12 +1702,13 @@ export default {
|
|||||||
this.lineStyle1[type] = str;
|
this.lineStyle1[type] = str;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEdit(dataId) {
|
onEdit(dataId, options) {
|
||||||
this.currentContent = {};
|
this.currentContent = {};
|
||||||
this.picStyle = {};
|
this.picStyle = {};
|
||||||
this.lineStyle = {};
|
this.lineStyle = {};
|
||||||
this.currentId = null;
|
this.currentId = null;
|
||||||
this.clearButton();
|
this.clearButton();
|
||||||
|
const wmathId = options && options.wmathId;
|
||||||
var data = this.Main_List.find((item) => item.am_id == dataId);
|
var data = this.Main_List.find((item) => item.am_id == dataId);
|
||||||
// console.log('data at line 667:', data);
|
// console.log('data at line 667:', data);
|
||||||
if (data.type == 1) {
|
if (data.type == 1) {
|
||||||
@@ -1742,8 +1743,21 @@ export default {
|
|||||||
|
|
||||||
this.editVisible = true;
|
this.editVisible = true;
|
||||||
this.currentId = dataId;
|
this.currentId = dataId;
|
||||||
|
if (wmathId) {
|
||||||
|
this.$nextTick(() => this.openWmathInEditDialog(wmathId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
openWmathInEditDialog(wmathId, retry = 0) {
|
||||||
|
const content = this.$refs.commonContent;
|
||||||
|
if (!content || typeof content.openWmathForEdit !== 'function') {
|
||||||
|
if (retry < 40) {
|
||||||
|
setTimeout(() => this.openWmathInEditDialog(wmathId, retry + 1), 100);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
content.openWmathForEdit(wmathId);
|
||||||
|
},
|
||||||
onAddContent(dataId) {
|
onAddContent(dataId) {
|
||||||
this.addContentVisible = true;
|
this.addContentVisible = true;
|
||||||
this.addContent = {};
|
this.addContent = {};
|
||||||
|
|||||||
@@ -1448,12 +1448,13 @@ export default {
|
|||||||
this.lineStyle1[type] = str;
|
this.lineStyle1[type] = str;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEdit(dataId) {
|
onEdit(dataId, options) {
|
||||||
this.currentContent = {};
|
this.currentContent = {};
|
||||||
this.picStyle = {};
|
this.picStyle = {};
|
||||||
this.lineStyle = {};
|
this.lineStyle = {};
|
||||||
this.currentId = null;
|
this.currentId = null;
|
||||||
this.clearButton();
|
this.clearButton();
|
||||||
|
const wmathId = options && options.wmathId;
|
||||||
var data = this.Main_List.find((item) => item.am_id == dataId);
|
var data = this.Main_List.find((item) => item.am_id == dataId);
|
||||||
// console.log('data at line 667:', data);
|
// console.log('data at line 667:', data);
|
||||||
if (data.type == 1) {
|
if (data.type == 1) {
|
||||||
@@ -1488,8 +1489,21 @@ export default {
|
|||||||
|
|
||||||
this.editVisible = true;
|
this.editVisible = true;
|
||||||
this.currentId = dataId;
|
this.currentId = dataId;
|
||||||
|
if (wmathId) {
|
||||||
|
this.$nextTick(() => this.openWmathInEditDialog(wmathId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
openWmathInEditDialog(wmathId, retry = 0) {
|
||||||
|
const content = this.$refs.commonContent;
|
||||||
|
if (!content || typeof content.openWmathForEdit !== 'function') {
|
||||||
|
if (retry < 40) {
|
||||||
|
setTimeout(() => this.openWmathInEditDialog(wmathId, retry + 1), 100);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
content.openWmathForEdit(wmathId);
|
||||||
|
},
|
||||||
onAddContent(dataId) {
|
onAddContent(dataId) {
|
||||||
this.addContentVisible = true;
|
this.addContentVisible = true;
|
||||||
this.addContent = {};
|
this.addContent = {};
|
||||||
|
|||||||
@@ -163,6 +163,24 @@ export default {
|
|||||||
this.destroyTinymce();
|
this.destroyTinymce();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openWmathForEdit(wmathId, retry = 0) {
|
||||||
|
if (!wmathId) return;
|
||||||
|
const ed = window.tinymce.get(this.tinymceId);
|
||||||
|
if (!ed || !this.hasInit) {
|
||||||
|
if (retry < 40) {
|
||||||
|
setTimeout(() => this.openWmathForEdit(wmathId, retry + 1), 100);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const wmath = ed.getBody().querySelector('wmath[data-id="' + wmathId + '"]');
|
||||||
|
if (wmath) {
|
||||||
|
this.$commonJS.editInlineMathWithMathlive(ed, wmath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (retry < 40) {
|
||||||
|
setTimeout(() => this.openWmathForEdit(wmathId, retry + 1), 100);
|
||||||
|
}
|
||||||
|
},
|
||||||
handleSetContent(val) {
|
handleSetContent(val) {
|
||||||
if (!this.editorInstance) return;
|
if (!this.editorInstance) return;
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ export default {
|
|||||||
getTinymceContent(type) {
|
getTinymceContent(type) {
|
||||||
this.$refs.tinymceChild1.getContent(type);
|
this.$refs.tinymceChild1.getContent(type);
|
||||||
},
|
},
|
||||||
|
openWmathForEdit(wmathId) {
|
||||||
|
if (this.$refs.tinymceChild1 && typeof this.$refs.tinymceChild1.openWmathForEdit === 'function') {
|
||||||
|
this.$refs.tinymceChild1.openWmathForEdit(wmathId);
|
||||||
|
}
|
||||||
|
},
|
||||||
getContent(type, content) {
|
getContent(type, content) {
|
||||||
|
|
||||||
this.$emit('getContent', type, content);
|
this.$emit('getContent', type, content);
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
class="latex-toolbar-trigger"
|
class="latex-toolbar-trigger"
|
||||||
@click.stop="toggleLatexPopover"
|
@click.stop="toggleLatexPopover"
|
||||||
>
|
>
|
||||||
<i class="el-icon-s-data latex-toolbar-icon"></i>
|
|
||||||
{{ $t('commonTable.mathFormula') }}
|
{{ $t('commonTable.mathFormula') }}
|
||||||
</span>
|
</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
@@ -3036,6 +3035,14 @@ export default {
|
|||||||
this.onProofSpanClick(event);
|
this.onProofSpanClick(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wmathEl = event.target && event.target.closest && event.target.closest('wmath');
|
||||||
|
if (wmathEl && !this.isPreview) {
|
||||||
|
const wmathId = wmathEl.getAttribute('data-id');
|
||||||
|
await this.initializeEditor(event, item.am_id, 'text', item, index);
|
||||||
|
this.$emit('onEdit', item.am_id, wmathId ? { wmathId } : undefined);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
@@ -4545,6 +4552,7 @@ export default {
|
|||||||
|
|
||||||
wmath {
|
wmath {
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.word-tool {
|
.word-tool {
|
||||||
border-bottom: 2px solid #c7cdcf;
|
border-bottom: 2px solid #c7cdcf;
|
||||||
@@ -4696,12 +4704,6 @@ font-weight: bold !important;
|
|||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latex-toolbar-icon {
|
|
||||||
margin-right: 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.latex-toolbar-popover {
|
.latex-toolbar-popover {
|
||||||
|
|||||||
Reference in New Issue
Block a user