add.vue
3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<template>
<div class="case-ctnr">
<div class="main-wrap">
<div class="global-title">新增案例</div>
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="videoCoverSlot">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.videoCoverArr" @change="changeChannelImg"></glsx-preview>
<div class="text-tip" style="margin: 0;">建议尺寸:272*364</div>
</div>
<div slot="selectBrandSlot">
<el-radio-group v-model="formObj.brandType">
<el-radio :label="1">全部品牌</el-radio>
<el-radio :label="2">部分品牌</el-radio>
</el-radio-group>
<div v-if="formObj.brandType == 2">
<el-button class="el-icon-plus" size="small" @click="openBrandDialog">选择品牌</el-button>
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
<GLDialog title="选择车系"
mode="mid"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<div class="car-container">
</div>
</GLDialog>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'add',
components: {
glsxCombiForm
},
data() {
return {
dialogVisible: false,
formObj:{
brandType: 1,
videoCoverArr: []
},
posterOptions: {
width: '104px',
height: '138px',
key: 'posterImg',
isClose: true
},
myRule:{
title: [{ required: true, message: '请输入案例名称', trigger: 'blur' }],
channelStyle: [{ required: true, message: '请选择频道主题', trigger: 'change' }],
},
formData:[
{
label: '案例名称',
name: 'title',
type: 'input',
isDisabled: false
},
{
label: '选择视频',
name: 'title',
type: 'input',
isDisabled: false
},
{
label: '视频封面图',
name: 'videoCover',
addHtml: 'videoCoverSlot'
},
{
label: '宣传文案',
placeholder: '发现频道视频宣传语',
name: 'title',
maxlength: 100,
type: 'input',
showLimit: true,
inputType: 'textarea',
isDisabled: false
},
{
label: '适用品牌',
name: 'zone',
addHtml: 'selectBrandSlot'
}
],
}
},
methods:{
openBrandDialog(){
this.dialogVisible = !this.dialogVisible
},
changeChannelImg(val){
console.log(val)
}
}
}
</script>
<style scoped lang="scss">
.case-ctnr{
.glsx-combi-form{
padding: 20px;
background-color: #fff;
margin-bottom: 16px;
}
}
</style>