Commit 738b1c9c by zhangquan

bug修复

1 parent b8ef2ee4
......@@ -32,7 +32,10 @@
</div>
<div slot="coverDetailSlot" class="cover-Slot">
<Upload v-if="!formObj.prodImg" :empty="true" @clickEvent="openCoverDialog" :default-style="{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="coverDetail"></Upload>
<Upload v-else :default-style="{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="prodImg"></Upload>
<div v-else class="cover-wrap">
<div class="title">{{formObj.proName}}</div>
<Upload @delImage="delCoverDetail" @editImage="editCoverDetail" :default-style="{width: '88px', height: '60px'}" :isEdit="true" :formObj="formObj" btnName="创建封面" attr="prodImg"></Upload>
</div>
</div>
<div slot="mainImageSlot" class="main-image-Slot">
<Upload placement="right" tip="图片&视频只能上传一个" fileType="all" :formObj="formObj" attr="imageUrl"></Upload>
......@@ -93,7 +96,7 @@
</div>
</div>
</glsx-combi-form>
<ProdCoverDialog @closeDialog="closeDialog" @confirmDialog="confirmDialog" v-if="coverVisible" :visible="coverVisible"></ProdCoverDialog>
<ProdCoverDialog @closeDialog="closeDialog" @confirmDialog="confirmDialog" :formObj="coverDeatilFormObj" v-if="coverVisible" :visible="coverVisible"></ProdCoverDialog>
</div>
<GLFooter class="gl-footer">
<el-button class="btn-cancle" @click="goListPage">取消</el-button>
......@@ -128,6 +131,7 @@ export default {
isEditType: false,
coverVisible: false,
routeInfo: {},
coverDeatilFormObj: {},
contentType: {
1: '特色产品',
2: '案例视频',
......@@ -166,10 +170,12 @@ export default {
{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.proName || !this.formObj.prodImg) {
callback(new Error('封面详情不能为空'))
if(!this.formObj.prodImg){
callback(new Error('产品封面不能为空'))
}else if (!this.formObj.proName) {
callback(new Error('产品名称不能为空'))
} else{
callback()
callback()
}
},
trigger: 'change'
......@@ -402,6 +408,18 @@ export default {
showBox(e, key){
if(e){ this[key] = true }
},
editCoverDetail(){
this.coverDeatilFormObj = {
title: this.formObj.proName,
url: this.formObj.prodImg
}
this.coverVisible = true
},
delCoverDetail(){
this.formObj.proName = ''
this.formObj.prodImg = ''
this.coverDeatilFormObj = {}
},
confirmDialog(e){
const { title, url } = e
this.formObj.proName = title
......@@ -577,6 +595,34 @@ export default {
width: 136px;
}
}
.cover-wrap{
box-shadow: 0 6px 20px 0 #7a7a7a33;
position: relative;
width: 88px;
height: 86px;
border-radius: 0 0 4px 4px;
/deep/ .img-item, /deep/ .operate{
border-radius: 4px 4px 0 0;
}
.title{
padding: 0 8px;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 12px;
color: #323436;
position: absolute;
z-index: 5;
width: 100%;
text-align: center;
height: 26px;
background-color: #fff;
bottom: 0;
line-height: 26px;
border-radius: 0 0 4px 4px;
}
}
.expansion-detail-slot{
.tab-item {
display: inline-block;
......
......@@ -20,6 +20,15 @@ export default {
visible: {
type: Boolean,
default: false
},
formObj: {
type: Object,
default: ()=>{
return {
title: '',
url: ''
}
}
}
},
data(){
......@@ -30,24 +39,28 @@ export default {
},
detailFormData: [
{
label: '封面标题',
label: '产品名称',
name: 'title',
type: 'input',
maxlength: 12,
showLimit: true
},
{
label: '内容标题',
label: '产品封面',
name: 'url',
addHtml: 'coverSlot'
}
],
detailRules: {
title: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
url: [{ required: true, message: '请上传封面', trigger: 'change' }]
url: [{ required: true, message: '请上传产品封面', trigger: 'change' }]
},
}
},
created(){
const {title, url } = this.formObj
this.detailFormObj = { title, url }
},
methods: {
onCancel(){
this.$emit('closeDialog')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!