|
|
@@ -11,7 +11,7 @@ |
|
|
|
<el-dialog v-if="uploadDiolagVisible" :visible.sync="uploadDiolagVisible" append-to-body title="图片上传">
|
|
|
|
<el-form>
|
|
|
|
<el-form-item label="上传图片">
|
|
|
|
<uploadFile :url.sync="imgUrl" type="image" width="auto" height="auto"/>
|
|
|
|
<uploadFile :url.sync="imgUrl" :imgWidth.sync="imgWidth" type="image" width="auto" height="auto" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="saveImg()">保存</el-button>
|
|
|
@@ -137,7 +137,8 @@ export default { |
|
|
|
UEDITOR_HOME_URL: 'https://admin.meta-autotv.com/ueditor/' // UEditor资源文件的存放路径
|
|
|
|
},
|
|
|
|
imgUrl: '',
|
|
|
|
uploadDiolagVisible: false
|
|
|
|
uploadDiolagVisible: false,
|
|
|
|
imgWidth: 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
@@ -162,7 +163,10 @@ export default { |
|
|
|
if (this.isDisabled) this.editor.options.readonly = true
|
|
|
|
},
|
|
|
|
saveImg() {
|
|
|
|
let imageHtml = '<p><img width="100%" src=\"' + this.imgUrl + '\"/></p>'
|
|
|
|
let imageHtml = '<p><img src=\"' + this.imgUrl + '\"/></p>'
|
|
|
|
if (this.imgWidth > 800) {
|
|
|
|
imageHtml = '<p><img width="100%" src=\"' + this.imgUrl + '\"/></p>'
|
|
|
|
}
|
|
|
|
this.editor.execCommand('inserthtml', imageHtml)
|
|
|
|
this.uploadDiolagVisible = false
|
|
|
|
},
|
|
|
|