@burh/nuxt-core 1.0.72 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="card card--store mb-4" :class="isSelected && 'selected'" tabindex="0" @click="$emit('card-selected')">
|
|
3
|
+
<div class="card-header bg-transparent text-center card-header--store">
|
|
4
|
+
<h3 class="text-header display-3">{{ name }}</h3>
|
|
5
|
+
<h3 class="display-3">{{ price | convertToReal }}</h3>
|
|
6
|
+
|
|
7
|
+
<div class="d-block d-sm-none text-center">
|
|
8
|
+
<collapse :animation-duration="200">
|
|
9
|
+
<collapse-item class="card--shadowless" name="1">
|
|
10
|
+
<button slot="title" class="btn btn-link" @click="$emit('card-benefits')">Beneficios</button>
|
|
11
|
+
<div>
|
|
12
|
+
<ul class="list-unstyled">
|
|
13
|
+
<li v-for="(item, index) in features" :key="index">
|
|
14
|
+
<div class="d-flex align-items-center">
|
|
15
|
+
<span>
|
|
16
|
+
<i class="fas fa-check"></i>
|
|
17
|
+
</span>
|
|
18
|
+
<div class="ml-4 small text-left">
|
|
19
|
+
<span> {{ item }} </span>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
</collapse-item>
|
|
26
|
+
</collapse>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="card-body p-4 px-lg-4 d-none d-md-block">
|
|
32
|
+
<div>
|
|
33
|
+
<h6 class="card-text text-sm pl-mini">{{ description }}</h6>
|
|
34
|
+
<div class="h6 font-weight-bold text-sm pl-mini">{{ subtitle }}</div>
|
|
35
|
+
<div class="pl-mini">
|
|
36
|
+
<ul class="list-unstyled">
|
|
37
|
+
<li v-for="(item, index) in features" :key="index">
|
|
38
|
+
<div class="d-flex align-items-center">
|
|
39
|
+
<span>
|
|
40
|
+
<i class="fas fa-check"></i>
|
|
41
|
+
</span>
|
|
42
|
+
<div class="ml-4 small">
|
|
43
|
+
<span> {{ item }} </span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</li>
|
|
47
|
+
</ul>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
<script>
|
|
54
|
+
import Collapse from '@burh/nuxt-core/components/argon-core/Collapse/Collapse.vue';
|
|
55
|
+
import CollapseItem from '@burh/nuxt-core/components/argon-core/Collapse/CollapseItem.vue';
|
|
56
|
+
export default {
|
|
57
|
+
name: 'product-card',
|
|
58
|
+
components: {
|
|
59
|
+
Collapse,
|
|
60
|
+
CollapseItem
|
|
61
|
+
},
|
|
62
|
+
props:{
|
|
63
|
+
isSelected: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
name: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'Premium'
|
|
70
|
+
},
|
|
71
|
+
price: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: 397
|
|
74
|
+
},
|
|
75
|
+
description: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'Recursos inteligentes para não perder mais tempo no processo seletivo'
|
|
78
|
+
},
|
|
79
|
+
subtitle: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: 'Tudo no gratuito e mais:'
|
|
82
|
+
},
|
|
83
|
+
features: {
|
|
84
|
+
type: Array,
|
|
85
|
+
default:()=>{
|
|
86
|
+
return [ { id: 1, name:'Vagas Confidenciais' }, { id: 2, name:'Vagas Urgentes' }, { id: 3, name:'Filtros Avançados' }, { id: 4, name:'Processos Customizados' }, { id: 5, name:'Anotações nas vagas e nos candidatos' }];
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
filters: {
|
|
91
|
+
convertToReal(value) {
|
|
92
|
+
return 'R$ ' + value.toFixed(2).replace('.', ',');
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
data(){
|
|
96
|
+
return{
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
</script>
|
|
101
|
+
<style lang="scss">
|
|
102
|
+
@import "@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss";
|
|
103
|
+
.pl-mini{
|
|
104
|
+
padding-left: 0.8rem;
|
|
105
|
+
}
|
|
106
|
+
.card--shadowless{
|
|
107
|
+
box-shadow: none !important;
|
|
108
|
+
margin-bottom: 0px !important;
|
|
109
|
+
|
|
110
|
+
.card-header {
|
|
111
|
+
padding: 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.card--store {
|
|
116
|
+
min-height: 100%;
|
|
117
|
+
|
|
118
|
+
.current-flag {
|
|
119
|
+
color: $color-light--darken
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:hover {
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
background-color: $color-mono-dark-10;
|
|
125
|
+
border-style: solid !important;
|
|
126
|
+
border-width: 2px !important;
|
|
127
|
+
border-color: $color-mono-dark-10 !important;
|
|
128
|
+
|
|
129
|
+
.card-header {
|
|
130
|
+
border-bottom-color: $color-mono-dark-10;
|
|
131
|
+
}
|
|
132
|
+
.card--shadowless {
|
|
133
|
+
background-color: $color-mono-dark-10;
|
|
134
|
+
|
|
135
|
+
.card-header {
|
|
136
|
+
background-color: $color-mono-dark-10;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.fa-check::before {
|
|
141
|
+
color: $color-primary
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&.selected {
|
|
146
|
+
outline: none;
|
|
147
|
+
background-color: $white;
|
|
148
|
+
border-style: solid !important;
|
|
149
|
+
border-width: 2px !important;
|
|
150
|
+
border-color: $color-primary !important;
|
|
151
|
+
|
|
152
|
+
.card-header {
|
|
153
|
+
border-bottom-color: $color-primary;
|
|
154
|
+
}
|
|
155
|
+
.card--shadowless {
|
|
156
|
+
background-color: $white;
|
|
157
|
+
|
|
158
|
+
.card-header {
|
|
159
|
+
background-color: $white;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.fa-check::before {
|
|
164
|
+
color: $color-primary;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.card-header--store {
|
|
169
|
+
border: 0;
|
|
170
|
+
@media screen and (min-width: 576px) {
|
|
171
|
+
border: 0;
|
|
172
|
+
&::after {
|
|
173
|
+
content: '';
|
|
174
|
+
width: 85%;
|
|
175
|
+
height: 1px;
|
|
176
|
+
background-color: $color-light;
|
|
177
|
+
position: absolute;
|
|
178
|
+
transform: translatex(-50%);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -1,295 +1,351 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<modal
|
|
3
|
+
:show.sync="openModal"
|
|
4
|
+
modalContentClasses="container-fluid"
|
|
5
|
+
headerClasses="row px-4 pt-5"
|
|
6
|
+
bodyClasses="row px-4"
|
|
7
|
+
v-on:close="$emit('close-modal')"
|
|
8
|
+
size="lg"
|
|
9
|
+
class="modal"
|
|
10
|
+
>
|
|
11
|
+
<template slot="header">
|
|
12
|
+
<div class="pl-3">
|
|
13
|
+
<h2 class="display-4">{{ title }}</h2>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
<validation-observer ref="appConfigModal" tag="div">
|
|
18
|
+
<validation-provider
|
|
19
|
+
tag="div"
|
|
20
|
+
class="col-12"
|
|
21
|
+
:vid="`name`"
|
|
22
|
+
name="name"
|
|
23
|
+
rules="required"
|
|
24
|
+
v-slot="{ errors }"
|
|
25
|
+
>
|
|
26
|
+
<base-input
|
|
27
|
+
:label="name"
|
|
28
|
+
:placeholder="inputPlaceholders.firstInput"
|
|
29
|
+
required
|
|
30
|
+
v-model="configInfo.title"
|
|
31
|
+
:error="errors[0]"
|
|
32
|
+
:valid="errors.length ? true : false"
|
|
33
|
+
>
|
|
34
|
+
</base-input>
|
|
35
|
+
</validation-provider>
|
|
20
36
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
<div class="col-12 mb-4">
|
|
38
|
+
<label for="description" class="form-control-label">{{
|
|
39
|
+
textAreaTitle
|
|
40
|
+
}}</label>
|
|
41
|
+
<textarea
|
|
42
|
+
id="description"
|
|
43
|
+
class="form-control"
|
|
44
|
+
:placeholder="inputPlaceholders.secondInput"
|
|
45
|
+
v-model="configInfo.textarea"
|
|
46
|
+
></textarea>
|
|
47
|
+
</div>
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
<div
|
|
50
|
+
class="col-12 mb-4 d-flex flex-column"
|
|
51
|
+
v-if="!isCourse && categories && categories.length"
|
|
52
|
+
>
|
|
53
|
+
<label for="category" class="form-control-label"
|
|
54
|
+
>Categoria</label
|
|
55
|
+
>
|
|
56
|
+
<el-select
|
|
57
|
+
filterable
|
|
58
|
+
class="select-danger"
|
|
59
|
+
id="category"
|
|
60
|
+
:disabled="testId != null ? true : false"
|
|
61
|
+
:empty="'Nenhuma categoria foi encontrada'"
|
|
62
|
+
v-model="configInfo.category"
|
|
63
|
+
:placeholder="''"
|
|
64
|
+
>
|
|
65
|
+
<el-option
|
|
66
|
+
v-for="(category, index) in categories"
|
|
67
|
+
:key="category.id"
|
|
68
|
+
:label="category.name"
|
|
69
|
+
:value="category.id"
|
|
70
|
+
:selected="index == 0 && configInfo.category == null"
|
|
71
|
+
>
|
|
72
|
+
</el-option>
|
|
73
|
+
</el-select>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="col-12 mb-4" v-if="isCourse">
|
|
77
|
+
<base-input
|
|
78
|
+
v-mask="['##:##:##']"
|
|
79
|
+
:label="'Carga horária'"
|
|
80
|
+
:placeholder="inputPlaceholders.thirdInput"
|
|
81
|
+
v-model="configInfo.workload"
|
|
82
|
+
></base-input>
|
|
83
|
+
</div>
|
|
52
84
|
|
|
53
|
-
<div class="col-12 mb-4" v-if="isCourse">
|
|
54
|
-
<base-input
|
|
55
|
-
v-mask="['##:##:##']"
|
|
56
|
-
:label="'Carga horária'"
|
|
57
|
-
:placeholder="inputPlaceholders.thirdInput"
|
|
58
|
-
v-model="configInfo.workload"
|
|
59
|
-
></base-input>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
85
|
<slot name="testes"></slot>
|
|
63
86
|
|
|
64
|
-
|
|
87
|
+
<slot name="nota"></slot>
|
|
65
88
|
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
<div class="col-12 mb-4">
|
|
90
|
+
<label class="mb-0 form-control-label mb-3">{{
|
|
91
|
+
buttonAreaTitle
|
|
92
|
+
}}</label>
|
|
68
93
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
<div class="row">
|
|
95
|
+
<div
|
|
96
|
+
class="col-6 col-lg-3"
|
|
97
|
+
v-for="(buttons, index) in buttons"
|
|
98
|
+
:key="index"
|
|
99
|
+
>
|
|
100
|
+
<button
|
|
101
|
+
role="button"
|
|
102
|
+
class="tag tag-outline-primary d-block w-100"
|
|
103
|
+
:id="'button-' + buttons.id"
|
|
104
|
+
:value="buttons.value"
|
|
105
|
+
:class="
|
|
106
|
+
buttons.id == currentSelectedButton
|
|
107
|
+
? 'active'
|
|
108
|
+
: ''
|
|
109
|
+
"
|
|
110
|
+
@click="timeSelection(buttons.id)"
|
|
111
|
+
>
|
|
112
|
+
<i
|
|
113
|
+
v-if="buttons.id == currentSelectedButton"
|
|
114
|
+
class="fas fa-check mr-1"
|
|
115
|
+
></i>
|
|
116
|
+
<small>{{ buttons.time }}</small>
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="col-12 d-flex pb-4">
|
|
122
|
+
<base-button
|
|
123
|
+
size="md"
|
|
124
|
+
type="primary"
|
|
125
|
+
role="button"
|
|
126
|
+
@click="sendConfig()"
|
|
127
|
+
class="ml-auto"
|
|
128
|
+
>{{ configAppButton }}
|
|
129
|
+
</base-button>
|
|
130
|
+
</div>
|
|
131
|
+
</validation-observer>
|
|
132
|
+
</modal>
|
|
90
133
|
</template>
|
|
91
134
|
<script>
|
|
92
|
-
import { mask } from
|
|
135
|
+
import { mask } from "vue-the-mask";
|
|
93
136
|
import { Select, Option } from "element-ui";
|
|
94
137
|
export default {
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
138
|
+
components: {
|
|
139
|
+
[Select.name]: Select,
|
|
140
|
+
[Option.name]: Option
|
|
141
|
+
},
|
|
142
|
+
directives: { mask },
|
|
143
|
+
data() {
|
|
144
|
+
return {
|
|
145
|
+
configInfo: {
|
|
146
|
+
title: this.titleValue,
|
|
147
|
+
textarea: this.textAreaValue,
|
|
148
|
+
selectedTime: "",
|
|
149
|
+
workload: this.workloadValue,
|
|
150
|
+
category: this.testCategories
|
|
151
|
+
},
|
|
152
|
+
currentSelectedButton: String,
|
|
153
|
+
value: ""
|
|
154
|
+
};
|
|
155
|
+
},
|
|
156
|
+
model: {
|
|
157
|
+
prop: "show"
|
|
158
|
+
},
|
|
159
|
+
props: {
|
|
160
|
+
isCourse: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: false
|
|
163
|
+
},
|
|
164
|
+
inputPlaceholders: {
|
|
165
|
+
type: Object,
|
|
166
|
+
default: () => ({
|
|
167
|
+
firstInput: "Insira o nome do teste",
|
|
168
|
+
secondInput: "Insira a descrição do teste",
|
|
169
|
+
thirdInput: "Insira a carga horária do curso"
|
|
170
|
+
})
|
|
171
|
+
},
|
|
172
|
+
show: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false
|
|
175
|
+
},
|
|
176
|
+
name: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: "Nome"
|
|
179
|
+
},
|
|
180
|
+
defaultButtonSelected: {
|
|
181
|
+
type: Number,
|
|
182
|
+
default: 6
|
|
183
|
+
},
|
|
184
|
+
testId: {
|
|
185
|
+
type: Number,
|
|
186
|
+
default: null
|
|
187
|
+
},
|
|
188
|
+
buttons: {
|
|
189
|
+
type: Array,
|
|
190
|
+
default: () => [
|
|
191
|
+
{ id: "1", time: "5 minutos", value: "00:05:00" },
|
|
192
|
+
{ id: "2", time: "10 minutos", value: "00:10:00" },
|
|
193
|
+
{ id: "3", time: "15 minutos", value: "00:15:00" },
|
|
194
|
+
{ id: "4", time: "30 minutos", value: "00:30:00" },
|
|
195
|
+
{ id: "5", time: "45 minutos", value: "00:45:00" },
|
|
196
|
+
{ id: "6", time: "60 minutos", value: "01:00:00" },
|
|
197
|
+
{ id: "7", time: "2 horas", value: "02:00:00" },
|
|
198
|
+
{ id: "8", time: "8 horas", value: "08:00:00" }
|
|
199
|
+
],
|
|
200
|
+
description: "Botoes de tempo"
|
|
201
|
+
},
|
|
202
|
+
title: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: "Criar Teste",
|
|
205
|
+
description: "Titulo do Modal"
|
|
206
|
+
},
|
|
207
|
+
workloadTitle: {
|
|
208
|
+
type: String,
|
|
209
|
+
default: "Carga horária",
|
|
210
|
+
description:
|
|
211
|
+
"Carga horária do curso, apenas se o modal for usado para a pagina de cursos"
|
|
212
|
+
},
|
|
213
|
+
textAreaTitle: {
|
|
214
|
+
type: String,
|
|
215
|
+
default: "Descrição",
|
|
216
|
+
description: "Titulo da text area"
|
|
217
|
+
},
|
|
218
|
+
buttonAreaTitle: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: "Tempo Limite",
|
|
221
|
+
description: "Titulo da area de botões"
|
|
222
|
+
},
|
|
223
|
+
configAppButton: {
|
|
224
|
+
type: String,
|
|
225
|
+
default: "Salvar",
|
|
226
|
+
description: "Botão de envio"
|
|
227
|
+
},
|
|
228
|
+
titleValue: {
|
|
229
|
+
type: String,
|
|
230
|
+
default: ""
|
|
231
|
+
},
|
|
232
|
+
textAreaValue: {
|
|
233
|
+
type: String,
|
|
234
|
+
default: ""
|
|
235
|
+
},
|
|
236
|
+
workloadValue: {
|
|
237
|
+
type: String,
|
|
238
|
+
default: "00:00:00"
|
|
239
|
+
},
|
|
240
|
+
time: {
|
|
241
|
+
type: String,
|
|
242
|
+
default: ""
|
|
243
|
+
},
|
|
244
|
+
testCategories: {
|
|
245
|
+
type: Number,
|
|
246
|
+
default: null
|
|
247
|
+
},
|
|
248
|
+
categories: {
|
|
249
|
+
type: Array,
|
|
250
|
+
default: () => []
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
watch: {
|
|
254
|
+
titleValue(newValue) {
|
|
255
|
+
this.configInfo.title = newValue;
|
|
256
|
+
},
|
|
257
|
+
textAreaValue(newValue) {
|
|
258
|
+
this.configInfo.textarea = newValue;
|
|
259
|
+
},
|
|
260
|
+
workloadValue(newValue) {
|
|
261
|
+
this.configInfo.workload = newValue;
|
|
262
|
+
},
|
|
263
|
+
time(newValue) {
|
|
264
|
+
this.configInfo.selectedTime = newValue;
|
|
265
|
+
},
|
|
266
|
+
testCategories(newValue) {
|
|
267
|
+
this.configInfo.category = newValue;
|
|
268
|
+
},
|
|
269
|
+
show(value) {
|
|
270
|
+
const isCategoryInitialized = this.configInfo.category
|
|
271
|
+
? true
|
|
272
|
+
: false;
|
|
273
|
+
if (value && !this.isCourse && !isCategoryInitialized) {
|
|
274
|
+
this.configInfo.category = this.categories[0].id;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
mounted() {
|
|
279
|
+
this.loadTime();
|
|
280
|
+
},
|
|
281
|
+
computed: {
|
|
282
|
+
openModal: {
|
|
283
|
+
get() {
|
|
284
|
+
return this.show;
|
|
285
|
+
},
|
|
286
|
+
set(show) {
|
|
287
|
+
this.$emit("input", show);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
methods: {
|
|
292
|
+
loadTime() {
|
|
293
|
+
let time = this.buttons.find(e => e.value === this.time);
|
|
294
|
+
if (time != null) {
|
|
295
|
+
this.currentSelectedButton = time.id;
|
|
296
|
+
this.configInfo.selectedTime = this.time;
|
|
297
|
+
} else {
|
|
298
|
+
time = this.buttons.find(
|
|
299
|
+
e => e.id == this.defaultButtonSelected
|
|
300
|
+
);
|
|
301
|
+
this.currentSelectedButton = time.id;
|
|
302
|
+
this.configInfo.selectedTime = time.value;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
timeSelection(buttonId) {
|
|
306
|
+
let btn = document.getElementById("button-" + buttonId);
|
|
307
|
+
this.configInfo.selectedTime = btn.value;
|
|
308
|
+
this.currentSelectedButton = buttonId;
|
|
309
|
+
},
|
|
310
|
+
async sendConfig() {
|
|
311
|
+
const pass = await this.$refs.appConfigModal.validate();
|
|
312
|
+
if (!pass) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
let config;
|
|
316
|
+
if (!this.isCourse) {
|
|
317
|
+
config = {
|
|
318
|
+
title: this.configInfo.title,
|
|
319
|
+
textarea: this.configInfo.textarea,
|
|
320
|
+
selectedTime: this.configInfo.selectedTime,
|
|
321
|
+
category: this.configInfo.category
|
|
322
|
+
};
|
|
323
|
+
console.log(config);
|
|
324
|
+
} else if (this.isCourse) {
|
|
325
|
+
config = {
|
|
326
|
+
title: this.configInfo.title,
|
|
327
|
+
textarea: this.configInfo.textarea,
|
|
328
|
+
selectedTime: this.configInfo.selectedTime,
|
|
329
|
+
workload: this.configInfo.workload
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
this.$emit("send-config-info", config);
|
|
333
|
+
this.openModal = false;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
280
336
|
};
|
|
281
337
|
</script>
|
|
282
338
|
<style lang="scss">
|
|
283
339
|
@import "node_modules/@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss";
|
|
284
340
|
|
|
285
|
-
.fixed-button{
|
|
286
|
-
.btn{
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
341
|
+
.fixed-button {
|
|
342
|
+
.btn {
|
|
343
|
+
font-size: 0.775rem;
|
|
344
|
+
@media screen and (max-width: 992px) {
|
|
345
|
+
&:last-child {
|
|
346
|
+
margin-right: 1rem !important;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
293
349
|
width: 10rem;
|
|
294
350
|
}
|
|
295
351
|
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<modal :show.sync="isModalOpen" v-on:close="closeModal" class="modal">
|
|
3
|
+
<template slot="header">
|
|
4
|
+
<h2 class="display-4 px-4">
|
|
5
|
+
Enviar SMS
|
|
6
|
+
</h2>
|
|
7
|
+
</template>
|
|
8
|
+
<validation-observer ref="smsModal" tag="div">
|
|
9
|
+
<div class="px-3">
|
|
10
|
+
<div>
|
|
11
|
+
<base-input
|
|
12
|
+
v-model="receiver"
|
|
13
|
+
label="Para"
|
|
14
|
+
v-mask="['(##) #####-####']"
|
|
15
|
+
placeholder="Adicionar um número de telefone"
|
|
16
|
+
:class="'w-100'"
|
|
17
|
+
@change="addNumber(receiver)"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<div class="row">
|
|
21
|
+
<badge
|
|
22
|
+
v-for="(numbers, index) in allNumbers"
|
|
23
|
+
:key="index"
|
|
24
|
+
type="primary"
|
|
25
|
+
class="col-3 mx-3 px-1"
|
|
26
|
+
>{{ numbers
|
|
27
|
+
}}<i
|
|
28
|
+
class="fas fa-times ml-1 cursor-pointer"
|
|
29
|
+
@click="deleteNumber(index)"
|
|
30
|
+
></i
|
|
31
|
+
></badge>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="mb-4">
|
|
36
|
+
<div class="d-flex flex-column">
|
|
37
|
+
<label for="message" class="form-control-label"
|
|
38
|
+
>Mensagem</label
|
|
39
|
+
>
|
|
40
|
+
<div class="d-flex align-items-center">
|
|
41
|
+
<el-select
|
|
42
|
+
filterable
|
|
43
|
+
no-match-text="Nenhum modelo encontrado"
|
|
44
|
+
no-data-text="Nenhum modelo encontrado"
|
|
45
|
+
placeholder="Escolha o modelo"
|
|
46
|
+
:class="'col-9 px-0'"
|
|
47
|
+
@change="changeMessage(messageTitle)"
|
|
48
|
+
v-model="messageTitle"
|
|
49
|
+
>
|
|
50
|
+
<el-option
|
|
51
|
+
v-for="(templates, index) in models"
|
|
52
|
+
class="select-danger"
|
|
53
|
+
:value="templates.title"
|
|
54
|
+
:key="index"
|
|
55
|
+
:disabled="hasModel"
|
|
56
|
+
></el-option>
|
|
57
|
+
</el-select>
|
|
58
|
+
|
|
59
|
+
<el-tooltip
|
|
60
|
+
class="item"
|
|
61
|
+
effect="dark"
|
|
62
|
+
:content="'Remover Template'"
|
|
63
|
+
placement="top"
|
|
64
|
+
>
|
|
65
|
+
<i
|
|
66
|
+
v-if="messageTitle"
|
|
67
|
+
@click="
|
|
68
|
+
belongsToUser()
|
|
69
|
+
? deleteTemplate(messageTitle)
|
|
70
|
+
: ''
|
|
71
|
+
"
|
|
72
|
+
class="fas fa-trash col-3 ml-5"
|
|
73
|
+
:class="
|
|
74
|
+
belongsToUser()
|
|
75
|
+
? 'text-danger cursor-pointer'
|
|
76
|
+
: ''
|
|
77
|
+
"
|
|
78
|
+
></i>
|
|
79
|
+
</el-tooltip>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<validation-provider
|
|
84
|
+
tag="div"
|
|
85
|
+
class="pb-3"
|
|
86
|
+
name="Texto da mensagem"
|
|
87
|
+
rules="required"
|
|
88
|
+
v-slot="{ errors }"
|
|
89
|
+
>
|
|
90
|
+
<textarea
|
|
91
|
+
class="form-control mt-4"
|
|
92
|
+
v-model="message"
|
|
93
|
+
:class="{ 'is-invalid': errors.length }"
|
|
94
|
+
placeholder="Mensagem que será enviada"
|
|
95
|
+
></textarea>
|
|
96
|
+
<div
|
|
97
|
+
v-if="errors.length"
|
|
98
|
+
class="invalid-feedback"
|
|
99
|
+
style="display: block;"
|
|
100
|
+
>
|
|
101
|
+
{{ errors[0] }}
|
|
102
|
+
</div>
|
|
103
|
+
</validation-provider>
|
|
104
|
+
|
|
105
|
+
<el-checkbox class="mt-4" v-model="saveModel"
|
|
106
|
+
>Salvar modelo de mensagem</el-checkbox
|
|
107
|
+
>
|
|
108
|
+
|
|
109
|
+
<validation-provider
|
|
110
|
+
tag="div"
|
|
111
|
+
v-if="saveModel"
|
|
112
|
+
:class="'d-flex align-items-center'"
|
|
113
|
+
name="Titulo para o modelo"
|
|
114
|
+
rules="required"
|
|
115
|
+
v-slot="{ errors }"
|
|
116
|
+
>
|
|
117
|
+
<base-input
|
|
118
|
+
v-model="modelName"
|
|
119
|
+
placeholder="Titulo para o modelo"
|
|
120
|
+
:class="'mt-4 col-9 px-0'"
|
|
121
|
+
:error="errors[0]"
|
|
122
|
+
:valid="errors.length ? true : false"
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
<i
|
|
126
|
+
class="text-primary fas fa-save cursor-pointer col-3 ml-5"
|
|
127
|
+
@click="saveTemplate()"
|
|
128
|
+
></i>
|
|
129
|
+
</validation-provider>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="d-flex">
|
|
132
|
+
<base-button
|
|
133
|
+
size="md"
|
|
134
|
+
type="primary"
|
|
135
|
+
role="button"
|
|
136
|
+
@click="sendSms()"
|
|
137
|
+
class="ml-auto"
|
|
138
|
+
>Enviar
|
|
139
|
+
</base-button>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</validation-observer>
|
|
143
|
+
</modal>
|
|
144
|
+
</template>
|
|
145
|
+
|
|
146
|
+
<script>
|
|
147
|
+
import { Select, Option, Checkbox, Tooltip } from "element-ui";
|
|
148
|
+
import { mask } from "vue-the-mask";
|
|
149
|
+
import swal from "sweetalert2";
|
|
150
|
+
export default {
|
|
151
|
+
directives: { mask },
|
|
152
|
+
name: "send-sms",
|
|
153
|
+
components: {
|
|
154
|
+
[Select.name]: Select,
|
|
155
|
+
[Option.name]: Option,
|
|
156
|
+
[Checkbox.name]: Checkbox,
|
|
157
|
+
[Tooltip.name]: Tooltip
|
|
158
|
+
},
|
|
159
|
+
computed: {
|
|
160
|
+
isModalOpen: {
|
|
161
|
+
get() {
|
|
162
|
+
return this.show;
|
|
163
|
+
},
|
|
164
|
+
set(show) {
|
|
165
|
+
this.$emit("input", show);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
props: {
|
|
170
|
+
show: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: false
|
|
173
|
+
},
|
|
174
|
+
templates: null
|
|
175
|
+
},
|
|
176
|
+
model: {
|
|
177
|
+
prop: "show"
|
|
178
|
+
},
|
|
179
|
+
watch: {
|
|
180
|
+
templates(newValue) {
|
|
181
|
+
this.models = newValue;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
data() {
|
|
185
|
+
return {
|
|
186
|
+
models: this.templates,
|
|
187
|
+
messageTitle: null,
|
|
188
|
+
receiver: null,
|
|
189
|
+
message: "",
|
|
190
|
+
hasModel: false,
|
|
191
|
+
saveModel: false,
|
|
192
|
+
modelName: null,
|
|
193
|
+
allNumbers: []
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
methods: {
|
|
197
|
+
closeModal() {
|
|
198
|
+
this.$emit("close-modal");
|
|
199
|
+
},
|
|
200
|
+
async sendSms() {
|
|
201
|
+
const pass = await this.$refs.smsModal.validate();
|
|
202
|
+
if (!pass) {
|
|
203
|
+
swal.fire({
|
|
204
|
+
title: `Aviso`,
|
|
205
|
+
html: `Preecha todos os campos corretamente`,
|
|
206
|
+
buttonsStyling: false,
|
|
207
|
+
type: "error",
|
|
208
|
+
confirmButtonClass: "btn btn-primary btn-fill"
|
|
209
|
+
});
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (this.allNumbers.length == 0) {
|
|
213
|
+
swal.fire({
|
|
214
|
+
title: `Aviso`,
|
|
215
|
+
html: `Adicione pelo menos um número de telefone para continuar`,
|
|
216
|
+
buttonsStyling: false,
|
|
217
|
+
type: "error",
|
|
218
|
+
confirmButtonClass: "btn btn-primary btn-fill"
|
|
219
|
+
});
|
|
220
|
+
return;
|
|
221
|
+
} else {
|
|
222
|
+
this.$emit("send-sms", this.allNumbers, this.message);
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
saveTemplate() {
|
|
226
|
+
if (this.saveModel) {
|
|
227
|
+
this.$emit("save-model", this.modelName, this.message);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
addNumber(number) {
|
|
231
|
+
this.allNumbers.push(number);
|
|
232
|
+
this.receiver = "";
|
|
233
|
+
},
|
|
234
|
+
deleteNumber(index) {
|
|
235
|
+
this.allNumbers.splice(index, 1);
|
|
236
|
+
},
|
|
237
|
+
changeMessage(messageName) {
|
|
238
|
+
let message = this.models.find(data => data.title == messageName);
|
|
239
|
+
this.message = message.message;
|
|
240
|
+
},
|
|
241
|
+
deleteTemplate(messageName) {
|
|
242
|
+
let template = this.models.find(data => data.title == messageName);
|
|
243
|
+
this.messageTitle = "";
|
|
244
|
+
this.$emit("remove-template", template.id);
|
|
245
|
+
},
|
|
246
|
+
belongsToUser() {
|
|
247
|
+
let template = this.models.find(
|
|
248
|
+
data => data.title == this.messageTitle
|
|
249
|
+
);
|
|
250
|
+
if (
|
|
251
|
+
parseInt(this.$store.state.user.currentUser.id) ==
|
|
252
|
+
template.user_id
|
|
253
|
+
) {
|
|
254
|
+
return true;
|
|
255
|
+
} else {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
mounted() {}
|
|
261
|
+
};
|
|
262
|
+
</script>
|
|
263
|
+
<style lang="scss" scoped>
|
|
264
|
+
.badge {
|
|
265
|
+
margin-bottom: 1.5rem;
|
|
266
|
+
}
|
|
267
|
+
.modal-body {
|
|
268
|
+
padding: 1.5rem !important;
|
|
269
|
+
}
|
|
270
|
+
</style>
|