|
|
@@ -594,6 +594,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getRichContent() {
|
|
|
+ return tinymce.get(this.id).getContent();
|
|
|
+ },
|
|
|
displayToolbar(isTitle, isInit) {
|
|
|
if (!this.editorIsInited) {
|
|
|
this.editorBeforeInitConfig['isTitle'] = isTitle;
|
|
|
@@ -937,7 +940,7 @@ export default {
|
|
|
let start = editor.selection.getStart();
|
|
|
if (isNodeType(start, 'span')) {
|
|
|
let textContent = start.textContent;
|
|
|
- let content = editor.selection.getContent();
|
|
|
+ let content = this.getRichContent();
|
|
|
let str = textContent.split(content);
|
|
|
start.remove();
|
|
|
editor.selection.setContent(str.join(content));
|
|
|
@@ -949,7 +952,7 @@ export default {
|
|
|
setContent() {
|
|
|
let editor = tinymce.get(this.id);
|
|
|
let start = editor.selection.getStart();
|
|
|
- let content = editor.selection.getContent();
|
|
|
+ let content = this.getRichContent();
|
|
|
if (isNodeType(start, 'span')) {
|
|
|
let textContent = start.textContent;
|
|
|
let str = textContent.split(content);
|
|
|
@@ -984,13 +987,13 @@ export default {
|
|
|
// },
|
|
|
handleRichTextBlur() {
|
|
|
this.$emit('handleRichTextBlur', this.itemIndex);
|
|
|
- let content = tinymce.get(this.id).getContent();
|
|
|
+ let content = this.getRichContent();
|
|
|
|
|
|
if (this.isViewPinyin) {
|
|
|
- // this.createParsedTextInfoPinyin(content);
|
|
|
- let styles = this.getFirstCharStyles();
|
|
|
- let text = content.replace(/<[^>]+>/g, '');
|
|
|
- this.$emit('createParsedTextInfoPinyin', text, styles);
|
|
|
+ //updated by 2026-3-24 失去焦点时,不再生成拼音,改成手动点击生成拼音
|
|
|
+ // let styles = this.getFirstCharStyles();
|
|
|
+ // let text = content.replace(/<[^>]+>/g, '');
|
|
|
+ // this.$emit('createParsedTextInfoPinyin', text, styles);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1116,7 +1119,7 @@ export default {
|
|
|
let noteId = '';
|
|
|
let editor = tinymce.get(this.id);
|
|
|
let start = editor.selection.getStart();
|
|
|
- let content = editor.selection.getContent();
|
|
|
+ let content = this.getRichContent();
|
|
|
if (isNodeType(start, 'span')) {
|
|
|
noteId = start.getAttribute('data-annotation-id');
|
|
|
} else {
|
|
|
@@ -1136,7 +1139,7 @@ export default {
|
|
|
let start = editor.selection.getStart();
|
|
|
if (isNodeType(start, 'span')) {
|
|
|
let textContent = start.textContent;
|
|
|
- let content = editor.selection.getContent();
|
|
|
+ let content = this.getRichContent();
|
|
|
let str = textContent.split(content);
|
|
|
start.remove();
|
|
|
editor.selection.setContent(str.join(content));
|