@burh/nuxt-core 1.0.394 → 1.0.396
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.
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<span
|
|
45
45
|
v-if="
|
|
46
|
-
userData.user_complementary_information.wage_pretension > 1
|
|
46
|
+
userData && userData.user_complementary_information && userData.user_complementary_information.wage_pretension && userData.user_complementary_information.wage_pretension > 1
|
|
47
47
|
"
|
|
48
48
|
>Pretensão salarial:
|
|
49
49
|
{{
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
/>
|
|
161
161
|
</a>
|
|
162
162
|
<a
|
|
163
|
-
v-
|
|
163
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.facebook_url || false"
|
|
164
164
|
:href="userData.user_complementary_information.facebook_url"
|
|
165
165
|
target="_blank"
|
|
166
166
|
class="ml-2"
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
/>
|
|
174
174
|
</a>
|
|
175
175
|
<a
|
|
176
|
-
v-
|
|
176
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.linkedin_url || false"
|
|
177
177
|
:href="userData.user_complementary_information.linkedin_url"
|
|
178
178
|
target="_blank"
|
|
179
179
|
class="ml-2"
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
/>
|
|
187
187
|
</a>
|
|
188
188
|
<a
|
|
189
|
-
v-
|
|
189
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.website || false"
|
|
190
190
|
:href="userData.user_complementary_information.website"
|
|
191
191
|
class="text-center ml-2"
|
|
192
192
|
target="_blank"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<div class="about content-block mt-5 ml-3 mr-3">
|
|
27
27
|
<h5 class="font-weight-bold">Sobre</h5>
|
|
28
28
|
<p
|
|
29
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false"
|
|
29
30
|
id="USER_ABOUT"
|
|
30
31
|
class="mb-0"
|
|
31
32
|
:class="
|
|
@@ -43,17 +44,17 @@
|
|
|
43
44
|
<a
|
|
44
45
|
href="#"
|
|
45
46
|
aria-label="expandir conteudo"
|
|
46
|
-
v-
|
|
47
|
-
userData.user_complementary_information.about &&
|
|
47
|
+
v-if="
|
|
48
|
+
userData && userData.user_complementary_information && userData.user_complementary_information.about &&
|
|
48
49
|
!wordIsLesserThan(
|
|
49
50
|
userData.user_complementary_information.about
|
|
50
|
-
)
|
|
51
|
+
) || false
|
|
51
52
|
"
|
|
52
53
|
@click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
|
|
53
54
|
>Ler mais</a
|
|
54
55
|
>
|
|
55
56
|
|
|
56
|
-
<p v-
|
|
57
|
+
<p v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false" class="">
|
|
57
58
|
Nenhuma informação adicionada
|
|
58
59
|
</p>
|
|
59
60
|
</div>
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<modal :show="isModalOpen" v-on:close="closeModal"
|
|
3
|
-
|
|
2
|
+
<modal :show="isModalOpen" v-on:close="closeModal" class="modal">
|
|
3
|
+
|
|
4
4
|
<template slot="header">
|
|
5
5
|
<h2 class="display-4 pb-3">
|
|
6
6
|
Insira os e-mails que deseja convidar a empresa
|
|
7
7
|
</h2>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<div class="row px-4">
|
|
11
|
-
<div class="col-4">
|
|
12
|
-
<label for="name">Nome Completo</label>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="col-4">
|
|
15
|
-
<label for="email">E-mail</label>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="col-4">
|
|
18
|
-
<label for="email">Cargo</label>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
10
|
<validation-observer ref="inviteUser">
|
|
23
|
-
<div class="
|
|
11
|
+
<div class="column p-4 member__container" v-for="(slot, idx) in slots" :key="idx">
|
|
24
12
|
|
|
25
13
|
<validation-provider
|
|
26
14
|
tag="div"
|
|
27
|
-
class="col-
|
|
15
|
+
class="col-12"
|
|
28
16
|
:vid="`send-name-${idx}`"
|
|
29
17
|
name="Nome"
|
|
30
18
|
rules="required|regex:\w+\s+\w+"
|
|
@@ -32,6 +20,8 @@
|
|
|
32
20
|
>
|
|
33
21
|
<base-input
|
|
34
22
|
v-model="slot.name"
|
|
23
|
+
label="Nome Completo"
|
|
24
|
+
placeholder="Nome Completo"
|
|
35
25
|
:error="errors[0]"
|
|
36
26
|
:valid="errors.length ? true : false"
|
|
37
27
|
/>
|
|
@@ -39,7 +29,7 @@
|
|
|
39
29
|
|
|
40
30
|
<validation-provider
|
|
41
31
|
tag="div"
|
|
42
|
-
class="col-
|
|
32
|
+
class="col-12"
|
|
43
33
|
:vid="`send-email-${idx}`"
|
|
44
34
|
name="Email"
|
|
45
35
|
rules="required|email"
|
|
@@ -47,42 +37,82 @@
|
|
|
47
37
|
>
|
|
48
38
|
<base-input
|
|
49
39
|
v-model="slot.email"
|
|
40
|
+
label="Email"
|
|
41
|
+
placeholder="Email"
|
|
50
42
|
:error="errors[0]"
|
|
51
43
|
:valid="errors.length ? true : false"
|
|
52
44
|
/>
|
|
53
45
|
</validation-provider>
|
|
54
46
|
|
|
55
|
-
<div
|
|
56
|
-
<
|
|
57
|
-
class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:value="role.level"
|
|
47
|
+
<div class="select__container px-3">
|
|
48
|
+
<div name="role">
|
|
49
|
+
<label for="select" class="form-control-label">Setor</label>
|
|
50
|
+
|
|
51
|
+
<el-select
|
|
52
|
+
class="select-danger"
|
|
53
|
+
id="select"
|
|
54
|
+
placeholder="Setor"
|
|
55
|
+
v-model="slot.role"
|
|
56
|
+
clearable
|
|
66
57
|
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
<div class="text-center" slot="empty">
|
|
59
|
+
<p class="small text-muted mx-2 mb-2 mt-2">
|
|
60
|
+
Nenhum setor encontrado
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
<el-option
|
|
65
|
+
v-for="role in corporativeRole"
|
|
66
|
+
:key="role.id"
|
|
67
|
+
:label="role.level"
|
|
68
|
+
:value="role.level"
|
|
69
|
+
>
|
|
70
|
+
</el-option>
|
|
71
|
+
</el-select>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div name="role">
|
|
75
|
+
<label for="buffer" class="form-control-label">Vincular ao buffer</label>
|
|
76
|
+
|
|
77
|
+
<el-select
|
|
78
|
+
class="select-danger"
|
|
79
|
+
id="buffer"
|
|
80
|
+
placeholder="Buffer"
|
|
81
|
+
v-model="slot.buffer"
|
|
82
|
+
clearable
|
|
83
|
+
>
|
|
84
|
+
<div class="text-center" slot="empty">
|
|
85
|
+
<p class="small text-muted mx-2 mb-2 mt-2">
|
|
86
|
+
Nenhum buffer encontrado
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<el-option
|
|
91
|
+
v-for="buffer in bufferList"
|
|
92
|
+
:key="buffer.id"
|
|
93
|
+
:label="buffer.name"
|
|
94
|
+
:value="buffer.main_folder_id"
|
|
95
|
+
>
|
|
96
|
+
</el-option>
|
|
97
|
+
</el-select>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="icon__position pt-2 d-flex align-items-center justify-content-center">
|
|
101
|
+
<i
|
|
102
|
+
v-if="idx !== slots.length - 1"
|
|
103
|
+
class="fa fa-trash pointer"
|
|
104
|
+
@click="removeSlot(idx)"
|
|
105
|
+
></i>
|
|
106
|
+
<i v-else class="fa fa-plus pointer" @click="addSlot"></i>
|
|
107
|
+
</div>
|
|
78
108
|
</div>
|
|
79
109
|
|
|
80
110
|
</div>
|
|
81
111
|
</validation-observer>
|
|
82
112
|
|
|
83
|
-
<div class="row">
|
|
113
|
+
<div class="row col-12">
|
|
84
114
|
<base-button
|
|
85
|
-
class="
|
|
115
|
+
class="ml-auto"
|
|
86
116
|
type="primary"
|
|
87
117
|
@click="inviteUser"
|
|
88
118
|
:disabled="isLoading"
|
|
@@ -108,14 +138,29 @@ export default {
|
|
|
108
138
|
type: Boolean,
|
|
109
139
|
default: false
|
|
110
140
|
},
|
|
111
|
-
corporativeRole:
|
|
141
|
+
corporativeRole: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: () => []
|
|
144
|
+
},
|
|
112
145
|
isLoading: {
|
|
113
146
|
type: Boolean,
|
|
114
147
|
default: false,
|
|
115
148
|
description: 'Loading for request'
|
|
116
149
|
}
|
|
117
150
|
},
|
|
151
|
+
watch: {
|
|
152
|
+
isModalOpen(to) {
|
|
153
|
+
if (to) {
|
|
154
|
+
this.resetSlots();
|
|
155
|
+
this.getBufferList();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
118
159
|
methods: {
|
|
160
|
+
async getBufferList() {
|
|
161
|
+
const { data } = await this.$services.buffer.search();
|
|
162
|
+
this.bufferList = data || [];
|
|
163
|
+
},
|
|
119
164
|
closeModal(e) {
|
|
120
165
|
this.$emit('closemodal', e);
|
|
121
166
|
},
|
|
@@ -125,12 +170,7 @@ export default {
|
|
|
125
170
|
},
|
|
126
171
|
|
|
127
172
|
addSlot() {
|
|
128
|
-
const newSlot =
|
|
129
|
-
idx: '',
|
|
130
|
-
name: '',
|
|
131
|
-
email: '',
|
|
132
|
-
role: ''
|
|
133
|
-
};
|
|
173
|
+
const newSlot = this.getSlot();
|
|
134
174
|
|
|
135
175
|
this.slots = [...this.slots, newSlot];
|
|
136
176
|
},
|
|
@@ -152,45 +192,46 @@ export default {
|
|
|
152
192
|
name: slot.name.substring(slot.name.indexOf(' '), 0),
|
|
153
193
|
last_name: slot.name.substring(slot.name.indexOf(' ') + 1),
|
|
154
194
|
email: slot.email,
|
|
155
|
-
access_level: slot.role
|
|
195
|
+
access_level: slot.role,
|
|
196
|
+
company_buffer_folder_id: slot.buffer
|
|
156
197
|
}));
|
|
157
198
|
|
|
158
199
|
return [
|
|
159
200
|
...formattedSlots
|
|
160
201
|
];
|
|
161
202
|
};
|
|
162
|
-
|
|
203
|
+
|
|
163
204
|
let params = {
|
|
164
205
|
users: formatRequest()
|
|
165
206
|
};
|
|
166
207
|
|
|
167
|
-
this.resetSlots();
|
|
168
208
|
this.$emit('invite-user', params);
|
|
169
209
|
},
|
|
170
210
|
|
|
211
|
+
getSlot() {
|
|
212
|
+
return {
|
|
213
|
+
idx: '',
|
|
214
|
+
name: '',
|
|
215
|
+
email: '',
|
|
216
|
+
role: '',
|
|
217
|
+
buffer: ''
|
|
218
|
+
};
|
|
219
|
+
},
|
|
171
220
|
resetSlots() {
|
|
172
|
-
this.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
name: '',
|
|
176
|
-
email: '',
|
|
177
|
-
role: ''
|
|
178
|
-
}
|
|
179
|
-
];
|
|
221
|
+
this.$refs.inviteUser.reset();
|
|
222
|
+
this.slots = [];
|
|
223
|
+
this.slots.push(this.getSlot());
|
|
180
224
|
}
|
|
181
225
|
},
|
|
182
226
|
data() {
|
|
183
227
|
return {
|
|
184
|
-
slots: [
|
|
185
|
-
|
|
186
|
-
idx: '',
|
|
187
|
-
name: '',
|
|
188
|
-
email: '',
|
|
189
|
-
role: ''
|
|
190
|
-
}
|
|
191
|
-
],
|
|
228
|
+
slots: [],
|
|
229
|
+
bufferList: []
|
|
192
230
|
};
|
|
193
231
|
},
|
|
232
|
+
mounted() {
|
|
233
|
+
this.resetSlots();
|
|
234
|
+
}
|
|
194
235
|
};
|
|
195
236
|
</script>
|
|
196
237
|
<style lang="scss" scoped>
|
|
@@ -214,4 +255,17 @@ export default {
|
|
|
214
255
|
.is-loading {
|
|
215
256
|
opacity: 0.3;
|
|
216
257
|
}
|
|
258
|
+
.member__container {
|
|
259
|
+
&:not(:nth-child(1)) {
|
|
260
|
+
border: 1px solid #e9e9e9;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.select__container {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: 1fr 1fr 10px;
|
|
266
|
+
gap: 20px;
|
|
267
|
+
}
|
|
268
|
+
.icon__position {
|
|
269
|
+
margin-top: 23px;
|
|
270
|
+
}
|
|
217
271
|
</style>
|
|
@@ -1,339 +1,369 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
|
|
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
|
-
v-
|
|
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
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
|
|
3
|
+
<basics :isLoading="isLoading" v-if="isLoading"/>
|
|
4
|
+
<template slot="header">
|
|
5
|
+
|
|
6
|
+
<h2 class="display-4 px-2">
|
|
7
|
+
Insira os e-mail que deseja enviar o treinamento <br>
|
|
8
|
+
|
|
9
|
+
</h2>
|
|
10
|
+
</template>
|
|
11
|
+
<div class="switch-position">
|
|
12
|
+
<el-switch
|
|
13
|
+
v-model="switchSingle"
|
|
14
|
+
active-color="#5865F2"
|
|
15
|
+
inactive-text="Enviar para novos usuários"
|
|
16
|
+
active-text="Enviar por setor">
|
|
17
|
+
</el-switch>
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
<div class="content-1">
|
|
21
|
+
<div v-if="!switchSingle" style="min-height:100px">
|
|
22
|
+
<div class="row px-4">
|
|
23
|
+
<div class="col-4">
|
|
24
|
+
<label for="name">Nome Completo</label>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-4">
|
|
27
|
+
<label for="email">E-mail</label>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="col-4">
|
|
30
|
+
<label for="email">Setor</label>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<validation-observer ref="sendCourse">
|
|
34
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
35
|
+
|
|
36
|
+
<validation-provider
|
|
37
|
+
tag="div"
|
|
38
|
+
class="col-4"
|
|
39
|
+
style="height: 50px"
|
|
40
|
+
:vid="`send-name-${idx}`"
|
|
41
|
+
name="Nome"
|
|
42
|
+
rules="required|regex:\w+\s+\w+"
|
|
43
|
+
v-slot="{ errors }"
|
|
44
|
+
:disabled="payload.all_users ? true : false"
|
|
45
|
+
>
|
|
46
|
+
<base-input
|
|
47
|
+
:disabled="payload.all_users ? true : false"
|
|
48
|
+
v-model="slot.name"
|
|
49
|
+
:error="errors[0]"
|
|
50
|
+
:valid="errors.length ? true : false"
|
|
51
|
+
placeholder="Nome Completo"
|
|
52
|
+
/>
|
|
53
|
+
</validation-provider>
|
|
54
|
+
|
|
55
|
+
<validation-provider
|
|
56
|
+
tag="div"
|
|
57
|
+
class="col-4"
|
|
58
|
+
style="height: 50px"
|
|
59
|
+
:vid="`send-email-${idx}`"
|
|
60
|
+
name="Email"
|
|
61
|
+
rules="required|email"
|
|
62
|
+
v-slot="{ errors }"
|
|
63
|
+
:disabled="payload.all_users ? true : false"
|
|
64
|
+
>
|
|
65
|
+
<base-input
|
|
66
|
+
:disabled="payload.all_users ? true : false"
|
|
67
|
+
v-model="slot.email"
|
|
68
|
+
:error="errors[0]"
|
|
69
|
+
:valid="errors.length ? true : false"
|
|
70
|
+
placeholder="E-mail"
|
|
71
|
+
/>
|
|
72
|
+
</validation-provider>
|
|
73
|
+
|
|
74
|
+
<div tag="div" class="col-3" name="role">
|
|
75
|
+
<el-select
|
|
76
|
+
filterable
|
|
77
|
+
no-match-text="Nenhum cargo encontrado"
|
|
78
|
+
no-data-text="Nenhum cargo encontrado"
|
|
79
|
+
class="select-danger"
|
|
80
|
+
v-model="slot.access_level_id"
|
|
81
|
+
style="height: 50px"
|
|
82
|
+
placeholder="Escolha o setor"
|
|
83
|
+
:disabled="payload.all_users ? true : false"
|
|
84
|
+
>
|
|
85
|
+
<el-option
|
|
86
|
+
v-for="role in corporativeRole"
|
|
87
|
+
:key="role.id"
|
|
88
|
+
:label="role.level"
|
|
89
|
+
:value="role.id"
|
|
90
|
+
>
|
|
91
|
+
</el-option>
|
|
92
|
+
</el-select>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div class="col-1">
|
|
96
|
+
<i
|
|
97
|
+
v-if="idx !== payload.users.length - 1"
|
|
98
|
+
class="fa fa-trash pointer"
|
|
99
|
+
@click="removeSlot(idx)"
|
|
100
|
+
></i>
|
|
101
|
+
<i v-else class="fa fa-plus pointer" @click="addSlot"></i>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</validation-observer>
|
|
107
|
+
</div>
|
|
108
|
+
<!-- envio em massa -->
|
|
109
|
+
<div v-else style="height:100px">
|
|
110
|
+
<div class="px-4">
|
|
111
|
+
<label for="email">Setor</label>
|
|
112
|
+
</div>
|
|
113
|
+
<validation-observer ref="sendCourse">
|
|
114
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
115
|
+
<div tag="div" class="col-12" name="role">
|
|
116
|
+
<el-select
|
|
117
|
+
filterable
|
|
118
|
+
no-match-text="Nenhum cargo encontrado"
|
|
119
|
+
no-data-text="Nenhum cargo encontrado"
|
|
120
|
+
class="select-danger"
|
|
121
|
+
multiple
|
|
122
|
+
style="width: 100%;"
|
|
123
|
+
v-model="selectedRole"
|
|
124
|
+
placeholder="Escolha o setor"
|
|
125
|
+
:disabled="payload.all_users ? true : false"
|
|
126
|
+
>
|
|
127
|
+
<el-option
|
|
128
|
+
v-for="role in corporativeRole"
|
|
129
|
+
:key="role.id"
|
|
130
|
+
:label="role.level"
|
|
131
|
+
:value="role.id"
|
|
132
|
+
>
|
|
133
|
+
</el-option>
|
|
134
|
+
</el-select>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</validation-observer>
|
|
138
|
+
</div>
|
|
139
|
+
<el-checkbox
|
|
140
|
+
v-show="switchSingle"
|
|
141
|
+
class="checkbox-user"
|
|
142
|
+
v-model="payload.all_users"
|
|
143
|
+
> Enviar para todos
|
|
144
|
+
</el-checkbox>
|
|
145
|
+
</div>
|
|
146
|
+
<hr />
|
|
147
|
+
|
|
148
|
+
<div class="row px-4">
|
|
149
|
+
<div class="col-12">
|
|
150
|
+
<label for="courses">Acesso aos Treinamentos</label>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="row px-4">
|
|
154
|
+
<div class="col-12">
|
|
155
|
+
<el-select
|
|
156
|
+
v-model="coursesToSend"
|
|
157
|
+
multiple
|
|
158
|
+
style="width: 100%;"
|
|
159
|
+
placeholder="Treinamentos"
|
|
160
|
+
name="courses"
|
|
161
|
+
>
|
|
162
|
+
<el-option
|
|
163
|
+
v-for="item in courses"
|
|
164
|
+
:key="item.id"
|
|
165
|
+
:label="item.name"
|
|
166
|
+
:value="item.id"
|
|
167
|
+
>
|
|
168
|
+
</el-option>
|
|
169
|
+
</el-select>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div class="row">
|
|
174
|
+
<base-button
|
|
175
|
+
class="mx-auto"
|
|
176
|
+
type="primary"
|
|
177
|
+
@click="sendTest"
|
|
178
|
+
:disabled="isLoading"
|
|
179
|
+
:class="{'is-loading': isLoading}"
|
|
180
|
+
>
|
|
181
|
+
{{ isLoading ? 'Enviando' : 'Enviar' }}
|
|
182
|
+
</base-button>
|
|
183
|
+
</div>
|
|
184
|
+
</modal>
|
|
185
|
+
</template>
|
|
186
|
+
|
|
187
|
+
<script>
|
|
188
|
+
import { Select, Option, Switch, Checkbox } from 'element-ui';
|
|
189
|
+
import Basics from '../Loadings/Basics';
|
|
190
|
+
|
|
191
|
+
export default {
|
|
192
|
+
name: 'send-course',
|
|
193
|
+
components: {
|
|
194
|
+
[Select.name]: Select,
|
|
195
|
+
[Option.name]: Option,
|
|
196
|
+
[Switch.name]: Switch,
|
|
197
|
+
[Checkbox.name]: Checkbox,
|
|
198
|
+
Basics,
|
|
199
|
+
},
|
|
200
|
+
props: {
|
|
201
|
+
isModalOpen: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: false
|
|
204
|
+
},
|
|
205
|
+
selectedCourse: Number,
|
|
206
|
+
corporativeRole: null,
|
|
207
|
+
courses: Array,
|
|
208
|
+
isLoading: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
default: false,
|
|
211
|
+
description: 'Loading to send course'
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
watch: {
|
|
215
|
+
selectedCourse(newValue) {
|
|
216
|
+
this.coursesToSend = newValue ? [newValue] : [];
|
|
217
|
+
},
|
|
218
|
+
switchSingle(){
|
|
219
|
+
this.resetSlots();
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
data() {
|
|
223
|
+
return {
|
|
224
|
+
payload: {
|
|
225
|
+
users: [
|
|
226
|
+
{
|
|
227
|
+
idx: '',
|
|
228
|
+
name: '',
|
|
229
|
+
email: '',
|
|
230
|
+
access_level_id: this.selectedRole
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
courses: [{ id: '' }],
|
|
234
|
+
access_levels:[{ id: '' }],
|
|
235
|
+
all_users : false
|
|
236
|
+
},
|
|
237
|
+
selectedRole: '',
|
|
238
|
+
switchSingle: false,
|
|
239
|
+
coursesToSend: [],
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
methods: {
|
|
243
|
+
closeModal(e) {
|
|
244
|
+
this.$emit('closemodal', e);
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
removeSlot(idx) {
|
|
248
|
+
this.payload.users.splice(idx, 1);
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
addSlot() {
|
|
252
|
+
const newSlot = {
|
|
253
|
+
idx: '',
|
|
254
|
+
name: '',
|
|
255
|
+
email: '',
|
|
256
|
+
access_level_id: this.selectedRole,
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
this.payload.users = [...this.payload.users, newSlot];
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
async sendTest() {
|
|
263
|
+
const pass = await this.$refs.sendCourse.validate();
|
|
264
|
+
|
|
265
|
+
if (!pass) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const filterUsers = user => user.email !== '';
|
|
270
|
+
let formattedCourses = this.coursesToSend.map(id => ({
|
|
271
|
+
id
|
|
272
|
+
}));
|
|
273
|
+
let allUsers = this.payload.all_users;
|
|
274
|
+
|
|
275
|
+
if(this.switchSingle === false) {
|
|
276
|
+
const formatRequest = () => {
|
|
277
|
+
let formattedSlots = this.payload.users
|
|
278
|
+
.filter(filterUsers)
|
|
279
|
+
.map(user => ({
|
|
280
|
+
name: user.name.substring(user.name.indexOf(' '), 0),
|
|
281
|
+
last_name: user.name.substring(
|
|
282
|
+
user.name.indexOf(' ') + 1
|
|
283
|
+
),
|
|
284
|
+
email: user.email,
|
|
285
|
+
access_level_id: user.access_level_id
|
|
286
|
+
}));
|
|
287
|
+
|
|
288
|
+
return {
|
|
289
|
+
...formattedSlots
|
|
290
|
+
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
let params = {
|
|
295
|
+
users: formatRequest(),
|
|
296
|
+
courses: formattedCourses,
|
|
297
|
+
all_users: allUsers
|
|
298
|
+
};
|
|
299
|
+
this.resetSlots();
|
|
300
|
+
this.$emit('send-course', params);
|
|
301
|
+
} else {
|
|
302
|
+
let params = {
|
|
303
|
+
courses: formattedCourses,
|
|
304
|
+
access_levels: this.selectedRole.map(id => {
|
|
305
|
+
return { id };
|
|
306
|
+
}),
|
|
307
|
+
all_users: allUsers
|
|
308
|
+
|
|
309
|
+
};
|
|
310
|
+
this.resetSlots();
|
|
311
|
+
this.$emit('send-course', params);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
resetSlots() {
|
|
315
|
+
this.payload.users = [
|
|
316
|
+
{
|
|
317
|
+
idx: '',
|
|
318
|
+
name: '',
|
|
319
|
+
email: '',
|
|
320
|
+
access_level_id: ''
|
|
321
|
+
},
|
|
322
|
+
];
|
|
323
|
+
this.payload.all_users = false;
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
};
|
|
328
|
+
</script>
|
|
329
|
+
<style lang="scss" scoped>
|
|
330
|
+
.content-1{
|
|
331
|
+
min-height: 130px !important;
|
|
332
|
+
}
|
|
333
|
+
.send-test-modal {
|
|
334
|
+
position: fixed;
|
|
335
|
+
overflow-y: scroll;
|
|
336
|
+
overflow-x: hidden;
|
|
337
|
+
width: 60%;
|
|
338
|
+
height: 50%;
|
|
339
|
+
background-color: #ffffff;
|
|
340
|
+
z-index: 999 !important;
|
|
341
|
+
top: 20% !important;
|
|
342
|
+
left: 20% !important;
|
|
343
|
+
box-sizing: border-box;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.pointer {
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
}
|
|
349
|
+
.switch-position{
|
|
350
|
+
padding: 16px 0;
|
|
351
|
+
margin-bottom: 16px;
|
|
352
|
+
display: flex;
|
|
353
|
+
align-items: center;
|
|
354
|
+
justify-content: center;
|
|
355
|
+
}
|
|
356
|
+
/deep/ .el-switch__label{
|
|
357
|
+
/* height: 13.5px !important; */
|
|
358
|
+
&.is-active{
|
|
359
|
+
color: #5865F2 !important;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.is-loading {
|
|
364
|
+
opacity: 0.3;
|
|
365
|
+
}
|
|
366
|
+
.checkbox-user{
|
|
367
|
+
margin-left: 24px;
|
|
368
|
+
}
|
|
369
|
+
</style>
|