|
@@ -115,7 +115,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="内容" prop="contentEditor" v-show="form.contentType =='IMAGE_CONTENT'">
|
|
|
+ <a-form-model-item label="内容" class="contentBox" v-show="form.contentType =='IMAGE_CONTENT'">
|
|
|
<editor
|
|
|
v-show="!isDisabled"
|
|
|
id="carouselImageEdit-editor"
|
|
@@ -125,7 +125,7 @@
|
|
|
:cache="false"></editor>
|
|
|
<div style="border:1px solid #efefef;border-radius:8px;padding:10px 20px;" v-if="isDisabled" v-html="form.content"></div>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
|
|
|
+ <a-form-model-item label="上传视频" prop="content" v-if="form.contentType =='VIDEO'">
|
|
|
<Upload
|
|
|
class="upload"
|
|
|
id="carouselImageEdit-videoSet"
|
|
@@ -223,8 +223,7 @@ export default {
|
|
|
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'] }],
|
|
|
- contentEditor: [{ required: true, message: '请输入图文内容', trigger: ['blur', 'change'] }]
|
|
|
+ contentLink: [{ required: true, message: '请输入跳转链接', trigger: ['blur', 'change'] }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -303,7 +302,6 @@ export default {
|
|
|
_this.form.contentEditor = res.data.content
|
|
|
_this.form.time = [res.data.bannerStartDate, res.data.bannerEndDate]
|
|
|
})
|
|
|
- console.log('22222222222222:', _this.form)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -314,9 +312,8 @@ export default {
|
|
|
_this.form.content = _this.form.contentLink
|
|
|
}
|
|
|
if (_this.form.contentType === 'IMAGE_CONTENT') {
|
|
|
- _this.form.content = _this.form.contentEditor
|
|
|
+ _this.form.content = _this.form.contentEditor ? _this.form.contentEditor : _this.form.content
|
|
|
}
|
|
|
- console.log('11111111111:', _this.form)
|
|
|
// 验证组件必填项
|
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
@@ -334,6 +331,10 @@ export default {
|
|
|
}
|
|
|
_this.form.dealerSnList = _this.chooseDealerList.map(con => con.dealerSn)
|
|
|
}
|
|
|
+ if (_this.form.contentType === 'IMAGE_CONTENT' && !_this.form.contentEditor) {
|
|
|
+ _this.$message.warning('请输入图文内容!')
|
|
|
+ return
|
|
|
+ }
|
|
|
_this.form.bannerSn = _this.$route.params.sn || undefined
|
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
|
delete formData.time
|
|
@@ -364,9 +365,6 @@ export default {
|
|
|
// 文本编辑器
|
|
|
editorChange (html, text) {
|
|
|
this.form.contentEditor = html
|
|
|
- if (html) {
|
|
|
- this.$refs.ruleForm.clearValidate('contentEditor')
|
|
|
- }
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
@@ -457,6 +455,18 @@ export default {
|
|
|
z-index: 0;
|
|
|
}
|
|
|
}
|
|
|
+ //图文必填标志显示
|
|
|
+ .contentBox {
|
|
|
+ /deep/.ant-form-item-label label::before{
|
|
|
+ display:inline-block;
|
|
|
+ margin-right: 4px;
|
|
|
+ color: #f5222d !important;
|
|
|
+ font-size: 12px;
|
|
|
+ font-family: SimSun, sans-serif;
|
|
|
+ line-height: 1;
|
|
|
+ content: '*';
|
|
|
+ }
|
|
|
+ }
|
|
|
.buyerBox{
|
|
|
border:1px solid #d9d9d9;
|
|
|
margin-top:10px;
|