@burh/nuxt-core 1.1.10 → 1.1.12

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.
@@ -1,736 +1,738 @@
1
- <template>
2
- <div class="bg-white content-middle">
3
- <!-- FERRAMENTAS -->
4
- <div class="tools mt-3">
5
- <button
6
- v-for="(tool, index) in tools"
7
- :key="index"
8
- class="ml-3 burh-color"
9
- @click="
10
- isLocked && !unlockedButtons.includes(tool.event)
11
- ? $emit('open-contact')
12
- : tool.event !== 'moveTo' && $emit(tool.event)
13
- "
14
- >
15
- <template v-if="tool.event !== 'moveTo'">
16
- <diamond v-if="isLocked && tool.event !== 'share'" class="mr-1" :size="16" />
17
- {{ tool.name }}
18
- </template>
19
- <template v-else-if="tool.event === 'moveTo'">
20
- <el-dropdown trigger="click" class="dropdown__content">
21
- <span class="title__content icon">
22
- {{tool.name}}
23
- <i class="fas fa-angle-down dropdown__icon"></i>
24
- </span>
25
- <el-dropdown-menu slot="dropdown">
26
- <el-dropdown-item
27
- v-for="(tab, index) in moveToItems"
28
- :key="index"
29
- @click.native="$emit(tool.event, tab)"
30
- >
31
- <i class="fas fa-clipboard-list"></i>
32
- {{ tab.title }}
33
- </el-dropdown-item>
34
- </el-dropdown-menu>
35
- </el-dropdown>
36
- </template>
37
- </button>
38
- </div>
39
- <!-- CV -->
40
- <div class="about content-block mt-5 ml-3 mr-3" v-if="userData.user_curriculum && userData.user_curriculum.annex">
41
- <h5 class="font-weight-bold">
42
- Cadastro Simplificado
43
- <el-tooltip
44
- placement="top"
45
- >
46
- <div style="max-width: 300px" slot="content">
47
- O cadastro simplificado é uma solução criada pela Burh para facilitar a candidatura em vagas sem que seja necessário o preenchimento completo do perfil do candidato, apenas a importação do currículo.
48
- </div>
49
-
50
- <span class="text-primary ml-2">
51
- <i class="fas fa-info-circle"></i>
52
- </span>
53
- </el-tooltip>
54
-
55
- <button
56
- class="cv__box mt-2"
57
- :disabled="isCvDownloading"
58
- @click="() => !isCvDownloading && handleDownloadCv(userData.user_curriculum)"
59
- >
60
- <template v-if="!isCvDownloading">
61
- <span>
62
- <i class="fas fa-download"></i>
63
- </span>
64
-
65
- <span class="font-weight-bold">Baixar Currículo</span>
66
- </template>
67
-
68
- <template v-else>
69
- <span>
70
- <i class="fas fa-spinner spin"></i>
71
- </span>
72
-
73
- <span class="font-weight-bold">Baixando</span>
74
- </template>
75
- </button>
76
- </h5>
77
- </div>
78
- <!-- CV -->
79
- <!-- SOBRE -->
80
- <div class="about content-block mt-5 ml-3 mr-3">
81
- <h5 class="font-weight-bold">Sobre</h5>
82
- <p
83
- v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false"
84
- id="USER_ABOUT"
85
- class="mb-0"
86
- :class="
87
- !wordIsLesserThan(
88
- userData.user_complementary_information.about
89
- ) && 'readmore'
90
- "
91
- v-html="
92
- highlightText(
93
- search,
94
- userData.user_complementary_information.about
95
- )
96
- "
97
- ></p>
98
- <a
99
- href="#"
100
- aria-label="expandir conteudo"
101
- v-if="
102
- userData && userData.user_complementary_information && userData.user_complementary_information.about &&
103
- !wordIsLesserThan(
104
- userData.user_complementary_information.about
105
- ) || false
106
- "
107
- @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
108
- >Ler mais</a
109
- >
110
-
111
- <p v-if="!(userData && userData.user_complementary_information && userData.user_complementary_information.about)" class="">
112
- Nenhuma informação adicionada
113
- </p>
114
- </div>
115
- <!-- VÍDEO DE APRESENTAÇÃO -->
116
- <div
117
- v-if="
118
- userData &&
119
- userData.user_complementary_information &&
120
- userData.user_complementary_information.presentation_video"
121
- class="about content-block mt-5 ml-3 mr-3"
122
- >
123
- <h5 class="font-weight-bold">Vídeo de Apresentação</h5>
124
-
125
- <div class="mux__video">
126
- <MuxVideo
127
- :src="userData.user_complementary_information.presentation_video"
128
- />
129
- </div>
130
- </div>
131
- <!-- CONTATO -->
132
- <h5 class="font-weight-bold mt-4 ml-3">Contatos</h5>
133
- <div class="ml-3 info-text">
134
- <span v-if="userData.email != null">Email: {{userData.email}}</span><br>
135
- <span v-if="userData.user_contact && userData.user_contact.cellphone != null && userData.user_contact.cellphone.length > 1 ">Celular: {{getPhoneFormatted(userData.user_contact.cellphone)}}</span><br>
136
- <span v-if="userData.user_contact && userData.user_contact.phone != null && userData.user_contact.phone.length > 1">Telefone: {{getPhoneFormatted(userData.user_contact.phone)}}</span>
137
- </div>
138
-
139
- <!-- EDUCAÇÃO -->
140
- <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
141
- <div
142
- class=" ml-3"
143
- v-show="userData.user_education.length > 0"
144
- v-for="(edu, index) in userData.user_education"
145
- :key="index"
146
- >
147
- <p
148
- class="sub-title"
149
- v-html="highlightText(search, edu.formation)"
150
- ></p>
151
- <p class="info-text">{{ edu.institution }}</p>
152
- <span class="info-text">
153
- {{ edu.start_month }}/{{ edu.start_year }} -
154
- {{ treatEndDate(edu.end_month, edu.end_year) }}
155
- {{ getTime(false, edu) }}
156
- {{
157
- edu.user_education_period
158
- ? '-' + edu.user_education_period.name
159
- : ''
160
- }} </span
161
- ><br />
162
- <span
163
- class="info-text"
164
- >
165
- {{edu.formation_level_id | formationLevel}}
166
- </span>
167
- </div>
168
-
169
- <!-- EXPERIÊNCIAS -->
170
- <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
171
- <div
172
- class="no-info ml-3"
173
- v-show="userData.user_experience.length === 0"
174
- >
175
- <p>
176
- Nenhuma informação adicionada
177
- </p>
178
- </div>
179
- <div
180
- v-show="userData.user_experience.length > 0"
181
- class="experience ml-3 mr-3"
182
- v-for="(exp, index) in userData.user_experience"
183
- :key="`experience-${index}`"
184
- >
185
- <p
186
- class="sub-title"
187
- v-html="highlightText(search, exp.job_title)"
188
- ></p>
189
- <p
190
- class="info-text"
191
- v-html="
192
- highlightText(search, `${exp.company}, ${exp.location}`)
193
- "
194
- ></p>
195
- <span class="info-text">
196
- {{ exp.start_month }}/{{ exp.start_year }} -
197
- {{ treatEndDate(exp.end_month, exp.end_year) }}
198
- {{ getTime(true, exp) }}
199
- </span>
200
-
201
- <p
202
- :id="`USER_EXPERIENCE-${index}`"
203
- class="description mt-4 mb-0"
204
- :class="!wordIsLesserThan(exp.description) && 'readmore'"
205
- v-html="highlightText(search, exp.description)"
206
- ></p>
207
-
208
- <a
209
- href="#"
210
- aria-label="expandir conteudo"
211
- v-show="!wordIsLesserThan(exp.description)"
212
- @click.prevent.stop="
213
- toggleReadMore($event, `USER_EXPERIENCE-${index}`)
214
- "
215
- >Ler mais</a
216
- ><br /><br />
217
- </div>
218
-
219
- <!-- CURSOS -->
220
- <h5 class="font-weight-bold mt-1 ml-3">Cursos Complementares</h5>
221
- <div class="no-info ml-3" v-show="userData.user_course.length === 0">
222
- <p>
223
- Nenhuma informação adicionada
224
- </p>
225
- </div>
226
- <div
227
- v-show="userData.user_course.length > 0"
228
- class="courses ml-3"
229
- v-for="(cou, index) in userData.user_course"
230
- :key="`course-${index}`"
231
- >
232
- <p
233
- class="sub-title"
234
- v-html="highlightText(search, cou.institution)"
235
- ></p>
236
- <p
237
- class="info-text mb-3"
238
- v-html="
239
- highlightText(
240
- search,
241
- `${cou.name} - ${cou.end_year || ''} ${getTime(
242
- false,
243
- cou
244
- )}`
245
- )
246
- "
247
- />
248
- </div>
249
- </div>
250
- </template>
251
-
252
- <script>
253
- import getPrefixes from '~/util/getPrefixes.js';
254
- import { mask } from 'vue-the-mask';
255
- import { Dropdown, DropdownMenu, DropdownItem } from 'element-ui';
256
- import { parsePhoneNumber } from 'awesome-phonenumber';
257
- import MuxVideo from '../../Video/MuxVideo.vue';
258
-
259
- import swal from 'sweetalert2';
260
- import axios from 'axios';
261
-
262
- export default {
263
- name: 'user-cv-middle',
264
- directives: { mask },
265
- props: {
266
- userData: Object,
267
- tools: {
268
- type: Array,
269
- default: () => []
270
- },
271
- search: {
272
- type: String,
273
- default: ''
274
- },
275
- moveToItems: {
276
- type: Array,
277
- default: () => [
278
- {
279
- id: 1,
280
- name: 'applieds',
281
- title: 'Inscritos'
282
- },
283
- {
284
- id: 3,
285
- name: 'selecteds',
286
- title: 'Selecionados'
287
- },
288
- {
289
- id: 5,
290
- name: 'hireds',
291
- title: 'Contratados'
292
- },
293
- {
294
- id: 4,
295
- name: 'other',
296
- title: 'Reprovado'
297
- }
298
- ]
299
- }
300
- },
301
- filters: {
302
- formationLevel(id) {
303
- const typeFormation = {
304
- 1: 'Ensino Médio',
305
- 2: 'Ensino Técnico',
306
- 3: 'Graduação',
307
- 4: 'Pós-Graduação',
308
- 5: 'Mestrado',
309
- 6: 'Doutorado',
310
- 8: 'Ensino Fundamental'
311
- };
312
-
313
- return typeFormation[id] || '-';
314
- }
315
- },
316
- components: {
317
- ElDropdown: Dropdown,
318
- ElDropdownMenu: DropdownMenu,
319
- ElDropdownItem: DropdownItem,
320
- MuxVideo
321
- },
322
- data() {
323
- return {
324
- isLocked: !this.companyHasProduct(
325
- this.$store.state.loja && this.$store.state.loja.showableProducts && this.$store.state.loja.showableProducts['INTERACAO_USUARIO'] || false
326
- ),
327
- unlockedButtons: ['share', 'moveTo'],
328
- isCvDownloading: false
329
- };
330
- },
331
- mounted() {
332
- this.userData.user_experience = this.filterByDate(
333
- this.userData.user_experience,
334
- 'old'
335
- );
336
- this.userData.user_education = this.filterByDate(
337
- this.userData.user_education,
338
- 'old'
339
- );
340
- this.userData.user_course = this.filterByDate(
341
- this.userData.user_course,
342
- 'old'
343
- );
344
- },
345
- watch: {
346
- userData() {
347
- this.userData.user_experience = this.filterByDate(
348
- this.userData.user_experience,
349
- 'old'
350
- );
351
- this.userData.user_education = this.filterByDate(
352
- this.userData.user_education,
353
- 'old'
354
- );
355
- this.userData.user_course = this.filterByDate(
356
- this.userData.user_course,
357
- 'old'
358
- );
359
- }
360
- },
361
- methods: {
362
- showMessage(message, type = 'success') {
363
- const Toast = swal.mixin({
364
- toast: true,
365
- position: 'top-end',
366
- showConfirmButton: false,
367
- timer: 3000,
368
- });
369
-
370
- return Toast.fire({
371
- type: type,
372
- title: message,
373
- });
374
- },
375
- async handleDownloadCv(data) {
376
- this.isCvDownloading = true;
377
-
378
- const response = await axios.get(data.annex, {
379
- responseType: 'blob'
380
- })
381
- .then(res => URL.createObjectURL(res.data))
382
- .catch(err => {
383
- return {
384
- error: true,
385
- message: (err && err.response && err.response.data && err.response.data.message) || 'Falha ao baixar arquivo'
386
- };
387
- });
388
-
389
- this.isCvDownloading = false;
390
-
391
- if (response.error) {
392
- this.showMessage(response.message, 'error');
393
- return;
394
- }
395
-
396
- const link = document.createElement('a');
397
- link.href = response;
398
- link.download = `${data.user_id}.pdf`;
399
- link.click();
400
- },
401
- getPhoneFormatted(phoneNumber) {
402
- const formattedPhoneNumber = parsePhoneNumber(phoneNumber, { regionCode: 'BR' });
403
-
404
- return (
405
- formattedPhoneNumber &&
406
- formattedPhoneNumber.number &&
407
- formattedPhoneNumber.number.national
408
- ) || phoneNumber;
409
- },
410
- highlightText(search, text) {
411
- if (search.length < 2) return text;
412
-
413
- const regex = new RegExp(search.toLowerCase(), 'gmi');
414
- return String(text || '').replace(
415
- regex,
416
- `<span class="search-highlight">${search}</span>`
417
- );
418
- },
419
- filterByDate(data, by = 'new') {
420
- let sortedArray = data.sort((a, b) => {
421
- a = [
422
- a.start_month,
423
- a.start_year,
424
- a.end_month || 12,
425
- a.end_year || 9999
426
- ];
427
-
428
- b = [
429
- b.start_month,
430
- b.start_year,
431
- b.end_month || 12,
432
- b.end_year || 9999
433
- ];
434
-
435
- // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
436
- // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
437
-
438
- let byStart;
439
- let byEnd;
440
-
441
- switch (by) {
442
- case 'old':
443
- byStart =
444
- new Date(a[1], a[0], 1).getTime() -
445
- new Date(b[1], b[0], 1).getTime();
446
- byEnd =
447
- new Date(b[3], b[2], 1).getTime() -
448
- new Date(a[3], a[2], 1).getTime();
449
- break;
450
-
451
- default:
452
- byStart =
453
- new Date(b[1], b[0], 1).getTime() -
454
- new Date(a[1], a[0], 1).getTime();
455
- byEnd =
456
- new Date(b[3], b[2], 1).getTime() -
457
- new Date(a[3], a[2], 1).getTime();
458
- break;
459
- }
460
-
461
- return byEnd - byStart;
462
- });
463
-
464
- return sortedArray;
465
- },
466
- toggleReadMore(event, id) {
467
- const element = document.getElementById(id);
468
- element.classList.toggle('readmore');
469
- event.target.innerText == 'Ler mais'
470
- ? (event.target.innerText = 'Esconder')
471
- : (event.target.innerText = 'Ler mais');
472
- },
473
- getTime(
474
- isExperience,
475
- { start_year = null, end_year = null, start_month, end_month },
476
- textHappening = 'Cursando'
477
- ) {
478
- const isHappening = !end_month && !end_year;
479
-
480
- if (isHappening) {
481
- return isExperience === true ? 'Atualmente' : textHappening;
482
- }
483
-
484
- const dateInitial = this.$moment(
485
- ['1', start_month.toString(), start_year.toString()],
486
- 'DD/MM/YYYY'
487
- );
488
- const dateDone = this.$moment(
489
- ['1', end_month.toString(), end_year.toString()],
490
- 'DD/MM/YYYY'
491
- );
492
- const diffDuration = this.$moment.duration(
493
- dateDone.diff(dateInitial)
494
- );
495
- const years = diffDuration.years();
496
- const months = diffDuration.months();
497
-
498
- if (years) {
499
- return years > 1 ? `(${years} anos)` : `(${years} ano)`;
500
- }
501
-
502
- return months > 1
503
- ? `(${months} meses)`
504
- : months == 1
505
- ? `(${months} mês)`
506
- : '';
507
- },
508
- languageLevel(level) {
509
- switch (parseInt(level)) {
510
- case 1:
511
- return 'Iniciante';
512
- case 2:
513
- return 'Elementar';
514
- case 3:
515
- return 'Pré-intermediário';
516
- case 4:
517
- return 'Intermediário';
518
- case 5:
519
- return 'Intermediário Superior';
520
- case 6:
521
- return 'Avançado';
522
- case 7:
523
- return 'Fluente';
524
- default:
525
- return '';
526
- }
527
- },
528
- treatPhone(phone) {
529
- if (phone) {
530
- if (phone == '0' || phone.length < 9 || !phone) {
531
- return 'não cadastrado';
532
- }
533
- }
534
-
535
- return phone;
536
- },
537
- treatCellphone(cellphone) {
538
- if (cellphone) {
539
- if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
540
- return 'não cadastrado';
541
- }
542
- }
543
-
544
- return cellphone;
545
- },
546
- handleGetPrefixes(name = '') {
547
- return getPrefixes(name);
548
- },
549
- treatEndDate(end_month, end_year) {
550
- if (end_month && end_year) {
551
- return `${end_month}/${end_year}`;
552
- }
553
- return '';
554
- },
555
- wordIsLesserThan(word, value = 300) {
556
- return word && word.length < value;
557
- }
558
- }
559
- };
560
- </script>
561
-
562
- <style lang="scss" scoped>
563
- @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
564
-
565
- .mux__video {
566
- width: 100%;
567
- margin-top: 16px;
568
-
569
- video {
570
- width: 100% !important;
571
- border-radius: 8px !important;
572
- display: block !important;
573
- }
574
- }
575
-
576
- .cv__box {
577
- cursor: pointer;
578
- margin: 0;
579
- border: 0;
580
- width: 100%;
581
- display: flex;
582
- align-items: center;
583
- justify-content: center;
584
- gap: 1rem;
585
- background: rgba(#5865f2, 0.2);
586
- color: #5865F2;
587
- font-size: 1rem;
588
- padding: 1.25rem 1rem;
589
- border-radius: 0.25rem;
590
- transition: background-color 0.25s, color 0.25s;
591
-
592
- &:hover:not(:disabled) {
593
- background: rgba(#5865f2, 0.3);
594
- }
595
-
596
- &:disabled {
597
- cursor: not-allowed !important;
598
- background: #f5f5f5;
599
- color: #c8c8c8;
600
- }
601
-
602
- @keyframes spinner {
603
- from {
604
- transform: rotate(0);
605
- }
606
- to {
607
- transform: rotate(360deg);
608
- }
609
- }
610
-
611
- .spin {
612
- animation: spinner 0.75s infinite linear;
613
- }
614
- }
615
-
616
- /deep/ .dropdown__content {
617
- &, .title__content {
618
- width: 100%;
619
- height: 100%;
620
- display: grid;
621
- place-items: center;
622
- }
623
- .title__content.icon {
624
- grid-template-columns: 1fr 10px;
625
- flex-direction: row;
626
- align-items: center;
627
- justify-content: space-between;
628
- color: #fff;
629
- font-weight: 600;
630
- font-size: 12px;
631
- margin: 0!important;
632
- i {
633
- font-size: 1rem;
634
- margin-left: 10px;
635
- }
636
- }
637
- }
638
-
639
- /deep/ .search-highlight {
640
- background: rgb(255, 252, 61);
641
- color: #000;
642
- }
643
-
644
- .content-middle {
645
- width: 50%;
646
- border-right: 1px solid #ececec5c;
647
- word-break: break-word !important;
648
- }
649
-
650
- .readmore {
651
- overflow: hidden;
652
- text-overflow: ellipsis;
653
- display: -webkit-box;
654
- -webkit-line-clamp: 3;
655
- -webkit-box-orient: vertical;
656
- }
657
-
658
- .tools {
659
- flex-wrap: wrap;
660
- display: grid;
661
- align-items: center;
662
- justify-content: space-between;
663
- grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
664
- gap: 10px;
665
- padding-right: 20px;
666
- button {
667
- display: flex;
668
- align-items: center;
669
- justify-content: center;
670
-
671
- margin-left: 0!important;
672
-
673
- height: 29px;
674
- border: none;
675
-
676
- background: #5865F2;
677
- border-radius: 16px;
678
- color: #fff;
679
-
680
- font-size: 0.75rem;
681
- font-weight: 600;
682
- outline: 0;
683
-
684
- padding: 0px 10px;
685
- .dropdown__icon {
686
- margin-right: 20px;
687
- }
688
- }
689
- }
690
-
691
- .education {
692
- margin-top: 15px;
693
- }
694
-
695
- .experience {
696
- .description {
697
- font-size: 14px;
698
- color: #62778c;
699
- }
700
-
701
- a {
702
- margin-bottom: 1px;
703
- }
704
- }
705
-
706
- .sub-title {
707
- margin-bottom: 1px;
708
-
709
- font-weight: 600;
710
- font-size: 14px;
711
- line-height: 21px;
712
- color: #62778c;
713
- text-transform: uppercase;
714
- }
715
-
716
- .info-text {
717
- margin-bottom: 1px;
718
-
719
- font-size: 14px;
720
- color: #8da2b5;
721
- }
722
-
723
- .content-block {
724
- p {
725
- font-size: 14px;
726
- color: #62778c;
727
- }
728
- }
729
-
730
- .no-info {
731
- p {
732
- font-size: 0.875rem;
733
- color: #62778c;
734
- }
735
- }
736
- </style>
1
+ <template>
2
+ <div class="bg-white content-middle">
3
+ <!-- FERRAMENTAS -->
4
+ <div class="tools mt-3">
5
+ <button
6
+ v-for="(tool, index) in tools"
7
+ :key="index"
8
+ class="ml-3 burh-color"
9
+ @click="
10
+ isLocked && !unlockedButtons.includes(tool.event)
11
+ ? $emit('open-contact')
12
+ : tool.event !== 'moveTo' && $emit(tool.event)
13
+ "
14
+ >
15
+ <template v-if="tool.event !== 'moveTo'">
16
+ <diamond v-if="isLocked && tool.event !== 'share'" class="mr-1" :size="16" />
17
+ {{ tool.name }}
18
+ </template>
19
+ <template v-else-if="tool.event === 'moveTo'">
20
+ <el-dropdown trigger="click" class="dropdown__content">
21
+ <span class="title__content icon">
22
+ {{tool.name}}
23
+ <i class="fas fa-angle-down dropdown__icon"></i>
24
+ </span>
25
+ <el-dropdown-menu slot="dropdown">
26
+ <el-dropdown-item
27
+ v-for="(tab, index) in moveToItems"
28
+ :key="index"
29
+ @click.native="$emit(tool.event, tab)"
30
+ >
31
+ <i class="fas fa-clipboard-list"></i>
32
+ {{ tab.title }}
33
+ </el-dropdown-item>
34
+ </el-dropdown-menu>
35
+ </el-dropdown>
36
+ </template>
37
+ </button>
38
+ </div>
39
+ <!-- CV -->
40
+ <div class="about content-block mt-5 ml-3 mr-3" v-if="userData.user_curriculum && userData.user_curriculum.annex">
41
+ <h5 class="font-weight-bold">
42
+ Cadastro Simplificado
43
+ <el-tooltip
44
+ placement="top"
45
+ >
46
+ <div style="max-width: 300px" slot="content">
47
+ O cadastro simplificado é uma solução criada pela Burh para facilitar a candidatura em vagas sem que seja necessário o preenchimento completo do perfil do candidato, apenas a importação do currículo.
48
+ </div>
49
+
50
+ <span class="text-primary ml-2">
51
+ <i class="fas fa-info-circle"></i>
52
+ </span>
53
+ </el-tooltip>
54
+
55
+ <button
56
+ class="cv__box mt-2"
57
+ :disabled="isCvDownloading"
58
+ @click="() => !isCvDownloading && handleDownloadCv(userData.user_curriculum)"
59
+ >
60
+ <template v-if="!isCvDownloading">
61
+ <span>
62
+ <i class="fas fa-download"></i>
63
+ </span>
64
+
65
+ <span class="font-weight-bold">Baixar Currículo</span>
66
+ </template>
67
+
68
+ <template v-else>
69
+ <span>
70
+ <i class="fas fa-spinner spin"></i>
71
+ </span>
72
+
73
+ <span class="font-weight-bold">Baixando</span>
74
+ </template>
75
+ </button>
76
+ </h5>
77
+ </div>
78
+ <!-- CV -->
79
+ <!-- SOBRE -->
80
+ <div class="about content-block mt-5 ml-3 mr-3">
81
+ <h5 class="font-weight-bold">Sobre</h5>
82
+ <p
83
+ v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false"
84
+ id="USER_ABOUT"
85
+ class="mb-0"
86
+ :class="
87
+ !wordIsLesserThan(
88
+ userData.user_complementary_information.about
89
+ ) && 'readmore'
90
+ "
91
+ v-html="
92
+ highlightText(
93
+ search,
94
+ userData.user_complementary_information.about
95
+ )
96
+ "
97
+ ></p>
98
+ <a
99
+ href="#"
100
+ aria-label="expandir conteudo"
101
+ v-if="
102
+ userData && userData.user_complementary_information && userData.user_complementary_information.about &&
103
+ !wordIsLesserThan(
104
+ userData.user_complementary_information.about
105
+ ) || false
106
+ "
107
+ @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
108
+ >Ler mais</a
109
+ >
110
+
111
+ <p v-if="!(userData && userData.user_complementary_information && userData.user_complementary_information.about)" class="">
112
+ Nenhuma informação adicionada
113
+ </p>
114
+ </div>
115
+ <!-- VÍDEO DE APRESENTAÇÃO -->
116
+ <div
117
+ v-if="
118
+ userData &&
119
+ userData.user_complementary_information &&
120
+ userData.user_complementary_information.presentation_video"
121
+ class="about content-block mt-5 ml-3 mr-3"
122
+ >
123
+ <h5 class="font-weight-bold">Vídeo de Apresentação</h5>
124
+
125
+ <div class="mux__video">
126
+ <MuxVideo
127
+ :src="userData.user_complementary_information.presentation_video"
128
+ />
129
+ </div>
130
+ </div>
131
+ <!-- CONTATO -->
132
+ <h5 class="font-weight-bold mt-4 ml-3">Contatos</h5>
133
+ <div class="ml-3 info-text">
134
+ <span v-if="userData.email != null">Email: {{userData.email}}</span><br>
135
+ <span v-if="userData.user_contact && userData.user_contact.cellphone != null && userData.user_contact.cellphone.length > 1 ">Celular: {{getPhoneFormatted(userData.user_contact.cellphone)}}</span><br>
136
+ <span v-if="userData.user_contact && userData.user_contact.phone != null && userData.user_contact.phone.length > 1">Telefone: {{getPhoneFormatted(userData.user_contact.phone)}}</span>
137
+ </div>
138
+
139
+ <!-- EDUCAÇÃO -->
140
+ <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
141
+ <div
142
+ class=" ml-3"
143
+ v-show="userData.user_education.length > 0"
144
+ v-for="(edu, index) in userData.user_education"
145
+ :key="index"
146
+ >
147
+ <p
148
+ class="sub-title"
149
+ v-html="highlightText(search, edu.formation)"
150
+ ></p>
151
+ <p class="info-text">{{ edu.institution }}</p>
152
+ <span class="info-text">
153
+ {{ edu.start_month }}/{{ edu.start_year }} -
154
+ {{ treatEndDate(edu.end_month, edu.end_year) }}
155
+ {{ getTime(false, edu) }}
156
+ {{
157
+ edu.user_education_period
158
+ ? '-' + edu.user_education_period.name
159
+ : ''
160
+ }} </span
161
+ ><br />
162
+ <span
163
+ class="info-text"
164
+ >
165
+ {{edu.formation_level_id | formationLevel}}
166
+ </span>
167
+ </div>
168
+
169
+ <!-- EXPERIÊNCIAS -->
170
+ <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
171
+ <div
172
+ class="no-info ml-3"
173
+ v-show="userData.user_experience.length === 0"
174
+ >
175
+ <p>
176
+ Nenhuma informação adicionada
177
+ </p>
178
+ </div>
179
+ <div
180
+ v-show="userData.user_experience.length > 0"
181
+ class="experience ml-3 mr-3"
182
+ v-for="(exp, index) in userData.user_experience"
183
+ :key="`experience-${index}`"
184
+ >
185
+ <p
186
+ class="sub-title"
187
+ v-html="highlightText(search, exp.job_title)"
188
+ ></p>
189
+ <p
190
+ class="info-text"
191
+ v-html="
192
+ highlightText(search, `${exp.company}, ${exp.location}`)
193
+ "
194
+ ></p>
195
+ <span class="info-text">
196
+ {{ exp.start_month }}/{{ exp.start_year }} -
197
+ {{ treatEndDate(exp.end_month, exp.end_year) }}
198
+ {{ getTime(true, exp) }}
199
+ </span>
200
+
201
+ <p
202
+ :id="`USER_EXPERIENCE-${index}`"
203
+ class="description mt-4 mb-0"
204
+ :class="!wordIsLesserThan(exp.description) && 'readmore'"
205
+ v-html="highlightText(search, exp.description)"
206
+ ></p>
207
+
208
+ <a
209
+ href="#"
210
+ aria-label="expandir conteudo"
211
+ v-show="!wordIsLesserThan(exp.description)"
212
+ @click.prevent.stop="
213
+ toggleReadMore($event, `USER_EXPERIENCE-${index}`)
214
+ "
215
+ >Ler mais</a
216
+ ><br /><br />
217
+ </div>
218
+
219
+ <!-- CURSOS -->
220
+ <h5 class="font-weight-bold mt-1 ml-3">Cursos Complementares</h5>
221
+ <div class="no-info ml-3" v-show="userData.user_course.length === 0">
222
+ <p>
223
+ Nenhuma informação adicionada
224
+ </p>
225
+ </div>
226
+ <div
227
+ v-show="userData.user_course.length > 0"
228
+ class="courses ml-3"
229
+ v-for="(cou, index) in userData.user_course"
230
+ :key="`course-${index}`"
231
+ >
232
+ <p
233
+ class="sub-title"
234
+ v-html="highlightText(search, cou.institution)"
235
+ ></p>
236
+ <p
237
+ class="info-text mb-3"
238
+ v-html="
239
+ highlightText(
240
+ search,
241
+ `${cou.name} - ${cou.end_year || ''} ${getTime(
242
+ false,
243
+ cou
244
+ )}`
245
+ )
246
+ "
247
+ />
248
+ </div>
249
+ </div>
250
+ </template>
251
+
252
+ <script>
253
+ import getPrefixes from '~/util/getPrefixes.js';
254
+ import { mask } from 'vue-the-mask';
255
+ import { Dropdown, DropdownMenu, DropdownItem } from 'element-ui';
256
+ import { parsePhoneNumber } from 'awesome-phonenumber';
257
+ import MuxVideo from '../../Video/MuxVideo.vue';
258
+
259
+ import swal from 'sweetalert2';
260
+ import axios from 'axios';
261
+
262
+ export default {
263
+ name: 'user-cv-middle',
264
+ directives: { mask },
265
+ props: {
266
+ userData: Object,
267
+ tools: {
268
+ type: Array,
269
+ default: () => []
270
+ },
271
+ search: {
272
+ type: String,
273
+ default: ''
274
+ },
275
+ moveToItems: {
276
+ type: Array,
277
+ default: () => [
278
+ {
279
+ id: 1,
280
+ name: 'applieds',
281
+ title: 'Inscritos'
282
+ },
283
+ {
284
+ id: 3,
285
+ name: 'selecteds',
286
+ title: 'Selecionados'
287
+ },
288
+ {
289
+ id: 5,
290
+ name: 'hireds',
291
+ title: 'Contratados'
292
+ },
293
+ {
294
+ id: 4,
295
+ name: 'other',
296
+ title: 'Reprovado'
297
+ }
298
+ ]
299
+ }
300
+ },
301
+ filters: {
302
+ formationLevel(id) {
303
+ const typeFormation = {
304
+ 1: 'Ensino Médio',
305
+ 2: 'Ensino Técnico',
306
+ 3: 'Graduação',
307
+ 4: 'Pós-Graduação',
308
+ 5: 'Mestrado',
309
+ 6: 'Doutorado',
310
+ 8: 'Ensino Fundamental'
311
+ };
312
+
313
+ return typeFormation[id] || '-';
314
+ }
315
+ },
316
+ components: {
317
+ ElDropdown: Dropdown,
318
+ ElDropdownMenu: DropdownMenu,
319
+ ElDropdownItem: DropdownItem,
320
+ MuxVideo
321
+ },
322
+ data() {
323
+ return {
324
+ isLocked: !this.companyHasProduct(
325
+ this.$store.state.loja && this.$store.state.loja.showableProducts && this.$store.state.loja.showableProducts['INTERACAO_USUARIO'] || false
326
+ ),
327
+ unlockedButtons: ['share', 'moveTo'],
328
+ isCvDownloading: false
329
+ };
330
+ },
331
+ mounted() {
332
+ this.userData.user_experience = this.filterByDate(
333
+ this.userData.user_experience,
334
+ 'old'
335
+ );
336
+ this.userData.user_education = this.filterByDate(
337
+ this.userData.user_education,
338
+ 'old'
339
+ );
340
+ this.userData.user_course = this.filterByDate(
341
+ this.userData.user_course,
342
+ 'old'
343
+ );
344
+ },
345
+ watch: {
346
+ userData() {
347
+ this.userData.user_experience = this.filterByDate(
348
+ this.userData.user_experience,
349
+ 'old'
350
+ );
351
+ this.userData.user_education = this.filterByDate(
352
+ this.userData.user_education,
353
+ 'old'
354
+ );
355
+ this.userData.user_course = this.filterByDate(
356
+ this.userData.user_course,
357
+ 'old'
358
+ );
359
+ }
360
+ },
361
+ methods: {
362
+ showMessage(message, type = 'success') {
363
+ const Toast = swal.mixin({
364
+ toast: true,
365
+ position: 'top-end',
366
+ showConfirmButton: false,
367
+ timer: 3000,
368
+ });
369
+
370
+ return Toast.fire({
371
+ type: type,
372
+ title: message,
373
+ });
374
+ },
375
+ async handleDownloadCv(data) {
376
+ this.isCvDownloading = true;
377
+
378
+ const response = await axios.get(data.annex, {
379
+ responseType: 'blob'
380
+ })
381
+ .then(res => URL.createObjectURL(res.data))
382
+ .catch(err => {
383
+ return {
384
+ error: true,
385
+ message: (err && err.response && err.response.data && err.response.data.message) || 'Falha ao baixar arquivo'
386
+ };
387
+ });
388
+
389
+ this.isCvDownloading = false;
390
+
391
+ if (response.error) {
392
+ this.showMessage(response.message, 'error');
393
+ return;
394
+ }
395
+
396
+ const link = document.createElement('a');
397
+ link.href = response;
398
+ link.download = `${data.user_id}.pdf`;
399
+ link.click();
400
+ },
401
+ getPhoneFormatted(phoneNumber) {
402
+ const formattedPhoneNumber = parsePhoneNumber(phoneNumber, { regionCode: 'BR' });
403
+
404
+ return (
405
+ formattedPhoneNumber &&
406
+ formattedPhoneNumber.number &&
407
+ formattedPhoneNumber.number.national
408
+ ) || phoneNumber;
409
+ },
410
+ highlightText(search, text) {
411
+ if (search.length < 2) return text;
412
+
413
+ const regex = new RegExp(search.toLowerCase(), 'gmi');
414
+ return String(text || '').replace(
415
+ regex,
416
+ `<span class="search-highlight">${search}</span>`
417
+ );
418
+ },
419
+ filterByDate(data, by = 'new') {
420
+ let sortedArray = data.sort((a, b) => {
421
+ a = [
422
+ a.start_month,
423
+ a.start_year,
424
+ a.end_month || 12,
425
+ a.end_year || 9999
426
+ ];
427
+
428
+ b = [
429
+ b.start_month,
430
+ b.start_year,
431
+ b.end_month || 12,
432
+ b.end_year || 9999
433
+ ];
434
+
435
+ // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
436
+ // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
437
+
438
+ let byStart;
439
+ let byEnd;
440
+
441
+ switch (by) {
442
+ case 'old':
443
+ byStart =
444
+ new Date(a[1], a[0], 1).getTime() -
445
+ new Date(b[1], b[0], 1).getTime();
446
+ byEnd =
447
+ new Date(b[3], b[2], 1).getTime() -
448
+ new Date(a[3], a[2], 1).getTime();
449
+ break;
450
+
451
+ default:
452
+ byStart =
453
+ new Date(b[1], b[0], 1).getTime() -
454
+ new Date(a[1], a[0], 1).getTime();
455
+ byEnd =
456
+ new Date(b[3], b[2], 1).getTime() -
457
+ new Date(a[3], a[2], 1).getTime();
458
+ break;
459
+ }
460
+
461
+ return byEnd - byStart;
462
+ });
463
+
464
+ return sortedArray;
465
+ },
466
+ toggleReadMore(event, id) {
467
+ const element = document.getElementById(id);
468
+ element.classList.toggle('readmore');
469
+ event.target.innerText == 'Ler mais'
470
+ ? (event.target.innerText = 'Esconder')
471
+ : (event.target.innerText = 'Ler mais');
472
+ },
473
+ getTime(
474
+ isExperience,
475
+ { start_year = null, end_year = null, start_month, end_month },
476
+ textHappening = 'Cursando'
477
+ ) {
478
+ const isHappening = !end_month && !end_year;
479
+
480
+ if (isHappening) {
481
+ return isExperience === true ? 'Atualmente' : textHappening;
482
+ }
483
+
484
+ const dateInitial = this.$moment(
485
+ ['1', start_month.toString(), start_year.toString()],
486
+ 'DD/MM/YYYY'
487
+ );
488
+ const dateDone = this.$moment(
489
+ ['1', end_month.toString(), end_year.toString()],
490
+ 'DD/MM/YYYY'
491
+ );
492
+ const diffDuration = this.$moment.duration(
493
+ dateDone.diff(dateInitial)
494
+ );
495
+ const years = diffDuration.years();
496
+ const months = diffDuration.months();
497
+
498
+ if (years) {
499
+ return years > 1 ? `(${years} anos)` : `(${years} ano)`;
500
+ }
501
+
502
+ return months > 1
503
+ ? `(${months} meses)`
504
+ : months == 1
505
+ ? `(${months} mês)`
506
+ : '';
507
+ },
508
+ languageLevel(level) {
509
+ switch (parseInt(level)) {
510
+ case 1:
511
+ return 'Iniciante';
512
+ case 2:
513
+ return 'Elementar';
514
+ case 3:
515
+ return 'Pré-intermediário';
516
+ case 4:
517
+ return 'Intermediário';
518
+ case 5:
519
+ return 'Intermediário Superior';
520
+ case 6:
521
+ return 'Avançado';
522
+ case 7:
523
+ return 'Fluente';
524
+ default:
525
+ return '';
526
+ }
527
+ },
528
+ treatPhone(phone) {
529
+ if (phone) {
530
+ if (phone == '0' || phone.length < 9 || !phone) {
531
+ return 'não cadastrado';
532
+ }
533
+ }
534
+
535
+ return phone;
536
+ },
537
+ treatCellphone(cellphone) {
538
+ if (cellphone) {
539
+ if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
540
+ return 'não cadastrado';
541
+ }
542
+ }
543
+
544
+ return cellphone;
545
+ },
546
+ handleGetPrefixes(name = '') {
547
+ return getPrefixes(name);
548
+ },
549
+ treatEndDate(end_month, end_year) {
550
+ if (end_month && end_year) {
551
+ return `${end_month}/${end_year}`;
552
+ }
553
+ return '';
554
+ },
555
+ wordIsLesserThan(word, value = 300) {
556
+ return word && word.length < value;
557
+ }
558
+ }
559
+ };
560
+ </script>
561
+
562
+ <style lang="scss" scoped>
563
+ @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
564
+
565
+ .mux__video {
566
+ width: 100%;
567
+ margin-top: 16px;
568
+
569
+ video {
570
+ width: 100% !important;
571
+ max-height: 400px !important;
572
+ border-radius: 8px !important;
573
+ display: block !important;
574
+ background: #212529 !important;
575
+ }
576
+ }
577
+
578
+ .cv__box {
579
+ cursor: pointer;
580
+ margin: 0;
581
+ border: 0;
582
+ width: 100%;
583
+ display: flex;
584
+ align-items: center;
585
+ justify-content: center;
586
+ gap: 1rem;
587
+ background: rgba(#5865f2, 0.2);
588
+ color: #5865F2;
589
+ font-size: 1rem;
590
+ padding: 1.25rem 1rem;
591
+ border-radius: 0.25rem;
592
+ transition: background-color 0.25s, color 0.25s;
593
+
594
+ &:hover:not(:disabled) {
595
+ background: rgba(#5865f2, 0.3);
596
+ }
597
+
598
+ &:disabled {
599
+ cursor: not-allowed !important;
600
+ background: #f5f5f5;
601
+ color: #c8c8c8;
602
+ }
603
+
604
+ @keyframes spinner {
605
+ from {
606
+ transform: rotate(0);
607
+ }
608
+ to {
609
+ transform: rotate(360deg);
610
+ }
611
+ }
612
+
613
+ .spin {
614
+ animation: spinner 0.75s infinite linear;
615
+ }
616
+ }
617
+
618
+ /deep/ .dropdown__content {
619
+ &, .title__content {
620
+ width: 100%;
621
+ height: 100%;
622
+ display: grid;
623
+ place-items: center;
624
+ }
625
+ .title__content.icon {
626
+ grid-template-columns: 1fr 10px;
627
+ flex-direction: row;
628
+ align-items: center;
629
+ justify-content: space-between;
630
+ color: #fff;
631
+ font-weight: 600;
632
+ font-size: 12px;
633
+ margin: 0!important;
634
+ i {
635
+ font-size: 1rem;
636
+ margin-left: 10px;
637
+ }
638
+ }
639
+ }
640
+
641
+ /deep/ .search-highlight {
642
+ background: rgb(255, 252, 61);
643
+ color: #000;
644
+ }
645
+
646
+ .content-middle {
647
+ width: 50%;
648
+ border-right: 1px solid #ececec5c;
649
+ word-break: break-word !important;
650
+ }
651
+
652
+ .readmore {
653
+ overflow: hidden;
654
+ text-overflow: ellipsis;
655
+ display: -webkit-box;
656
+ -webkit-line-clamp: 3;
657
+ -webkit-box-orient: vertical;
658
+ }
659
+
660
+ .tools {
661
+ flex-wrap: wrap;
662
+ display: grid;
663
+ align-items: center;
664
+ justify-content: space-between;
665
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
666
+ gap: 10px;
667
+ padding-right: 20px;
668
+ button {
669
+ display: flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+
673
+ margin-left: 0!important;
674
+
675
+ height: 29px;
676
+ border: none;
677
+
678
+ background: #5865F2;
679
+ border-radius: 16px;
680
+ color: #fff;
681
+
682
+ font-size: 0.75rem;
683
+ font-weight: 600;
684
+ outline: 0;
685
+
686
+ padding: 0px 10px;
687
+ .dropdown__icon {
688
+ margin-right: 20px;
689
+ }
690
+ }
691
+ }
692
+
693
+ .education {
694
+ margin-top: 15px;
695
+ }
696
+
697
+ .experience {
698
+ .description {
699
+ font-size: 14px;
700
+ color: #62778c;
701
+ }
702
+
703
+ a {
704
+ margin-bottom: 1px;
705
+ }
706
+ }
707
+
708
+ .sub-title {
709
+ margin-bottom: 1px;
710
+
711
+ font-weight: 600;
712
+ font-size: 14px;
713
+ line-height: 21px;
714
+ color: #62778c;
715
+ text-transform: uppercase;
716
+ }
717
+
718
+ .info-text {
719
+ margin-bottom: 1px;
720
+
721
+ font-size: 14px;
722
+ color: #8da2b5;
723
+ }
724
+
725
+ .content-block {
726
+ p {
727
+ font-size: 14px;
728
+ color: #62778c;
729
+ }
730
+ }
731
+
732
+ .no-info {
733
+ p {
734
+ font-size: 0.875rem;
735
+ color: #62778c;
736
+ }
737
+ }
738
+ </style>