Commit 92f46174 authored by FE-安焕焕's avatar FE-安焕焕 👣

编辑器问题

parent 1dfcf7c5
<template>
<div>
<textarea id="editor" rows="10" cols="80" v-model="editorValue"></textarea>
<textarea id="editor" rows="10" cols="80"></textarea>
</div>
</template>
<script type="text/ecmascript-6">
......@@ -31,20 +31,23 @@
},
data() {
return {
editorValue : this.value
isInit: false
};
},
watch: {
value:{
deep: true,
immediate:true,
handler(value) {
this.isInit&&this.editor.setData(value.value)
}
}
},
mounted() {
this.init()
},
beforeDestroy() {
},
computed: {},
watch: {
value:function (value) {
this.editor.setData()
},
},
methods: {
init () {
CKEDITOR.replace('editor', {
......@@ -55,16 +58,13 @@
filebrowserImageUploadUrl: this.uploadUrl,
filebrowserUploadMethod: 'form'
});
this.editor = CKEDITOR.instances.editor;
this.editor.on( 'change', ( evt ) =>{
// getData() returns CKEditor's HTML content.
this.$emit('getValue', evt.editor.getData())
});
this.editor = CKEDITOR.instances.editor;
setTimeout(()=> {
this.isInit = true
}, 1000)
},
},
watch:{
value: function(value) {
this.editor.setData(value)
getValue(){
return this.editor.getData()
}
},
components: {}
......
......@@ -339,7 +339,7 @@
</div>
</div>
<div class="ckeditor">
<ckeditor :value='sad' :uploadUrl='uploadurl' @getValue='getEditorValue' height='300px' width='100%' style="margin-left:3%"></ckeditor>
<ckeditor :value='editorObject' ref='editor' :uploadUrl='uploadurl' height='300px' width='100%' style="margin-left:3%"></ckeditor>
</div>
<div class="uploadEnclosure">
<p style="height:50px;">
......@@ -393,6 +393,7 @@ import ckeditor from '../../components/ckeditor'
}
return {
sad:'',
editorObject: {type: '', value: ''},
ruleInline: {
UpdateOWER: [
{ required: true, message: '邀约人不能为空', trigger: 'blur' }
......@@ -1267,15 +1268,18 @@ import ckeditor from '../../components/ckeditor'
this.emailMassage=false
}}
this.emailCode=value
let parmars={
let params={
resumeId:this.emailId==''?'':this.emailId,
templateCode:this.emailCode
}
getEmailContent(parmars).then(res=>{
getEmailContent(params).then(res=>{
this.emailInline.theme=res.data.body.templateSubject
this.emailInline.receiveEmail=res.data.body.receiveEmail
this.emailInline.templateContent=res.data.body.templateContent
this.sad=this.emailInline.templateContent
this.editorObject = {
type: value,
value: this.emailInline.templateContent || ''
}
if(res.data.body&&res.data.body.resumeInterviewVO){
this.formInline.UpdateOWER=res.data.body.resumeInterviewVO.interviewerName
this.formInline.UpdateVIEW=res.data.body.resumeInterviewVO.inviterName
......@@ -1332,31 +1336,16 @@ import ckeditor from '../../components/ckeditor'
this.uploadFileList=[]
this.SouSuo(this.pageT)
},
// getEditorValue(value){
// this.emailContent=value
// this.sad = value
// // if(this.sad==''){this.$Notice.error({
// // title: '提示',
// // desc: '正文不能为空'
// // });
// // }
// // if(this.emailContent==''){
// // this.isDisable=false
// // }else{
// // this.isDisable=true
// // }
// },
getEditorValue: _debounce((value) => {
this.emailContent=value
this.sad = value
}),
getEditorValue(value){ // 调编辑器组件方法获取数据
return this.$refs.editor.getValue()
},
delateFile(index){
this.fileList.splice(index,1)
this.uploadFileList.splice(index,1)
},
// 确认发送邮件
confireSendEmail(){
this.sad = this.getEditorValue()
if(this.sad==''){
this.$Notice.error({
title: '提示',
......
......@@ -332,7 +332,7 @@
</div>
</div>
<div class="ckeditor">
<ckeditor :value='sad' :uploadUrl='uploadurl' @getValue='getEditorValue' height='300px' width='100%' style="margin-left:3%"></ckeditor>
<ckeditor :value='editorObject' ref='editor' :uploadUrl='uploadurl' height='300px' width='100%' style="margin-left:3%"></ckeditor>
</div>
<div class="uploadEnclosure">
<p style="height:50px;">
......@@ -401,6 +401,7 @@ export default {
UpdateTIME:'',
UpdateVIEW:''
},
editorObject: {type: '', value: ''},
emailInline:{
moo:'',
modalArr:[],
......@@ -1168,7 +1169,10 @@ export default {
this.emailInline.theme=res.data.body.templateSubject
this.emailInline.receiveEmail=res.data.body.receiveEmail
this.emailInline.templateContent=res.data.body.templateContent
this.sad=this.emailInline.templateContent
this.editorObject = {
type: value,
value: this.emailInline.templateContent || ''
}
if(res.data.body&&res.data.body.resumeInterviewVO){
this.formInline.UpdateOWER=res.data.body.resumeInterviewVO.interviewerName
this.formInline.UpdateVIEW=res.data.body.resumeInterviewVO.inviterName
......@@ -1225,10 +1229,9 @@ export default {
this.uploadFileList=[]
this.SouSuo(this.pageT)
},
getEditorValue: _debounce((value) => {
this.emailContent=value
this.sad = value
}),
getEditorValue(){ // 调编辑器组件方法获取数据
return this.$refs.editor.getValue()
},
delateFile(index){
this.fileList.splice(index,1)
this.uploadFileList.splice(index,1)
......@@ -1236,6 +1239,7 @@ export default {
},
// 确认发送邮件
confireSendEmail(){
this.sad=this.getEditorValue()
if(this.sad==''){
this.$Notice.error({
title: '提示',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment