|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
<div>
|
|
|
|
|
<vxe-modal
|
|
|
|
|
:width="defaultModalSize.width"
|
|
|
|
|
v-model="showModal"
|
|
|
|
|
:height="defaultModalSize.height"
|
|
|
|
|
show-zoom
|
|
|
|
|
resize
|
|
|
|
|
@ -12,42 +13,48 @@
|
|
|
|
|
show-cancel-button
|
|
|
|
|
:fullscreen="$store.getters.device === 'mobile'"
|
|
|
|
|
:z-index="zIndex"
|
|
|
|
|
v-model="showModal"
|
|
|
|
|
title="文本"
|
|
|
|
|
@confirm="confirm"
|
|
|
|
|
>
|
|
|
|
|
<template>
|
|
|
|
|
<my-tinymce style="height: 100%;" v-model="myText" :disabled="readonly" />
|
|
|
|
|
<my-tinymce v-model="myText" style="height: 100%;" :disabled="readonly" />
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { PopupManager } from "element-ui/lib/utils/popup";
|
|
|
|
|
import { defaultModalSize } from "@/settings";
|
|
|
|
|
import { PopupManager } from 'element-ui/lib/utils/popup'
|
|
|
|
|
import { defaultModalSize } from '@/settings'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "RichTextModal",
|
|
|
|
|
name: 'RichTextModal',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
defaultModalSize,
|
|
|
|
|
zIndex: PopupManager.nextZIndex(),
|
|
|
|
|
showModal:false,
|
|
|
|
|
myText: "",
|
|
|
|
|
showModal: false,
|
|
|
|
|
myText: '',
|
|
|
|
|
readonly: false,
|
|
|
|
|
fieldName: "",
|
|
|
|
|
fieldName: '',
|
|
|
|
|
row: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.$bus.$on('rich-text', ({ text, readonly }) => this.open(text, readonly))
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
this.$bus.$off('rich-text')
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
open({text, readonly, row, fieldName}) {
|
|
|
|
|
this.showModal = true;
|
|
|
|
|
open({ text, readonly, row, fieldName }) {
|
|
|
|
|
this.showModal = true
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.myText = text;
|
|
|
|
|
this.readonly = !!readonly;
|
|
|
|
|
this.row = row;
|
|
|
|
|
this.fieldName = fieldName;
|
|
|
|
|
this.myText = text
|
|
|
|
|
this.readonly = !!readonly
|
|
|
|
|
this.row = row
|
|
|
|
|
this.fieldName = fieldName
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
confirm() {
|
|
|
|
|
@ -60,13 +67,6 @@ export default {
|
|
|
|
|
console.log(this.myText)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.$bus.$on('rich-text',({text, readonly}) => this.open(text, readonly))
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
this.$bus.$off('rich-text')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|