|
|
@ -9,7 +9,7 @@ |
|
|
|
<el-input v-model="dataForm.matter" placeholder="事项" style="width: 300px" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="办理时限" prop="timeLimit"> |
|
|
|
<el-input v-model="dataForm.timeLimit" placeholder="办理时限"maxlength="100" |
|
|
|
<el-input v-model="dataForm.timeLimit" placeholder="办理时限" maxlength="100" |
|
|
|
show-word-limit></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="收费标准" prop="chargeStandard"> |
|
|
@ -19,7 +19,7 @@ |
|
|
|
<el-input v-model="dataForm.site" placeholder="办理地点"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="办理时间" prop="dealTime"> |
|
|
|
<el-input v-model="dataForm.dealTime" placeholder="办理时间"maxlength="100" |
|
|
|
<el-input v-model="dataForm.dealTime" placeholder="办理时间" maxlength="100" |
|
|
|
show-word-limit></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="咨询电话" prop="hotline"> |
|
|
@ -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(() => {}) |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|