From e8655d951360fcdfbdb2a13387bbf0135f7ec1d9 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Tue, 10 May 2022 14:08:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E9=97=A8=E5=B8=AE=E5=8A=9E=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E6=89=8B=E5=8A=A8=E6=9D=90=E6=96=99=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convenienceofservice-add-or-update.vue | 144 +++++++++--------- .../servevisithelphandle-add-or-update.vue | 14 +- .../custom/servevisithelphandle-look.vue | 12 +- 3 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/views/modules/custom/convenienceofservice-add-or-update.vue b/src/views/modules/custom/convenienceofservice-add-or-update.vue index 9b9ceb4..63d3225 100644 --- a/src/views/modules/custom/convenienceofservice-add-or-update.vue +++ b/src/views/modules/custom/convenienceofservice-add-or-update.vue @@ -9,7 +9,7 @@ - @@ -19,7 +19,7 @@ - @@ -102,24 +102,24 @@ export default { imgUrl: '', serviceName: '' }, - // 富文本 - quillEditor: null, - quillEditorToolbarOptions: [ - ['bold', 'italic', 'underline', 'strike'], - ['image'], - [{ 'header': 1 }, { 'header': 2 }], - [{ 'list': 'ordered' }, { 'list': 'bullet' }], - [{ 'script': 'sub' }, { 'script': 'super' }], - [{ 'indent': '-1' }, { 'indent': '+1' }], - [{ 'size': ['small', false, 'large', 'huge'] }], - [{ 'header': [1, 2, 3, 4, 5, 6, false] }], - [{ 'color': [] }, { 'background': [] }], - [{ 'font': [] }], - [{ 'align': [] }], - ['clean'] - ], - uploadUrl: '', - // 富文本end + // 富文本 + quillEditor: null, + quillEditorToolbarOptions: [ + ['bold', 'italic', 'underline', 'strike'], + ['image'], + [{ 'header': 1 }, { 'header': 2 }], + [{ 'list': 'ordered' }, { 'list': 'bullet' }], + [{ 'script': 'sub' }, { 'script': 'super' }], + [{ 'indent': '-1' }, { 'indent': '+1' }], + [{ 'size': ['small', false, 'large', 'huge'] }], + [{ 'header': [1, 2, 3, 4, 5, 6, false] }], + [{ 'color': [] }, { 'background': [] }], + [{ 'font': [] }], + [{ 'align': [] }], + ['clean'] + ], + uploadUrl: '' + // 富文本end } }, computed: { @@ -174,61 +174,61 @@ export default { } }, methods: { - // 上传图片 - handleAvatarSuccess (res, file) { - this.loading = false - this.dataForm.imgUrl = res.data.url - }, - beforeAvatarUpload (file) { - this.loading = true - }, - // 上传图片之前 (富文本) - uploadBeforeUploadHandle (file) { - if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { - this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' })) - return false - } - }, - // 上传图片成功 (富文本) - uploadSuccessHandle (res, file, fileList) { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url) - }, - // 富文本编辑器 - quillEditorHandle () { - this.quillEditor = new Quill('#J_quillEditor', { - modules: { - toolbar: this.quillEditorToolbarOptions - }, - theme: 'snow' - }) - // // 自定义上传图片功能 (使用element upload组件) - this.quillEditor.getModule('toolbar').addHandler('image', () => { - this.$refs.uploadBtn.$el.click() - }) - // 监听内容变化,动态赋值 - this.quillEditor.on('text-change', () => { - this.dataForm.material = this.quillEditor.root.innerHTML - if ((this.dataForm.material).length > 10000) { - return this.$message.error('您输入的的内容已超过字数不能提交') - } - }) - }, + // 上传图片 + handleAvatarSuccess (res, file) { + this.loading = false + this.dataForm.imgUrl = res.data.url + }, + beforeAvatarUpload (file) { + this.loading = true + }, + // 上传图片之前 (富文本) + uploadBeforeUploadHandle (file) { + if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { + this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' })) + return false + } + }, + // 上传图片成功 (富文本) + uploadSuccessHandle (res, file, fileList) { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url) + }, + // 富文本编辑器 + quillEditorHandle () { + this.quillEditor = new Quill('#J_quillEditor', { + modules: { + toolbar: this.quillEditorToolbarOptions + }, + theme: 'snow' + }) + // // 自定义上传图片功能 (使用element upload组件) + this.quillEditor.getModule('toolbar').addHandler('image', () => { + this.$refs.uploadBtn.$el.click() + }) + // 监听内容变化,动态赋值 + this.quillEditor.on('text-change', () => { + this.dataForm.material = this.quillEditor.root.innerHTML + if ((this.dataForm.material).length > 10000) { + return this.$message.error('您输入的的内容已超过字数不能提交') + } + }) + }, init () { this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() - // 富文本 - 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() - } - // 富文本end + // 富文本 + 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() + } + // 富文本end if (this.dataForm.id) { this.getInfo() } @@ -244,7 +244,7 @@ export default { ...this.dataForm, ...res.data } - this.quillEditor.root.innerHTML = res.data.material + this.quillEditor.root.innerHTML = res.data.material }).catch(() => {}) }, // 表单提交 diff --git a/src/views/modules/custom/servevisithelphandle-add-or-update.vue b/src/views/modules/custom/servevisithelphandle-add-or-update.vue index 021e128..84c77c5 100644 --- a/src/views/modules/custom/servevisithelphandle-add-or-update.vue +++ b/src/views/modules/custom/servevisithelphandle-add-or-update.vue @@ -7,12 +7,12 @@ - - - 手动录入 - 便民服务 - - + + + + + + @@ -41,7 +41,7 @@ export default { visible: false, dataForm: { id: '', - materialChooseMode: 1, + materialChooseMode: 2, helpHandleItem: '', handlerMobile: '', material: '', diff --git a/src/views/modules/custom/servevisithelphandle-look.vue b/src/views/modules/custom/servevisithelphandle-look.vue index 5dd855d..2f8759e 100644 --- a/src/views/modules/custom/servevisithelphandle-look.vue +++ b/src/views/modules/custom/servevisithelphandle-look.vue @@ -7,12 +7,12 @@ - - - 手动录入 - 便民服务 - - + + + + + +