forked from github/dataease
fix(仪表板):修复部分富文本组件样式无法保存问题
This commit is contained in:
parent
a3da449e79
commit
38074db9f2
@ -37,7 +37,6 @@ import 'tinymce/plugins/nonbreaking'
|
||||
import 'tinymce/plugins/pagebreak'
|
||||
import { mapState } from 'vuex'
|
||||
import Vue from 'vue'
|
||||
import xssCheck from 'xss'
|
||||
|
||||
export default {
|
||||
name: 'DeRichText',
|
||||
@ -78,7 +77,7 @@ export default {
|
||||
canEdit: false,
|
||||
// 初始化配置
|
||||
tinymceId: 'tinymce-' + this.element.id,
|
||||
myValue: xssCheck(this.propValue),
|
||||
myValue: this.propValue,
|
||||
init: {
|
||||
selector: '#tinymce-' + this.element.id,
|
||||
toolbar_items_size: 'small',
|
||||
|
@ -38,7 +38,6 @@ import 'tinymce/plugins/pagebreak'
|
||||
import { mapState } from 'vuex'
|
||||
import bus from '@/utils/bus'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import xssCheck from 'xss'
|
||||
|
||||
export default {
|
||||
name: 'DeRichTextView',
|
||||
@ -140,6 +139,10 @@ export default {
|
||||
}
|
||||
},
|
||||
myValue(newValue) {
|
||||
if (this.canEdit) {
|
||||
const ed = tinymce.editors[this.tinymceId]
|
||||
this.element.propValue.textValue = ed.getContent()
|
||||
}
|
||||
this.initReady && this.$store.commit('canvasChange')
|
||||
}
|
||||
},
|
||||
@ -153,7 +156,7 @@ export default {
|
||||
viewInit() {
|
||||
bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect)
|
||||
tinymce.init({})
|
||||
this.myValue = xssCheck(this.assignment(this.element.propValue.textValue))
|
||||
this.myValue = this.assignment(this.element.propValue.textValue)
|
||||
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
|
||||
this.$nextTick(() => {
|
||||
this.initReady = true
|
||||
|
@ -10,6 +10,7 @@ import { uuid } from 'vue-uuid'
|
||||
import store from '@/store'
|
||||
import { AIDED_DESIGN, MOBILE_SETTING, PAGE_LINE_DESIGN, PANEL_CHART_INFO, TAB_COMMON_STYLE } from '@/views/panel/panel'
|
||||
import html2canvas from 'html2canvasde'
|
||||
import xssCheck from 'xss'
|
||||
|
||||
export function deepCopy(target) {
|
||||
if (typeof target === 'object' && target !== null) {
|
||||
@ -101,6 +102,9 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
|
||||
componentStyle.chartCommonStyle = deepCopy(COMMON_BACKGROUND)
|
||||
}
|
||||
componentData.forEach((item, index) => {
|
||||
if (item.component && item.component === 'v-text') {
|
||||
item.propValue = xssCheck(item.propValue)
|
||||
}
|
||||
if (item.component && item.component === 'de-date') {
|
||||
const widget = ApplicationContext.getService(item.serviceName)
|
||||
if (item.options.attrs &&
|
||||
|
Loading…
Reference in New Issue
Block a user