style.vue
2.8 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
116
117
118
119
120
121
122
123
124
<template>
<div>
<el-button @click="openDialog" class="bi-photo_btn">
<img
src="http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/delete.svg"
alt=""
/>
选择样式
</el-button>
<el-dialog
title="选择样式"
:visible.sync="selectStyleShow"
width="400px"
center
:before-close="handleClose"
>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="布局样式:">
<el-radio-group v-model="form.imageStyle">
<el-radio :label="1">流式布局</el-radio>
<el-radio :label="2">平铺布局</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="图片大小:">
<el-radio-group v-model="form.imageSize">
<el-radio :label="1">大图</el-radio>
<el-radio :label="2">中图</el-radio>
<el-radio :label="3">小图</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleSave">保 存</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { Dialog, Button, Radio, RadioGroup, Form, FormItem } from 'element-ui';
export default {
name: 'select-style',
props: {
layout: {
type: Object,
default() {
return {
imageStyle: 2,
imageSize: 2
};
}
}
},
components: {
[Form.name]: Form,
[FormItem.name]: FormItem,
[Dialog.name]: Dialog,
[Button.name]: Button,
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio
},
data() {
return {
selectStyleShow: false,
form: {
imageStyle: 2,
imageSize: 2
}
};
},
methods: {
openDialog() {
this.selectStyleShow = true;
Object.assign(this.form, this.layout);
},
handleClose() {
this.selectStyleShow = false;
},
handleSave() {
this.$emit('handleSave', this.form);
this.selectStyleShow = false;
}
}
};
</script>
<style scoped lang="scss">
.bi-photo {
// page-break-before: always;
// page-break-after: always;
padding-bottom: 50px;
&_btn {
display: inline-block;
min-width: 42px;
height: 42px;
border: 1px solid #bac1ce;
border-radius: 4px;
vertical-align: top;
text-align: center;
line-height: 42px;
padding: 0 15px;
font-size: 16px;
font-weight: 500;
color: #6f7a91;
cursor: pointer;
position: relative;
&_group {
position: absolute;
right: 16px;
top: 50%;
margin-top: -21px;
z-index: 3;
&_item {
& + .bi-chart-title_btn_group_item {
margin-left: 8px;
}
}
}
}
}
</style>