From 21a8cfa2e6464dbd877edbdf8e1368cdaade8248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E9=A3=9E?= Date: Mon, 2 Mar 2020 19:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BE=8B=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../case/typicalcase-add-or-update.vue | 60 ++++++++++++++----- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/views/modules/case/typicalcase-add-or-update.vue b/src/views/modules/case/typicalcase-add-or-update.vue index 63b301f1..c7ccc5a2 100644 --- a/src/views/modules/case/typicalcase-add-or-update.vue +++ b/src/views/modules/case/typicalcase-add-or-update.vue @@ -49,7 +49,7 @@ @@ -60,7 +60,7 @@ - + @@ -69,7 +69,18 @@ - + + {{ $t('upload.button') }} + + @@ -112,11 +123,11 @@ export default { // 富文本 this.hideUpload = false this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` - if (this.quillEditor) { - this.quillEditor.deleteText(0, this.quillEditor.getLength()) - } else { - this.quillEditorHandle() - } + // if (this.quillEditor) { + // this.quillEditor.deleteText(0, this.quillEditor.getLength()) + // } else { + // this.quillEditorHandle() + // } // 富文本end }) }, @@ -131,7 +142,28 @@ export default { connectListVisible: false, content: '', loading: false, - editorOption: {}, + editorOption: { + placeholder: 'Please enter it here...', + modules:{ + toolbar:{ + container: [ + ['bold', 'italic', 'underline', 'strike'],// 加粗,斜体,下划线,删除线 + ['blockquote'],// 引用 + [{ 'header': 1 }, { 'header': 2 }],// 标题,键值对的形式;1、2表示字体大小 + [{ 'list': 'ordered'}, { 'list': 'bullet' }],//列表 + [{ 'indent': '-1'}, { 'indent': '+1' }],// 缩进 + [{ 'direction': 'rtl' }],// 文本方向 + [{ 'size': ['small', false, 'large', 'huge'] }],// 字体大小 + [{ 'header': [1, 2, 3, 4, 5, 6, false] }],//几级标题 + [{ 'color': [] }, { 'background': [] }],// 字体颜色,字体背景颜色 + [{ 'font': [] }],//字体 + [{ 'align': [] }],//对齐方式 + ['clean'],//清除字体样式 + ['image']//上传图片、上传视频 + ] + } + } + }, // 富文本 quillEditor: null, quillEditorToolbarOptions: [ @@ -286,16 +318,14 @@ export default { return false } }, + // 上传图片成功 (富文本) - uploadSuccessHandle (res, file, fileList) { + uploadSuccessHandle (res) { + let quill = this.$refs.myQuillEditor[0].quill; if (res.code !== 0) { return this.$message.error(res.msg) } - this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url) - }, - setRegistTime () { - this.dataForm.newsReleaseStartTime = this.time[0] - this.dataForm.newsReleaseEndTime = this.time[1] + this.quill.insertEmbed(this.quill.getSelection().index, 'image', res.data.url) }, // 上传图片ends init () {