forked from github/dataease
commit
7544c1b0c5
@ -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()
|
||||
@ -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]
|
||||
|
@ -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()
|
||||
}
|
||||
@ -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) {
|
||||
@ -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="' +
|
||||
@ -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) {
|
||||
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user