@burh/nuxt-core 1.0.349 → 1.0.351

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,625 +1,625 @@
1
- <template>
2
- <div class="bg-white content-right tabs ">
3
- <el-tabs
4
- :class="active"
5
- class="mt-3 handle-icon-color"
6
- v-model="active"
7
- >
8
- <el-tab-pane class="history ml-2" name="history">
9
- <span class="tab__icon-pane" slot="label">
10
- <img
11
- class="img__icon-pane img__icon--history"
12
- src="../../../../assets/images/icons/historicCv.svg"
13
- />
14
- </span>
15
- <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
16
- <p class="notes-title mb-0">Histórico com sua empresa</p>
17
- <div class="line mb-3"></div>
18
-
19
- <div
20
- class="mt-3"
21
- v-for="(item, index) in orderByDate(companyHistory())"
22
- :key="index"
23
- >
24
- <p class="history-text mb-0">
25
- {{ item.text }}
26
- </p>
27
- <span>{{ item.date | convertDate }}</span>
28
- </div>
29
- <p v-show="companyHistory().length === 0" class="history-text">
30
- Histórico vazio.
31
- </p>
32
- </el-tab-pane>
33
-
34
- <el-tab-pane name="notes" class="ml-2" v-if="isNotesActived">
35
- <span class="tab__icon-pane" slot="label">
36
- <img
37
- class="img__icon-pane img__icon--notes"
38
- src="../../../../assets/images/icons/notesCv.svg"
39
- />
40
- </span>
41
- <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
42
- <p class="notes-title mb-0">Notas da equipe</p>
43
- <div class="line mb-3"></div>
44
- <div
45
- v-show="notes.length > 0"
46
- v-for="(note, index) in notes.slice(0, 5)"
47
- :key="index"
48
- >
49
- <div class="notes-baloon">
50
- <div class="notes-text ml-3 pt-1">
51
- <p class="mt-3">{{ note.text }}</p>
52
- </div>
53
- <div
54
- class="d-flex justify-content-end align-items-center mr-3"
55
- >
56
- <p class="notes-date">
57
- {{ note.created_at | convertDate }}
58
- </p>
59
- </div>
60
- </div>
61
- <div class="notes-owner d-flex mt-2">
62
- <img
63
- v-show="note.user.urlAvatar"
64
- :src="note.user.urlAvatar"
65
- :alt="note.user.name"
66
- />
67
- <div
68
- v-show="!note.user.urlAvatar"
69
- class="notes-avatar"
70
- ></div>
71
- <p class="ml-1">
72
- {{ note.user.name }}
73
- </p>
74
- </div>
75
- </div>
76
- <div class="notes-text" v-show="notes.length === 0">
77
- <p>Nenhuma nota criada.</p>
78
- </div>
79
-
80
- <div class="input-container" v-show="!isLocked">
81
- <input
82
- class="notes-new pl-4 mt-3 mb-3 form-rounded"
83
- type="text"
84
- placeholder="Escrever anotação"
85
- v-model="newNote"
86
- @change="$emit('new-note', newNote, userData.id)"
87
- v-on:change="cleatInput()"
88
- />
89
- <i
90
- @click="
91
- newNote.length > 0 &&
92
- $emit('new-note', newNote, userData.id)
93
- "
94
- class="fas fa-paper-plane input-icon"
95
- ></i>
96
- </div>
97
- </el-tab-pane>
98
-
99
- <el-tab-pane name="documents" class="ml-2">
100
- <span class="tab__icon-pane" slot="label">
101
- <img
102
- class="img__icon-pane img__icon--documents"
103
- src="../../../../assets/images/icons/icon3.svg"
104
- />
105
- </span>
106
- <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
107
- <p class="notes-title mb-0">Documentos anexados</p>
108
- <div class="line mb-3"></div>
109
-
110
- <div class="archive-content">
111
- <div v-for="(item, index) in archives" :key="index">
112
- <div @click="openArchive(item)" class="archive-container">
113
- <div>
114
- <img class="archive-img" src="../../../../assets/images/icons/icon3.svg" >
115
- </div>
116
- <div class="archive-name">
117
- <p>
118
- <span>{{item.name}}</span>
119
- <div class="archive-icon">
120
- <i @click.stop.prevent="openRemoveSection(item, (index+1))" class="far fa-trash-alt"></i>
121
- </div>
122
- </p>
123
- </div>
124
- </div>
125
- <div v-if="hasRemove && hasRemove == (index+1)" class="archive-remove">
126
- <p>Você tem certeza que deseja apagar este arquivo?</p>
127
- <div class="d-flex">
128
- <base-button
129
- @click="removeArchive(currentRemoveItem, index)"
130
- size="sm"
131
- class="btn-outline-primary col-6 p-1"
132
- >
133
- Apagar
134
- </base-button>
135
- <base-button
136
- @click="hasRemove = false"
137
- size="sm"
138
- class="btn-outline-danger col-6 p-1"
139
- >
140
- Cancelar
141
- </base-button>
142
- </div>
143
- </div>
144
- </div>
145
-
146
- </div>
147
- <div class="notes-text" v-show="archives == null">
148
- <p>Nenhum arquvio anexado.</p>
149
- </div>
150
-
151
- <div class="input-container" v-show="!isLocked">
152
- <div class="mt-5">
153
-
154
- <dropzone-file-upload
155
- disabled
156
- @error="showMessageError"
157
- ref="Mydropzone"
158
- :options="dropzoneOptions"
159
- v-model="fileToUpload"
160
- />
161
- </div>
162
-
163
- <div class="archive-buttons">
164
- <base-button @click="saveImage" size="sm" class="btn-outline-primary btn-rounded col-12">Salvar</base-button>
165
- </div>
166
- </div>
167
- </el-tab-pane>
168
-
169
- <!-- <el-tab-pane :disabled="true">
170
- <span class="tab__icon-pane cursor-disabled" slot="label">
171
- <img
172
- class="img__icon-pane"
173
- src="../../../../assets/images/icons/icon4.svg"
174
- />
175
- </span>
176
- </el-tab-pane> -->
177
- </el-tabs>
178
- </div>
179
- </template>
180
-
181
- <script>
182
- import { Tabs, TabPane } from 'element-ui';
183
- import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
184
- import swal from 'sweetalert2';
185
- import UpgradePlan from './UpgradePlan.vue';
186
-
187
- export default {
188
- name: 'user-cv-right-side',
189
- filters: {
190
- convertDate(data) {
191
- if (typeof data !== 'string') {
192
- data = '2020-01-01 12:00:00';
193
- }
194
- let d = new Date(data);
195
- let options = { hour: '2-digit', minute: '2-digit' };
196
- return d.toLocaleDateString('pt-BR', options);
197
- }
198
- },
199
- watch:{
200
- fileToUpload(value){
201
- if(value.length > 0 && value[0].accepted) {
202
- this.isError = false;
203
- }
204
- }
205
- },
206
- components: {
207
- [Tabs.name]: Tabs,
208
- [TabPane.name]: TabPane,
209
- DropzoneFileUpload,
210
- UpgradePlan
211
- },
212
- data(){
213
- return {
214
- newNote: '',
215
- active: this.activeName,
216
- hasRemove: null,
217
- isError: true,
218
- currentRemoveItem: null,
219
- fileToUpload: [],
220
- dropzoneOptions: {
221
- maxFilesize: 5,
222
- dictFileTooBig:'Seu arquivo é poderoso demais (Máximo 5mb).',
223
- dictDefaultMessage: 'Clique ou arraste seu arquivo aqui.',
224
- dictInvalidFileType: 'Arquivo invalido.',
225
- dictMaxFilesExceeded: 'Não é permitido mais de um arquivo por vez.',
226
- acceptedFiles: 'image/*, application/pdf',
227
- },
228
- isLocked: !this.companyHasProduct(
229
- this.$store.state.loja.showableProducts['HISTORICO_USUARIO']
230
- ),
231
- };
232
- },
233
- props: {
234
- archives: Array,
235
- userData: Object,
236
- notes: Array,
237
- activeName: String,
238
- isNotesActived: {
239
- type: Boolean,
240
- default: true
241
- },
242
- },
243
- mounted() {
244
- this.companyHistory();
245
- },
246
- methods: {
247
- openRemoveSection(item, index) {
248
- this.hasRemove = index;
249
- this.currentRemoveItem = item;
250
- },
251
-
252
- showToast(type, title){
253
- const Toast = swal.mixin({
254
- toast: true,
255
- position: 'top-end',
256
- showConfirmButton: false,
257
- timer: 3100,
258
- });
259
-
260
- return Toast.fire({
261
- type: type,
262
- title: title
263
- });
264
- },
265
-
266
- showMessageError(file, message) {
267
- this.isError = true;
268
- this.$refs.Mydropzone.removeAllFiles();
269
-
270
- if (file.status !== 'canceled'){
271
- this.showToast('error', message);
272
- }
273
- },
274
-
275
- openArchive(item) {
276
- window.open(item.annex_url, '_blank');
277
- },
278
-
279
- saveImage(){
280
- if (!this.isError) {
281
- this.$emit('save-archive', this.fileToUpload[0], this.userData.id);
282
- this.$refs.Mydropzone.removeAllFiles();
283
- this.showToast('success', 'Arquivo enviado com sucesso.');
284
-
285
- } else {
286
- if (this.fileToUpload.length > 0) {
287
- this.showToast('error', 'Arquivo invalido.');
288
- } else {
289
- this.showToast('warning', 'Selecione um arquivo.');
290
- }
291
- }
292
- },
293
-
294
- removeArchive(archive, index){
295
- console.log(archive);
296
- this.$emit('remove-archive', archive.user_id, archive.id, archive.company_id, index);
297
- this.hasRemove = null;
298
- },
299
-
300
- cleatInput() {
301
- this.newNote = '';
302
- },
303
- companyHistory() {
304
- let sms = this.userData.company_sms.map(x => ({
305
- date: x.created_at,
306
- text: 'Recebeu um SMS'
307
- }));
308
- let tests = this.userData.tests.map(x => {
309
- if (x.finished_at) {
310
- return {
311
- date: x.finished_at,
312
- text: `Finalizou o teste ${x.test.name.toUpperCase()}`
313
- };
314
- } else {
315
- return {
316
- date: x.created_at,
317
- text: `Recebeu o teste ${x.test.name.toUpperCase()}`
318
- };
319
- }
320
-
321
- });
322
- let discs = this.userData.solides.map(x => ({
323
- date: x.end,
324
- text: 'Realizou um teste DISC'
325
- }));
326
-
327
- return sms.concat(tests, discs);
328
- },
329
- orderByDate(data) {
330
- let sortedArray = data.sort((a, b) => {
331
- a = a.date || '2020-01-01 12:00:00';
332
- b = b.date || '2020-01-01 12:00:00';
333
-
334
- return new Date(b).getTime() - new Date(a).getTime();
335
- });
336
-
337
- return sortedArray;
338
- },
339
- sendContact() {
340
- this.$emit('open-contact');
341
- }
342
- },
343
- };
344
- </script>
345
- <style>
346
- .el-tabs__nav-wrap::after {
347
- background: #fff !important;
348
- }
349
-
350
- .el-tabs__active-bar {
351
- width: 34px !important;
352
- height: 4px !important;
353
- border-radius: 10px 10px 0px 0px;
354
- }
355
- </style>
356
-
357
- <style lang="scss">
358
- .swal2-title {
359
- font-size: 1rem !important;
360
- }
361
- .swal2-container {
362
- z-index: 5000 !important;
363
- }
364
- </style>
365
-
366
- <style lang="scss" scoped>
367
- @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
368
-
369
- /deep/.dropzone {
370
- width: 95%;
371
-
372
- .dz-message {
373
- padding: 2rem 1rem !important;
374
- }
375
-
376
- button.dz-button {
377
- background-color: transparent;
378
- border: 0;
379
- }
380
- }
381
-
382
- /deep/ .el-tab-pane {
383
- height: 760px;
384
- max-height: 760px;
385
- overflow: hidden;
386
- overflow-y: auto;
387
- position: relative;
388
-
389
- > .notes-title {
390
- position: sticky;
391
- position: -webkit-sticky;
392
- top: 0;
393
- background: white;
394
- padding: 10px 0;
395
- }
396
-
397
- > .input-container {
398
- position: sticky;
399
- position: -webkit-sticky;
400
- bottom: 0;
401
- background: white;
402
- > .input-icon {
403
- cursor: pointer;
404
- position: absolute;
405
- top: 50%;
406
- right: 30px;
407
- transform: translateY(-50%);
408
- color: #c8c8c8;
409
- }
410
- }
411
-
412
- &::-webkit-scrollbar {
413
- width: 8px;
414
- }
415
-
416
- &::-webkit-scrollbar-track {
417
- background: #f5f5f5;
418
- }
419
-
420
- &::-webkit-scrollbar-thumb {
421
- background: #e9e8e8;
422
- border-radius: 10px;
423
- }
424
-
425
- .archive-content {
426
- width: 95%;
427
-
428
- p {
429
- margin-bottom: 0;
430
- font-size: 0.875rem;
431
- padding: .3rem .6rem 0 .6rem;
432
- }
433
-
434
- .archive-container {
435
- display: flex;
436
- align-items: center;
437
- padding: 0.5rem 0.5rem 0.438rem;
438
- cursor: pointer;
439
- user-select: none;
440
-
441
- &:hover{
442
- background-color: #f6f9fc;
443
- border-radius: 5px;
444
- }
445
-
446
- .archive-img {
447
- background-color: #f5f5f5;
448
- border-radius: 6px;
449
- padding: 7px;
450
- }
451
-
452
- .archive-name {
453
- display: flex;
454
- margin-left: .8rem;
455
- width: 145%;
456
- justify-content: space-between !important;
457
-
458
- .archive-icon {
459
- margin-left: 1.5rem;
460
- }
461
-
462
- p {
463
- margin: 0;
464
- padding: 0;
465
- width: 13rem;
466
- white-space: nowrap;
467
- overflow: hidden;
468
- text-overflow: ellipsis;
469
- }
470
- }
471
-
472
- .upload-container {
473
- position: sticky;
474
- position: -webkit-sticky;
475
- bottom: 0;
476
- background: white;
477
- width: 231px;
478
- }
479
- }
480
- }
481
-
482
- .archive-buttons {
483
- display: flex;
484
- margin-top: -1rem;
485
- width: 95%;
486
- }
487
-
488
- .archive-remove {
489
- width: 90%;
490
- word-break: break-word;
491
- }
492
- }
493
-
494
- /deep/ .el-tabs__nav-scroll {
495
- display: flex;
496
- justify-content: space-around;
497
- }
498
-
499
- /deep/ .el-tabs__item {
500
- padding: 0 2.5rem !important;
501
- }
502
-
503
- /deep/ .el-tabs__nav {
504
- width: 100% !important;
505
- }
506
-
507
- @media (max-width: 1520px) {
508
- /deep/ .el-tabs__item {
509
- padding: 0 1.8rem !important;
510
- }
511
- }
512
-
513
- .readmore {
514
- overflow: hidden;
515
- text-overflow: ellipsis;
516
- display: -webkit-box;
517
- -webkit-line-clamp: 3;
518
- -webkit-box-orient: vertical;
519
- }
520
-
521
- .tab__icon-pane {
522
- .img__icon-pane {
523
- background-color: #f5f5f5 !important;
524
- border-radius: 30%;
525
- padding: 7px;
526
- margin-bottom: 1rem;
527
- }
528
- }
529
-
530
- .content-right {
531
- width: 25%;
532
- }
533
-
534
- .notes-title {
535
- font-size: 14px;
536
- color: #1d364b;
537
- font-weight: bold;
538
- background-color: white;
539
- z-index: 500;
540
- }
541
-
542
- .notes-baloon {
543
- width: 231px;
544
- height: auto;
545
-
546
- background: #eff5fd;
547
- border-radius: 10px 10px 10px 0px;
548
- }
549
-
550
- .notes-text {
551
- p {
552
- font-size: 13px;
553
- color: #62778c;
554
- }
555
- }
556
-
557
- .notes-date {
558
- font-size: 11px;
559
- text-align: right;
560
-
561
- color: #8da2b5;
562
- top: calc(50% - 17px / 2 - 444.5px);
563
- }
564
-
565
- .notes-owner {
566
- img {
567
- width: 23px;
568
- height: 23px;
569
- border-radius: 50%;
570
- }
571
-
572
- .notes-avatar {
573
- width: 23px;
574
- height: 23px;
575
- border-radius: 50%;
576
- background-color: #adb5bd;
577
- }
578
-
579
- p {
580
- font-size: 13px;
581
- font-weight: 600;
582
- text-transform: uppercase;
583
-
584
- color: #62778c;
585
- }
586
- }
587
-
588
- .notes-new {
589
- width: 95%;
590
- height: 33px;
591
-
592
- background: #f5f5f5;
593
- border-radius: 16.5px;
594
- border: none;
595
-
596
- outline: 0;
597
- }
598
-
599
- .line {
600
- width: 221px;
601
- height: 0px;
602
-
603
- border: 1px solid #ececec5c;
604
- }
605
-
606
- .history {
607
- word-break: break-word;
608
-
609
- .history-text {
610
- font-size: 13px;
611
- color: #62778c;
612
- }
613
-
614
- span {
615
- font-size: 11px;
616
- line-height: 16px;
617
-
618
- color: #8da2b5;
619
- }
620
- }
621
-
622
- .cursor-disabled {
623
- cursor: no-drop;
624
- }
625
- </style>
1
+ <template>
2
+ <div class="bg-white content-right tabs ">
3
+ <el-tabs
4
+ :class="active"
5
+ class="mt-3 handle-icon-color"
6
+ v-model="active"
7
+ >
8
+ <el-tab-pane class="history ml-2" name="history">
9
+ <span class="tab__icon-pane" slot="label">
10
+ <img
11
+ class="img__icon-pane img__icon--history"
12
+ src="../../../../assets/images/icons/historicCv.svg"
13
+ />
14
+ </span>
15
+ <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
16
+ <p class="notes-title mb-0">Histórico com sua empresa</p>
17
+ <div class="line mb-3"></div>
18
+
19
+ <div
20
+ class="mt-3"
21
+ v-for="(item, index) in orderByDate(companyHistory())"
22
+ :key="index"
23
+ >
24
+ <p class="history-text mb-0">
25
+ {{ item.text }}
26
+ </p>
27
+ <span>{{ item.date | convertDate }}</span>
28
+ </div>
29
+ <p v-show="companyHistory().length === 0" class="history-text">
30
+ Histórico vazio.
31
+ </p>
32
+ </el-tab-pane>
33
+
34
+ <el-tab-pane name="notes" class="ml-2" v-if="isNotesActived">
35
+ <span class="tab__icon-pane" slot="label">
36
+ <img
37
+ class="img__icon-pane img__icon--notes"
38
+ src="../../../../assets/images/icons/notesCv.svg"
39
+ />
40
+ </span>
41
+ <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
42
+ <p class="notes-title mb-0">Notas da equipe</p>
43
+ <div class="line mb-3"></div>
44
+ <div
45
+ v-show="notes.length > 0"
46
+ v-for="(note, index) in notes.slice(0, 5)"
47
+ :key="index"
48
+ >
49
+ <div class="notes-baloon">
50
+ <div class="notes-text ml-3 pt-1">
51
+ <p class="mt-3">{{ note.text }}</p>
52
+ </div>
53
+ <div
54
+ class="d-flex justify-content-end align-items-center mr-3"
55
+ >
56
+ <p class="notes-date">
57
+ {{ note.created_at | convertDate }}
58
+ </p>
59
+ </div>
60
+ </div>
61
+ <div class="notes-owner d-flex mt-2">
62
+ <img
63
+ v-show="note.user.urlAvatar"
64
+ :src="note.user.urlAvatar"
65
+ :alt="note.user.name"
66
+ />
67
+ <div
68
+ v-show="!note.user.urlAvatar"
69
+ class="notes-avatar"
70
+ ></div>
71
+ <p class="ml-1">
72
+ {{ note.user.name }}
73
+ </p>
74
+ </div>
75
+ </div>
76
+ <div class="notes-text" v-show="notes.length === 0">
77
+ <p>Nenhuma nota criada.</p>
78
+ </div>
79
+
80
+ <div class="input-container" v-show="!isLocked">
81
+ <input
82
+ class="notes-new pl-4 mt-3 mb-3 form-rounded"
83
+ type="text"
84
+ placeholder="Escrever anotação"
85
+ v-model="newNote"
86
+ @change="$emit('new-note', newNote, userData.id)"
87
+ v-on:change="cleatInput()"
88
+ />
89
+ <i
90
+ @click="
91
+ newNote.length > 0 &&
92
+ $emit('new-note', newNote, userData.id)
93
+ "
94
+ class="fas fa-paper-plane input-icon"
95
+ ></i>
96
+ </div>
97
+ </el-tab-pane>
98
+
99
+ <el-tab-pane name="documents" class="ml-2">
100
+ <span class="tab__icon-pane" slot="label">
101
+ <img
102
+ class="img__icon-pane img__icon--documents"
103
+ src="../../../../assets/images/icons/icon3.svg"
104
+ />
105
+ </span>
106
+ <upgrade-plan @send-contact="sendContact" v-show="isLocked" />
107
+ <p class="notes-title mb-0">Documentos anexados</p>
108
+ <div class="line mb-3"></div>
109
+
110
+ <div class="archive-content">
111
+ <div v-for="(item, index) in archives" :key="index">
112
+ <div @click="openArchive(item)" class="archive-container">
113
+ <div>
114
+ <img class="archive-img" src="../../../../assets/images/icons/icon3.svg" >
115
+ </div>
116
+ <div class="archive-name">
117
+ <p>
118
+ <span>{{item.name}}</span>
119
+ <div class="archive-icon">
120
+ <i @click.stop.prevent="openRemoveSection(item, (index+1))" class="far fa-trash-alt"></i>
121
+ </div>
122
+ </p>
123
+ </div>
124
+ </div>
125
+ <div v-if="hasRemove && hasRemove == (index+1)" class="archive-remove">
126
+ <p>Você tem certeza que deseja apagar este arquivo?</p>
127
+ <div class="d-flex">
128
+ <base-button
129
+ @click="removeArchive(currentRemoveItem, index)"
130
+ size="sm"
131
+ class="btn-outline-primary col-6 p-1"
132
+ >
133
+ Apagar
134
+ </base-button>
135
+ <base-button
136
+ @click="hasRemove = false"
137
+ size="sm"
138
+ class="btn-outline-danger col-6 p-1"
139
+ >
140
+ Cancelar
141
+ </base-button>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ </div>
147
+ <div class="notes-text" v-show="archives == null">
148
+ <p>Nenhum arquvio anexado.</p>
149
+ </div>
150
+
151
+ <div class="input-container" v-show="!isLocked">
152
+ <div class="mt-5">
153
+
154
+ <dropzone-file-upload
155
+ disabled
156
+ @error="showMessageError"
157
+ ref="Mydropzone"
158
+ :options="dropzoneOptions"
159
+ v-model="fileToUpload"
160
+ />
161
+ </div>
162
+
163
+ <div class="archive-buttons">
164
+ <base-button @click="saveImage" size="sm" class="btn-outline-primary btn-rounded col-12">Salvar</base-button>
165
+ </div>
166
+ </div>
167
+ </el-tab-pane>
168
+
169
+ <!-- <el-tab-pane :disabled="true">
170
+ <span class="tab__icon-pane cursor-disabled" slot="label">
171
+ <img
172
+ class="img__icon-pane"
173
+ src="../../../../assets/images/icons/icon4.svg"
174
+ />
175
+ </span>
176
+ </el-tab-pane> -->
177
+ </el-tabs>
178
+ </div>
179
+ </template>
180
+
181
+ <script>
182
+ import { Tabs, TabPane } from 'element-ui';
183
+ import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
184
+ import swal from 'sweetalert2';
185
+ import UpgradePlan from './UpgradePlan.vue';
186
+
187
+ export default {
188
+ name: 'user-cv-right-side',
189
+ filters: {
190
+ convertDate(data) {
191
+ if (typeof data !== 'string') {
192
+ data = '2020-01-01 12:00:00';
193
+ }
194
+ let d = new Date(data);
195
+ let options = { hour: '2-digit', minute: '2-digit' };
196
+ return d.toLocaleDateString('pt-BR', options);
197
+ }
198
+ },
199
+ watch:{
200
+ fileToUpload(value){
201
+ if(value.length > 0 && value[0].accepted) {
202
+ this.isError = false;
203
+ }
204
+ }
205
+ },
206
+ components: {
207
+ [Tabs.name]: Tabs,
208
+ [TabPane.name]: TabPane,
209
+ DropzoneFileUpload,
210
+ UpgradePlan
211
+ },
212
+ data(){
213
+ return {
214
+ newNote: '',
215
+ active: this.activeName,
216
+ hasRemove: null,
217
+ isError: true,
218
+ currentRemoveItem: null,
219
+ fileToUpload: [],
220
+ dropzoneOptions: {
221
+ maxFilesize: 5,
222
+ dictFileTooBig:'Seu arquivo é poderoso demais (Máximo 5mb).',
223
+ dictDefaultMessage: 'Clique ou arraste seu arquivo aqui.',
224
+ dictInvalidFileType: 'Arquivo invalido.',
225
+ dictMaxFilesExceeded: 'Não é permitido mais de um arquivo por vez.',
226
+ acceptedFiles: 'image/*, application/pdf',
227
+ },
228
+ isLocked: !this.companyHasProduct(
229
+ this.$store.state.loja && this.$store.state.loja.showableProducts && this.$store.state.loja.showableProducts['HISTORICO_USUARIO'] || false
230
+ ),
231
+ };
232
+ },
233
+ props: {
234
+ archives: Array,
235
+ userData: Object,
236
+ notes: Array,
237
+ activeName: String,
238
+ isNotesActived: {
239
+ type: Boolean,
240
+ default: true
241
+ },
242
+ },
243
+ mounted() {
244
+ this.companyHistory();
245
+ },
246
+ methods: {
247
+ openRemoveSection(item, index) {
248
+ this.hasRemove = index;
249
+ this.currentRemoveItem = item;
250
+ },
251
+
252
+ showToast(type, title){
253
+ const Toast = swal.mixin({
254
+ toast: true,
255
+ position: 'top-end',
256
+ showConfirmButton: false,
257
+ timer: 3100,
258
+ });
259
+
260
+ return Toast.fire({
261
+ type: type,
262
+ title: title
263
+ });
264
+ },
265
+
266
+ showMessageError(file, message) {
267
+ this.isError = true;
268
+ this.$refs.Mydropzone.removeAllFiles();
269
+
270
+ if (file.status !== 'canceled'){
271
+ this.showToast('error', message);
272
+ }
273
+ },
274
+
275
+ openArchive(item) {
276
+ window.open(item.annex_url, '_blank');
277
+ },
278
+
279
+ saveImage(){
280
+ if (!this.isError) {
281
+ this.$emit('save-archive', this.fileToUpload[0], this.userData.id);
282
+ this.$refs.Mydropzone.removeAllFiles();
283
+ this.showToast('success', 'Arquivo enviado com sucesso.');
284
+
285
+ } else {
286
+ if (this.fileToUpload.length > 0) {
287
+ this.showToast('error', 'Arquivo invalido.');
288
+ } else {
289
+ this.showToast('warning', 'Selecione um arquivo.');
290
+ }
291
+ }
292
+ },
293
+
294
+ removeArchive(archive, index){
295
+ console.log(archive);
296
+ this.$emit('remove-archive', archive.user_id, archive.id, archive.company_id, index);
297
+ this.hasRemove = null;
298
+ },
299
+
300
+ cleatInput() {
301
+ this.newNote = '';
302
+ },
303
+ companyHistory() {
304
+ let sms = this.userData.company_sms.map(x => ({
305
+ date: x.created_at,
306
+ text: 'Recebeu um SMS'
307
+ }));
308
+ let tests = this.userData.tests.map(x => {
309
+ if (x.finished_at) {
310
+ return {
311
+ date: x.finished_at,
312
+ text: `Finalizou o teste ${x.test.name.toUpperCase()}`
313
+ };
314
+ } else {
315
+ return {
316
+ date: x.created_at,
317
+ text: `Recebeu o teste ${x.test.name.toUpperCase()}`
318
+ };
319
+ }
320
+
321
+ });
322
+ let discs = this.userData.solides.map(x => ({
323
+ date: x.end,
324
+ text: 'Realizou um teste DISC'
325
+ }));
326
+
327
+ return sms.concat(tests, discs);
328
+ },
329
+ orderByDate(data) {
330
+ let sortedArray = data.sort((a, b) => {
331
+ a = a.date || '2020-01-01 12:00:00';
332
+ b = b.date || '2020-01-01 12:00:00';
333
+
334
+ return new Date(b).getTime() - new Date(a).getTime();
335
+ });
336
+
337
+ return sortedArray;
338
+ },
339
+ sendContact() {
340
+ this.$emit('open-contact');
341
+ }
342
+ },
343
+ };
344
+ </script>
345
+ <style>
346
+ .el-tabs__nav-wrap::after {
347
+ background: #fff !important;
348
+ }
349
+
350
+ .el-tabs__active-bar {
351
+ width: 34px !important;
352
+ height: 4px !important;
353
+ border-radius: 10px 10px 0px 0px;
354
+ }
355
+ </style>
356
+
357
+ <style lang="scss">
358
+ .swal2-title {
359
+ font-size: 1rem !important;
360
+ }
361
+ .swal2-container {
362
+ z-index: 5000 !important;
363
+ }
364
+ </style>
365
+
366
+ <style lang="scss" scoped>
367
+ @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
368
+
369
+ /deep/.dropzone {
370
+ width: 95%;
371
+
372
+ .dz-message {
373
+ padding: 2rem 1rem !important;
374
+ }
375
+
376
+ button.dz-button {
377
+ background-color: transparent;
378
+ border: 0;
379
+ }
380
+ }
381
+
382
+ /deep/ .el-tab-pane {
383
+ height: 760px;
384
+ max-height: 760px;
385
+ overflow: hidden;
386
+ overflow-y: auto;
387
+ position: relative;
388
+
389
+ > .notes-title {
390
+ position: sticky;
391
+ position: -webkit-sticky;
392
+ top: 0;
393
+ background: white;
394
+ padding: 10px 0;
395
+ }
396
+
397
+ > .input-container {
398
+ position: sticky;
399
+ position: -webkit-sticky;
400
+ bottom: 0;
401
+ background: white;
402
+ > .input-icon {
403
+ cursor: pointer;
404
+ position: absolute;
405
+ top: 50%;
406
+ right: 30px;
407
+ transform: translateY(-50%);
408
+ color: #c8c8c8;
409
+ }
410
+ }
411
+
412
+ &::-webkit-scrollbar {
413
+ width: 8px;
414
+ }
415
+
416
+ &::-webkit-scrollbar-track {
417
+ background: #f5f5f5;
418
+ }
419
+
420
+ &::-webkit-scrollbar-thumb {
421
+ background: #e9e8e8;
422
+ border-radius: 10px;
423
+ }
424
+
425
+ .archive-content {
426
+ width: 95%;
427
+
428
+ p {
429
+ margin-bottom: 0;
430
+ font-size: 0.875rem;
431
+ padding: .3rem .6rem 0 .6rem;
432
+ }
433
+
434
+ .archive-container {
435
+ display: flex;
436
+ align-items: center;
437
+ padding: 0.5rem 0.5rem 0.438rem;
438
+ cursor: pointer;
439
+ user-select: none;
440
+
441
+ &:hover{
442
+ background-color: #f6f9fc;
443
+ border-radius: 5px;
444
+ }
445
+
446
+ .archive-img {
447
+ background-color: #f5f5f5;
448
+ border-radius: 6px;
449
+ padding: 7px;
450
+ }
451
+
452
+ .archive-name {
453
+ display: flex;
454
+ margin-left: .8rem;
455
+ width: 145%;
456
+ justify-content: space-between !important;
457
+
458
+ .archive-icon {
459
+ margin-left: 1.5rem;
460
+ }
461
+
462
+ p {
463
+ margin: 0;
464
+ padding: 0;
465
+ width: 13rem;
466
+ white-space: nowrap;
467
+ overflow: hidden;
468
+ text-overflow: ellipsis;
469
+ }
470
+ }
471
+
472
+ .upload-container {
473
+ position: sticky;
474
+ position: -webkit-sticky;
475
+ bottom: 0;
476
+ background: white;
477
+ width: 231px;
478
+ }
479
+ }
480
+ }
481
+
482
+ .archive-buttons {
483
+ display: flex;
484
+ margin-top: -1rem;
485
+ width: 95%;
486
+ }
487
+
488
+ .archive-remove {
489
+ width: 90%;
490
+ word-break: break-word;
491
+ }
492
+ }
493
+
494
+ /deep/ .el-tabs__nav-scroll {
495
+ display: flex;
496
+ justify-content: space-around;
497
+ }
498
+
499
+ /deep/ .el-tabs__item {
500
+ padding: 0 2.5rem !important;
501
+ }
502
+
503
+ /deep/ .el-tabs__nav {
504
+ width: 100% !important;
505
+ }
506
+
507
+ @media (max-width: 1520px) {
508
+ /deep/ .el-tabs__item {
509
+ padding: 0 1.8rem !important;
510
+ }
511
+ }
512
+
513
+ .readmore {
514
+ overflow: hidden;
515
+ text-overflow: ellipsis;
516
+ display: -webkit-box;
517
+ -webkit-line-clamp: 3;
518
+ -webkit-box-orient: vertical;
519
+ }
520
+
521
+ .tab__icon-pane {
522
+ .img__icon-pane {
523
+ background-color: #f5f5f5 !important;
524
+ border-radius: 30%;
525
+ padding: 7px;
526
+ margin-bottom: 1rem;
527
+ }
528
+ }
529
+
530
+ .content-right {
531
+ width: 25%;
532
+ }
533
+
534
+ .notes-title {
535
+ font-size: 14px;
536
+ color: #1d364b;
537
+ font-weight: bold;
538
+ background-color: white;
539
+ z-index: 500;
540
+ }
541
+
542
+ .notes-baloon {
543
+ width: 231px;
544
+ height: auto;
545
+
546
+ background: #eff5fd;
547
+ border-radius: 10px 10px 10px 0px;
548
+ }
549
+
550
+ .notes-text {
551
+ p {
552
+ font-size: 13px;
553
+ color: #62778c;
554
+ }
555
+ }
556
+
557
+ .notes-date {
558
+ font-size: 11px;
559
+ text-align: right;
560
+
561
+ color: #8da2b5;
562
+ top: calc(50% - 17px / 2 - 444.5px);
563
+ }
564
+
565
+ .notes-owner {
566
+ img {
567
+ width: 23px;
568
+ height: 23px;
569
+ border-radius: 50%;
570
+ }
571
+
572
+ .notes-avatar {
573
+ width: 23px;
574
+ height: 23px;
575
+ border-radius: 50%;
576
+ background-color: #adb5bd;
577
+ }
578
+
579
+ p {
580
+ font-size: 13px;
581
+ font-weight: 600;
582
+ text-transform: uppercase;
583
+
584
+ color: #62778c;
585
+ }
586
+ }
587
+
588
+ .notes-new {
589
+ width: 95%;
590
+ height: 33px;
591
+
592
+ background: #f5f5f5;
593
+ border-radius: 16.5px;
594
+ border: none;
595
+
596
+ outline: 0;
597
+ }
598
+
599
+ .line {
600
+ width: 221px;
601
+ height: 0px;
602
+
603
+ border: 1px solid #ececec5c;
604
+ }
605
+
606
+ .history {
607
+ word-break: break-word;
608
+
609
+ .history-text {
610
+ font-size: 13px;
611
+ color: #62778c;
612
+ }
613
+
614
+ span {
615
+ font-size: 11px;
616
+ line-height: 16px;
617
+
618
+ color: #8da2b5;
619
+ }
620
+ }
621
+
622
+ .cursor-disabled {
623
+ cursor: no-drop;
624
+ }
625
+ </style>