Skip to content

Commit

Permalink
Merge pull request #10464 from dataease/pr@dev-v2_st
Browse files Browse the repository at this point in the history
fix(仪表板): 富文本测试
  • Loading branch information
dataeaseShu committed Jun 24, 2024
2 parents 4bb41ce + 8faa510 commit 7544c1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions core/core-frontend/src/components/plugin/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as Vue from 'vue'
import axios from 'axios'
import * as Pinia from 'pinia'
import * as vueRouter from 'vue-router'
import tinymce from 'tinymce/tinymce'
import { useEmitt } from '@/hooks/web/useEmitt'
const { wsCache } = useCache()
Expand Down Expand Up @@ -109,6 +110,9 @@ onMounted(async () => {
window['vueRouter'] = vueRouter
window['MittAll'] = useEmitt().emitter.all
window['I18n'] = i18n
if (!window.tinymce) {
window.tinymce = tinymce
}
loadDistributed().then(async res => {
new Function(res.data)()
const xpack = await window['DEXPack'].mapping[attrs.jsname]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ watch(
() => active.value,
val => {
if (!val) {
const ed = window.tinymce.editors[tinymceId]
const ed = tinymce.editors[tinymceId]
if (canEdit.value) {
element.value.propValue.textValue = ed.getContent()
}
Expand All @@ -170,7 +170,7 @@ watch(
() => myValue.value,
() => {
if (canEdit.value) {
const ed = window.tinymce.editors[tinymceId]
const ed = tinymce.editors[tinymceId]
element.value.propValue.textValue = ed.getContent()
}
if (initReady.value && canEdit.value) {
Expand Down Expand Up @@ -245,7 +245,7 @@ const assignment = content => {
return content
}
const fieldSelect = field => {
const ed = window.tinymce.editors[tinymceId]
const ed = tinymce.editors[tinymceId]
const fieldId = 'changeText-' + guid()
const value =
'<span id="' +
Expand All @@ -262,12 +262,12 @@ const fieldSelect = field => {
}
const onClick = () => {
if (canEdit.value) {
const node = window.tinymce.activeEditor.selection.getNode()
const node = tinymce.activeEditor.selection.getNode()
resetSelect(node)
}
}
const resetSelect = (node?) => {
const edInner = window.tinymce.get(tinymceId)
const edInner = tinymce.get(tinymceId)
if (edInner?.dom) {
const nodeArray = edInner.dom.select('.base-selected')
if (nodeArray) {
Expand Down Expand Up @@ -316,7 +316,7 @@ const setEdit = () => {
canEdit.value = true
element.value['editing'] = true
myValue.value = element.value.propValue.textValue
const ed = window.tinymce.editors[tinymceId]
const ed = tinymce.editors[tinymceId]
ed.setContent(myValue.value)
reShow()
}
Expand Down

0 comments on commit 7544c1b

Please sign in to comment.