index.vue
3.25 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
:show-close="isShowCloseBtn"
class="app-dialog"
>
<!-- :modal-append-to-body="false"
:append-to-body="true"-->
<div class="container">
<slot></slot>
</div>
<div slot="footer">
<slot name="btn-front"></slot>
<el-button size="small" @click="handleClose">取消</el-button>
<el-button
type="primary"
size="small"
@click="handleConfirm"
:loading="btnLoading"
>{{ btnOkLabel }}</el-button>
<!-- isShowThirdBtn 产品说暂时不要这个按钮-->
<!-- <el-button v-if="false" @click="btnClick">创建标签</el-button> -->
<slot name="btn-behind"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'basic-dialog',
props: {
title: {
type: String,
default: ''
},
isShowCloseBtn: {
type: Boolean,
default: false
},
isShowThirdBtn: {
type: Boolean,
default: false
},
isVisible: {
type: Boolean,
default: false
},
btnOkLabel: {
type: String,
default: '确定'
},
width: {
type: String,
default: '580px'
},
btnLoading: {
type: Boolean,
default: false
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
},
btnClick() {
this.$emit('btnEvent')
}
}
}
</script>
<style lang="scss">
.app-dialog {
.el-dialog__header {
padding: 20px 20px 10px;
}
.el-dialog__footer {
padding-top:16px ;
padding-bottom: 16px;
background: #fff;
}
.el-dialog__body {
padding: 0;
border-top: 1px solid #E6E6E6;
border-bottom: 1px solid #E6E6E6;
min-height: 250px;
// max-height: 636px;
overflow-y: auto;
max-height: 450px;
.container {
> span {
display: block;
}
overflow-y: auto;
padding: 20px 20px;
}
&::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/*正常情况下滑块的样式*/
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
&::-webkit-scrollbar-thumb {
// background-color: rgba(0, 0, 0, 0.2);
background: #e9e8ff;
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
// &::-webkit-scrollbar-thumb:hover {
// background-color: rgba(0, 0, 0, 0.4);
// box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
// }
/*正常时候的主干部分*/
&::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
/*鼠标悬浮在滚动条上的主干部分*/
&::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01);
}
}
}
</style>