|
@@ -110,11 +110,12 @@
|
|
|
showType="radio"
|
|
|
:notIn="notShowSel"
|
|
|
:disabled="isDisabled"
|
|
|
+ @change="changeContentType"
|
|
|
allowClear></v-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="内容" prop="content" v-show="form.contentType =='IMAGE_CONTENT'">
|
|
|
+ <a-form-model-item label="内容" prop="contentEditor" v-show="form.contentType =='IMAGE_CONTENT'">
|
|
|
<editor
|
|
|
v-show="!isDisabled"
|
|
|
id="carouselImageEdit-editor"
|
|
@@ -207,7 +208,8 @@ export default {
|
|
|
contentType: 'LINK', // 内容类型
|
|
|
content: '', // 内容
|
|
|
contentLink: '', // 内容链接
|
|
|
- state: 'UNPUBLISH'// 发布状态
|
|
|
+ state: 'UNPUBLISH', // 发布状态
|
|
|
+ contentEditor: ''
|
|
|
},
|
|
|
chooseSnList: [],
|
|
|
dateFormat: 'YYYY-MM-DD', // 有效期时间格式
|
|
@@ -220,8 +222,9 @@ export default {
|
|
|
allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
|
|
|
imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
|
|
|
contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
|
|
|
- content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
|
|
|
- contentLink: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }]
|
|
|
+ content: [{ required: true, message: '请选择视频展示', trigger: ['blur', 'change'] }],
|
|
|
+ contentLink: [{ required: true, message: '请输入跳转链接', trigger: ['blur', 'change'] }],
|
|
|
+ contentEditor: [{ required: true, message: '请输入图文内容', trigger: ['blur', 'change'] }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -253,6 +256,11 @@ export default {
|
|
|
this.chooseSnList = []
|
|
|
this.openDealerModal = false
|
|
|
},
|
|
|
+ // 切换类型 清空内容显示
|
|
|
+ changeContentType (val) {
|
|
|
+ this.form.content = ''
|
|
|
+ this.form.contentLink = ''
|
|
|
+ },
|
|
|
// 部分经销商 删除
|
|
|
delBuyerName (row) {
|
|
|
const pos = this.chooseDealerList.findIndex(item => item.dealerSn == row.dealerSn)
|
|
@@ -279,6 +287,7 @@ export default {
|
|
|
if (res.data.bizType && res.data.bizType === 'SHOP_PROMO') {
|
|
|
_this.isDisabled = true
|
|
|
}
|
|
|
+
|
|
|
if (res.data.contentType == 'IMAGE_CONTENT') {
|
|
|
_this.$refs.editor.setHtml(res.data.content)
|
|
|
} else if (res.data.contentType == 'VIDEO') {
|
|
@@ -291,9 +300,11 @@ export default {
|
|
|
}
|
|
|
_this.$refs.imageSet.setFileList(res.data.imageUrl)
|
|
|
_this.form = { ..._this.form, ...res.data }
|
|
|
+ _this.form.contentEditor = res.data.content
|
|
|
_this.$nextTick(() => {
|
|
|
_this.form.time = [res.data.bannerStartDate, res.data.bannerEndDate]
|
|
|
})
|
|
|
+ console.log('22222222222222:', _this.form)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -303,6 +314,10 @@ export default {
|
|
|
if (_this.form.contentType === 'LINK') {
|
|
|
_this.form.content = _this.form.contentLink
|
|
|
}
|
|
|
+ if (_this.form.contentType === 'IMAGE_CONTENT') {
|
|
|
+ _this.form.content = _this.form.contentEditor
|
|
|
+ }
|
|
|
+ console.log('11111111111:', _this.form)
|
|
|
// 验证组件必填项
|
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
@@ -324,6 +339,7 @@ export default {
|
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
|
delete formData.time
|
|
|
delete formData.contentLink
|
|
|
+ delete formData.contentEditor
|
|
|
_this.spinning = true
|
|
|
saveShopBanner(formData).then(res => {
|
|
|
if (res.status == 200) {
|
|
@@ -348,9 +364,9 @@ export default {
|
|
|
},
|
|
|
// 文本编辑器
|
|
|
editorChange (html, text) {
|
|
|
- this.form.content = html
|
|
|
+ this.form.contentEditor = html
|
|
|
if (html) {
|
|
|
- this.$refs.ruleForm.clearValidate('content')
|
|
|
+ this.$refs.ruleForm.clearValidate('contentEditor')
|
|
|
}
|
|
|
},
|
|
|
// 重置
|
|
@@ -368,7 +384,8 @@ export default {
|
|
|
contentType: 'LINK', // 内容类型
|
|
|
content: '', // 内容
|
|
|
contentLink: '',
|
|
|
- state: 'UNPUBLISH'
|
|
|
+ state: 'UNPUBLISH',
|
|
|
+ contentEditor: ''
|
|
|
}
|
|
|
if (this.$refs.imageSet) {
|
|
|
this.$refs.imageSet.setFileList('')
|