@golstats/gsc-top-player 1.0.11 → 1.0.13

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.
Files changed (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +53 -53
  3. package/dist/{FilterConditions-55d68355-DMqzcKBO.js → FilterConditions-55d68355-icU5o85T.js} +1 -1
  4. package/dist/{FilterField-59a73e38-CNaE03Ge.js → FilterField-59a73e38-BOM_57PM.js} +1 -1
  5. package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r.js → FilterSubcategories-a9b32cc9-yXOBLwEK.js} +1 -1
  6. package/dist/atajada.svg +56 -56
  7. package/dist/backarrow.svg +3 -3
  8. package/dist/contorno-escudo.svg +3 -3
  9. package/dist/css/fonts.css +91 -91
  10. package/dist/fin-del-partido.svg +43 -43
  11. package/dist/fuera-de-lugar.svg +57 -57
  12. package/dist/gol.svg +48 -48
  13. package/dist/group-427321178.svg +8 -8
  14. package/dist/group-427321179.svg +5 -5
  15. package/dist/group-427321501.svg +5 -5
  16. package/dist/gsc-top-player.css +1 -1
  17. package/dist/gsc-top-player.es.js +1 -1
  18. package/dist/gsc-top-player.umd.js +9 -9
  19. package/dist/icn-arrow-expand.svg +3 -3
  20. package/dist/icn-cambio.svg +26 -26
  21. package/dist/icn-expand-arrow.svg +3 -3
  22. package/dist/icn-expand-arrow1.svg +3 -3
  23. package/dist/icn-falta.svg +42 -42
  24. package/dist/icn-filter.svg +12 -12
  25. package/dist/icn-filter1.svg +12 -12
  26. package/dist/icn-filter2.svg +12 -12
  27. package/dist/icn-play.svg +10 -10
  28. package/dist/icn-tarjeta-amarilla.svg +4 -4
  29. package/dist/icn-tarjeta-roja.svg +4 -4
  30. package/dist/icn-tiro-a-porteria.svg +36 -36
  31. package/dist/icn-tiros-de-esquina.svg +54 -54
  32. package/dist/images/events/logo-fusionado.svg +37 -37
  33. package/dist/{index--DcThtAY.js → index-DP7G7HpQ.js} +940 -940
  34. package/dist/inicia-el-partido.svg +45 -45
  35. package/dist/jugada-peligrosa.svg +90 -90
  36. package/dist/next-arrow.svg +3 -3
  37. package/dist/nextarrow.svg +3 -3
  38. package/dist/penal-fallado.svg +194 -194
  39. package/dist/penal-marcado.svg +189 -189
  40. package/dist/play-icn.svg +3 -3
  41. package/dist/public/images/canchaRPH.svg +30 -30
  42. package/dist/public/images/events/atajada.svg +56 -56
  43. package/dist/public/images/events/cambio.svg +26 -26
  44. package/dist/public/images/events/falta.svg +42 -42
  45. package/dist/public/images/events/fin-del-partido.svg +43 -43
  46. package/dist/public/images/events/fuera-de-lugar.svg +57 -57
  47. package/dist/public/images/events/gol.svg +48 -48
  48. package/dist/public/images/events/icn-cambio.svg +6 -6
  49. package/dist/public/images/events/icn-falta.svg +4 -4
  50. package/dist/public/images/events/icn-play.svg +3 -3
  51. package/dist/public/images/events/icn-tarjeta-amarilla.svg +4 -4
  52. package/dist/public/images/events/icn-tarjeta-roja.svg +4 -4
  53. package/dist/public/images/events/icn-tiro-a-porteria.svg +36 -36
  54. package/dist/public/images/events/icn-tiros-de-esquina.svg +18 -18
  55. package/dist/public/images/events/inicia-el-partido.svg +45 -45
  56. package/dist/public/images/events/jugada-peligrosa.svg +90 -90
  57. package/dist/public/images/events/penal-fallado.svg +194 -194
  58. package/dist/public/images/events/penal-marcado.svg +189 -189
  59. package/dist/public/images/events/tiempo-agregado.svg +74 -74
  60. package/dist/public/images/events/tiro-a-porteria.svg +80 -80
  61. package/dist/public/images/events/tiro-de-esquina.svg +54 -54
  62. package/dist/public/images/events/var.svg +30 -30
  63. package/dist/shape.svg +3 -3
  64. package/dist/styles.css +1176 -1176
  65. package/dist/tiempo-agregado.svg +74 -74
  66. package/dist/tiro-a-porteria.svg +80 -80
  67. package/dist/var.svg +30 -30
  68. package/package.json +1 -1
  69. package/src/components/comparative/categories.js +137 -137
  70. package/src/components/comparative/composable-filters.js +10 -10
  71. package/src/components/comparative/computedProperties.js +327 -327
  72. package/src/components/comparative/dummy-top-players.js +122 -122
  73. package/src/components/comparative/filtersTypes.js +117 -117
  74. package/src/components/comparative/gsc-button.vue +198 -198
  75. package/src/components/comparative/gsc-expanded-info-player.vue +710 -710
  76. package/src/components/comparative/gsc-head-titles.vue +1482 -1482
  77. package/src/components/comparative/gsc-header-tops.vue +1418 -1418
  78. package/src/components/comparative/gsc-top.vue +1511 -1511
  79. package/src/components/comparative/gsc-tops-full.vue +2473 -2473
  80. package/src/components/comparative/nationalities-catalog.js +233 -233
  81. package/src/components/comparative/playsTypes.js +142 -142
  82. package/src/components/comparative/useElementSize.js +23 -23
  83. package/src/components/gsc-top-player.vue +91 -91
  84. package/src/index.js +5 -5
@@ -1,2473 +1,2473 @@
1
- <template>
2
- <div ref="myDivRefTopsFull" style="width: 100%; max-width: 100%; box-sizing: border-box">
3
- <template v-for="(category, index) in categoryView" :key="index">
4
- <div :class="toniKroosWrapperClass">
5
- <GSCTopCategory
6
- :is-widget="isWidget"
7
- :team-widget="teamWidget"
8
- :time-live-comparative-avanced="timeLiveComparativeAvanced"
9
- :is-team="isTeam"
10
- :carrousel="carrousel"
11
- :arrow="arrow"
12
- :border-width="0"
13
- :can-play-videos="canPlayVideos"
14
- border-radius="12px"
15
- :game-id="gameId"
16
- :game="game"
17
- :typeData="0"
18
- :category="category.id"
19
- :type-table="typeTable"
20
- :categoryName="category.name"
21
- :season-selected="seasonSelected"
22
- :season="seasonActive"
23
- :filter-team="teamselect"
24
- :num-rows="numRows"
25
- :key="updateTables"
26
- :dummy-data="dummyData"
27
- />
28
- </div>
29
- </template>
30
- </div>
31
- </template>
32
-
33
- <script>
34
- import axios from 'axios'
35
- import computedProperties from './computedProperties.js'
36
- import useElementSize from './useElementSize'
37
- import GSCTopCategory from '@/components/comparative/gsc-top.vue'
38
-
39
- import { filtersTypes, personalDataSubFiltersTypes } from '@golstats/gsc-filters'
40
-
41
- import '@@/@golstats/gsc-switch-component/dist/style.css'
42
- import '@@/@golstats/gsc-season-select/dist/style.css'
43
- import '@@/@golstats/gsc-tournament-select/dist/style.css'
44
- import '@@/@golstats/gsc-dropdown/dist/style.css'
45
- import '@@/@golstats/gsc-filters/dist/style.css'
46
- import '@@/@golstats/gsc-label/dist/style.css'
47
- import '@@/@golstats/gsc-filterperteam/dist/style.css'
48
-
49
- import nationalitiesCatalog from '@/components/comparative/nationalities-catalog.js'
50
- import { getButtonFilterProps } from '@/components/comparative/composable-filters.js'
51
- const buttonFilterProps = ref(getButtonFilterProps())
52
-
53
- import { ref } from 'vue'
54
- export default {
55
- components: {
56
- GSCTopCategory,
57
- },
58
- computed: {
59
- ...computedProperties.computed,
60
- filterChangePredefined() {
61
- return this.filtersPredefinedF
62
- },
63
- filterChange() {
64
- const filtersaux2 = {
65
- zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
66
- playingAs: [1, 2],
67
- sections: [1, 2, 3, 4, 5, 6],
68
- matchResult: [1, 2, 3],
69
- arrayAgeRange: [1, 60],
70
- typeZone: 1,
71
- setNationalitiesIds: this.fVnationalities,
72
- setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
73
- booleanAreNationalTeamsVisible: false,
74
- setAvailableNationalTeamsPlayersIds: new Set(),
75
- }
76
- const filtersaux2Const = JSON.stringify(filtersaux2)
77
- if (JSON.stringify(this.filters) != filtersaux2Const) {
78
- return filtersaux2Const
79
- }
80
- return filtersaux2Const
81
- },
82
- filterGolstats() {
83
- return this.FVfilterGolstats
84
- },
85
- filterButtonProps() {
86
- const buttonFilterPropsValues = {
87
- ...buttonFilterProps.value,
88
- }
89
- return buttonFilterPropsValues
90
- },
91
- },
92
- props: {
93
- timeLiveComparativeAvanced: {
94
- type: Number,
95
- default: 60000,
96
- },
97
- currentSeasonId: {
98
- type: Number,
99
- default: 0,
100
- },
101
- typeData: {
102
- type: Number,
103
- default: 0,
104
- },
105
- canPlayVideos: {
106
- type: Boolean,
107
- default: false,
108
- },
109
- carrousel: {
110
- type: Boolean,
111
- default: false,
112
- },
113
- arrow: {
114
- type: Boolean,
115
- default: false,
116
- },
117
- teamId: {
118
- type: Number,
119
- default: 0,
120
- },
121
- gameId: {
122
- type: Number,
123
- default: 0,
124
- },
125
- isWidget: {
126
- type: Boolean,
127
- default: false,
128
- },
129
- seasonSelected: {
130
- type: Object,
131
- default: () => ({}),
132
- },
133
- categoryView: {
134
- type: Array,
135
- default: () => [],
136
- },
137
- teamWidget: {
138
- type: Number,
139
- default: 0,
140
- },
141
- game: {
142
- type: Object,
143
- default: () => ({}),
144
- },
145
- teamselect: {
146
- type: Number,
147
- default: 0,
148
- },
149
- seasonActive: {
150
- type: Number,
151
- default: 0,
152
- },
153
- defaultSection: {
154
- type: String,
155
- default: 'Jugadores',
156
- },
157
- backgroundOdd: { type: String, default: '#172531' },
158
- backgroundEven: { type: String, default: '#0d1d29' },
159
- tournamentsApiUrl: {
160
- type: String,
161
- default: '',
162
- },
163
- numRows: {
164
- type: Number,
165
- default: 5,
166
- },
167
- dummyData: {
168
- type: Array,
169
- default: null,
170
- },
171
- },
172
- watch: {
173
- async seasonActive() {
174
- if (this.seasonActive != 0) {
175
- this.teams = []
176
- const data = await this.fetchTeams()
177
- for (let index = 0; index < data.teams.length; index++) {
178
- this.teams.push({
179
- id: data.teams[index].team_id,
180
- team: data.teams[index].colloquial_name,
181
- logo: data.teams[index].logo,
182
- })
183
- }
184
- }
185
- },
186
- },
187
- setup() {
188
- const myDivRefTopsFull = ref('myDivRefTopsFull')
189
- const { elementSize } = useElementSize(myDivRefTopsFull)
190
- return {
191
- myDivRefTopsFull,
192
- elementSize,
193
- }
194
- },
195
-
196
- data() {
197
- return {
198
- showfiltersPc: false,
199
- positions: [
200
- {
201
- name: 'Portero',
202
- fullname: 'POR',
203
- },
204
- {
205
- name: 'Defensa central',
206
- fullname: 'DFC',
207
- },
208
- {
209
- name: 'Lateral por izquierda',
210
- fullname: 'LI',
211
- },
212
- {
213
- name: 'Lateral por derecha',
214
- fullname: 'LD',
215
- },
216
- {
217
- name: 'Volante por izquierda',
218
- fullname: 'VI',
219
- },
220
- {
221
- name: 'Volante por derecha',
222
- fullname: 'VD',
223
- },
224
- {
225
- name: 'Volante defensivo',
226
- fullname: 'VDF',
227
- },
228
- {
229
- name: 'Volante ofensivo',
230
- fullname: 'VO',
231
- },
232
- {
233
- name: 'Delantero',
234
- fullname: 'DEL',
235
- },
236
- {
237
- name: 'Desconocida',
238
- fullname: 'Desc',
239
- },
240
- ],
241
- arrayFiltersPlays: [],
242
- filtersPredefinedF: {},
243
- categoryPredefinedActive: false,
244
- categoryPredefined: 0,
245
- typeTable: 0,
246
- keyUpdateFilter: 0,
247
- loadingActive: false,
248
- isTeam: false,
249
- arrayPredefinedFilters: [],
250
- arrayCategoryFilter: [
251
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
252
- ],
253
- arrayCategoryFilterFull: [
254
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
255
- ],
256
- FVsetAvailableNationalTeamsPlayersIds: new Set(),
257
- showOnlyCategories: false,
258
- showFullCategory: 0,
259
- categoryName: '',
260
- showFullTable: false,
261
- expansionPanelModePropsTypePlays: {
262
- isExpansionPanel: false,
263
- templateProps: {
264
- boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
265
- width: '400px',
266
- maxWidth: '400px',
267
- },
268
- expansionPanelProps: {
269
- width: '400px',
270
- borderRadius: '8px',
271
- },
272
- fieldComponentProps: {
273
- widthContainer: '400px',
274
- },
275
- },
276
- expansionPanelModeProps: {
277
- isExpansionPanel: false,
278
- templateProps: {
279
- boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
280
- },
281
- expansionPanelProps: {
282
- width: '400px',
283
- borderRadius: '8px',
284
- fontFamily: "'Poppins-Regular'",
285
- },
286
- fieldComponentProps: {
287
- widthContainer: '100%',
288
- title: 'Elige el área o zona de cancha',
289
- titleFontSize: '13px',
290
- },
291
- },
292
- expansionPanelModePropsMobil: {
293
- isExpansionPanel: true,
294
- templateProps: {
295
- boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
296
- padding: '20px 0',
297
- },
298
- expansionPanelProps: {
299
- width: '300px',
300
- borderRadius: '8px',
301
- height: '45px',
302
- fontColor: 'rgba(255,255,255, 0.7)',
303
- textFontSize: '14px',
304
- textFontFamily: "'Poppins-Regular'",
305
- padding: '0px 10px',
306
- },
307
- fieldComponentProps: {
308
- widthContainer: '100%',
309
- title: 'Elige el área o zona de cancha',
310
- titleFontSize: '12px',
311
- widthField: 268,
312
- widthFieldGrid: '268px',
313
- heightField: 180,
314
- heightFieldGrid: '180px',
315
- heightContainer: '280px',
316
- },
317
- },
318
- expansionPanelModePropsMobil270: {
319
- isExpansionPanel: true,
320
- templateProps: {
321
- boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
322
- padding: '20px 0',
323
- },
324
- expansionPanelProps: {
325
- width: '270px',
326
- borderRadius: '8px',
327
- height: '45px',
328
- fontColor: 'rgba(255,255,255, 0.7)',
329
- textFontSize: '14px',
330
- textFontFamily: "'Poppins-Regular'",
331
- padding: '0px 10px',
332
- },
333
- fieldComponentProps: {
334
- widthContainer: '100%',
335
- title: 'Elige el área o zona de cancha',
336
- titleFontSize: '12px',
337
- widthField: 268,
338
- widthFieldGrid: '268px',
339
- heightField: 180,
340
- heightFieldGrid: '180px',
341
- heightContainer: '280px',
342
- },
343
- },
344
- filters: {
345
- zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
346
- playingAs: [1, 2],
347
- sections: [1, 2, 3, 4, 5, 6],
348
- matchResult: [1, 2, 3],
349
- arrayAgeRange: [1, 60],
350
- typeZone: 1,
351
- setNationalitiesIds: this.setNationalitiesIds,
352
- setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
353
- booleanAreNationalTeamsVisible: false,
354
- setAvailableNationalTeamsPlayersIds: new Set(),
355
- },
356
- categoriesPlaysTypes: {
357
- offensive: {
358
- title: 'Ofensivo',
359
- categories: [
360
- {
361
- name: 'Goles',
362
- isSelected: true,
363
- id: 1,
364
- },
365
- {
366
- name: 'Tiros a gol',
367
- isSelected: true,
368
- id: 6,
369
- },
370
- {
371
- name: 'Tiros a gol con destino a portería',
372
- isSelected: true,
373
- id: 7,
374
- },
375
- {
376
- name: 'Asistencias',
377
- isSelected: true,
378
- id: 4,
379
- },
380
- {
381
- name: 'Centros',
382
- isSelected: true,
383
- id: 10,
384
- },
385
- {
386
- name: 'Centros acertados',
387
- isSelected: true,
388
- id: 11,
389
- },
390
- {
391
- name: 'Participaciones en gol',
392
- isSelected: true,
393
- id: 5,
394
- },
395
- {
396
- name: '1vs1 exitosos ofensivos',
397
- isSelected: true,
398
- id: 12,
399
- },
400
- {
401
- name: '1vs1 exitosos ofensivos que terminan en gol',
402
- isSelected: true,
403
- id: 13,
404
- },
405
- {
406
- name: 'Balones ganados en área rival',
407
- isSelected: true,
408
- id: 17,
409
- },
410
- {
411
- name: 'Cabeceos en área rival',
412
- isSelected: true,
413
- id: 8,
414
- },
415
- {
416
- name: 'Tiros de esquina',
417
- isSelected: true,
418
- id: 23,
419
- },
420
- ],
421
- },
422
- defensive: {
423
- title: 'Defensivo',
424
- categories: [
425
- {
426
- name: '1vs1 defensivos exitosos',
427
- isSelected: true,
428
- id: 14,
429
- },
430
- {
431
- name: 'Cabeceo en área propia',
432
- isSelected: true,
433
- id: 9,
434
- },
435
- {
436
- name: 'Balones ganados en área propia',
437
- isSelected: true,
438
- id: 16,
439
- },
440
- {
441
- name: 'Rechaces',
442
- isSelected: true,
443
- id: 15,
444
- },
445
- {
446
- name: 'Atajadas',
447
- isSelected: true,
448
- id: 22,
449
- },
450
- ],
451
- },
452
- possession: {
453
- title: 'Posesión',
454
- categories: [
455
- {
456
- name: 'Pases acertados',
457
- isSelected: true,
458
- id: 2,
459
- },
460
- {
461
- name: 'Balones recuperados en disputa',
462
- isSelected: true,
463
- id: 3,
464
- },
465
- ],
466
- },
467
- offenses: {
468
- title: 'Infracciones',
469
- categories: [
470
- {
471
- name: 'Faltas cometidas',
472
- isSelected: true,
473
- id: 18,
474
- },
475
- {
476
- name: 'Faltas recibidas',
477
- isSelected: true,
478
- id: 19,
479
- },
480
- {
481
- name: 'Tarjetas amarillas',
482
- isSelected: true,
483
- id: 20,
484
- },
485
- {
486
- name: 'Tarjetas rojas',
487
- isSelected: true,
488
- id: 21,
489
- },
490
- ],
491
- },
492
- offensesConditions: {
493
- areYellowCardSelected: false,
494
- areRedCardSelected: false,
495
- areFoulsCommittedSelected: false,
496
- },
497
- },
498
- categoriesDefault: [
499
- {
500
- id: 1,
501
- name: 'Goles',
502
- isSelected: false,
503
- },
504
- {
505
- id: 2,
506
- name: 'Pases acertados',
507
- isSelected: false,
508
- },
509
- {
510
- id: 23,
511
- name: 'Tiros de Esquina',
512
- isSelected: false,
513
- },
514
- {
515
- id: 3,
516
- name: 'Balones recuperados en disputa',
517
- isSelected: false,
518
- },
519
- {
520
- id: 4,
521
- name: 'Asistencias',
522
- isSelected: false,
523
- },
524
- {
525
- id: 5,
526
- name: 'Participaciones en gol',
527
- isSelected: false,
528
- },
529
- {
530
- id: 6,
531
- name: 'Tiros a gol',
532
- isSelected: false,
533
- },
534
- {
535
- id: 7,
536
- name: 'Tiros a gol que llegaron a la portería',
537
- isSelected: false,
538
- },
539
- {
540
- id: 8,
541
- name: 'Cabeceos en área rival',
542
- isSelected: false,
543
- },
544
- {
545
- id: 9,
546
- name: 'Cabeceos en área propia',
547
- isSelected: false,
548
- },
549
- {
550
- id: 10,
551
- name: 'Centros',
552
- isSelected: false,
553
- },
554
- {
555
- id: 11,
556
- name: 'Centros acertados',
557
- isSelected: false,
558
- },
559
- {
560
- id: 12,
561
- name: '1vs1 exitosos ofensivos',
562
- isSelected: false,
563
- },
564
- {
565
- id: 13,
566
- name: '1vs1 exitosos ofensivos que terminaron en gol',
567
- isSelected: false,
568
- },
569
- {
570
- id: 14,
571
- name: '1vs1 defensivos exitoso',
572
- isSelected: false,
573
- },
574
- {
575
- id: 15,
576
- name: 'Rechaces',
577
- isSelected: false,
578
- },
579
- {
580
- id: 16,
581
- name: 'Balones ganados en área propia',
582
- isSelected: false,
583
- },
584
- {
585
- id: 17,
586
- name: 'Balones ganados en área rival',
587
- isSelected: false,
588
- },
589
- {
590
- id: 18,
591
- name: 'Faltas cometidas',
592
- isSelected: false,
593
- },
594
- {
595
- id: 19,
596
- name: 'Faltas recibidas',
597
- isSelected: false,
598
- },
599
- {
600
- id: 20,
601
- name: 'Tarjetas amarillas',
602
- isSelected: false,
603
- },
604
- {
605
- id: 21,
606
- name: 'Tarjetas rojas',
607
- isSelected: false,
608
- },
609
- {
610
- id: 22,
611
- name: 'Atajadas',
612
- isSelected: false,
613
- },
614
- ],
615
- isCup: false,
616
- arrayPredefinedOrigin: [],
617
- indexPredefinedFiltersSelected: 0,
618
- predefinedFiltersMatchLapse: [],
619
- predefinedFiltersPlayingAs: [],
620
- predefinedFiltersSections: [],
621
- updateTables: 0,
622
- updateTablesfull: 0,
623
- optionSelected: 'Jugadores',
624
- optionSelectedSubmenu: 'Todas las jugadas',
625
- tournamentsUrl: 'https://17zyhpyc7c.execute-api.us-west-2.amazonaws.com/prod/tournaments',
626
- teamsUrl: 'https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/',
627
- urlFilter:
628
- 'https://cqqxaonvm6.execute-api.us-east-2.amazonaws.com/prod/gs2/tops/filters?categories=',
629
- retries: 3,
630
- teams: [],
631
- updateFilterGolstats: 0,
632
- updateFilterPlaytypesGolstats: 0,
633
- arrayTournaments: [],
634
- arraySeasons: {},
635
- seasonBytournament: [],
636
- filtersTypes: filtersTypes,
637
- token:
638
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE',
639
- fVnationalities: new Set(),
640
- fVzone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
641
- fVplayingAs: [1, 2],
642
- fVsections: [1, 2, 3, 4, 5, 6],
643
- fVmatchResult: [1, 2, 3],
644
- fVarrayAgeRange: [10, 40],
645
- FVeligible: [],
646
- FVYear: 1900,
647
- fVtypeZone: 2,
648
- fVsetPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
649
- currentIndex: -1,
650
- delay: 800,
651
- tournamentSelected: 0,
652
- tournamentSelectedObj: {},
653
- FVfilterGolstats: [],
654
- updateFilterField: 0,
655
- openMenuMobil: false,
656
- selectedTournament: { seasons: [] },
657
- selectedSeasonObj: {},
658
- }
659
- },
660
- methods: {
661
- getnameshort(namePlayerShort) {
662
- var NameArrayHomeBench = namePlayerShort.split(',')
663
- var lastArrayNameBench = NameArrayHomeBench[0].split(' ')
664
- var ArrayNameBench = NameArrayHomeBench[1].trim().split(' ')
665
- var lastNameHomeBench = ''
666
- if (lastArrayNameBench.length == 2 || lastArrayNameBench.length == 1) {
667
- if (lastArrayNameBench[0].length < 4) {
668
- lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
669
- } else {
670
- lastNameHomeBench = lastArrayNameBench[0]
671
- }
672
- } else {
673
- if (lastArrayNameBench.length == 3) {
674
- lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
675
- } else {
676
- if (lastArrayNameBench.length == 4) {
677
- lastNameHomeBench =
678
- lastArrayNameBench[1] + ' ' + lastArrayNameBench[2] + ' ' + lastArrayNameBench[3]
679
- }
680
- }
681
- }
682
- var nameHomeBench =
683
- ArrayNameBench[ArrayNameBench.length - 1] != ''
684
- ? ArrayNameBench[ArrayNameBench.length - 1].charAt(0)
685
- : ArrayNameBench[ArrayNameBench.length - 2]
686
- ? ArrayNameBench[ArrayNameBench.length - 2].charAt(0)
687
- : ''
688
- lastNameHomeBench = lastNameHomeBench.replace(',', '')
689
- return nameHomeBench + '. ' + lastNameHomeBench
690
- },
691
- setUpTournamentsToFilter() {
692
- this.tournamentsToFilter.forEach((tournament) => {
693
- const isSameTournament = tournament.id === this.selectedTournament.id
694
- tournament.isSelected = isSameTournament
695
- tournament.isDefaultTournament = isSameTournament
696
- })
697
- },
698
- async onClickDeleteFilter() {
699
- if (this.optionSelectedSubmenu == 'Predeterminados') {
700
- this.resetPredefinedTeamAll()
701
- } else {
702
- this.arrayFiltersPlays = []
703
- setTimeout(() => {
704
- // Reset completado
705
- }, 200)
706
- }
707
- },
708
- clickOpenFilters() {
709
- this.showfiltersPc = true
710
- },
711
- clickCloseFilters() {
712
- this.showfiltersPc = false
713
- },
714
- async selectedSeason(season) {
715
- if (this.seasonActive !== season.id) {
716
- this.seasonActive = season.id
717
- this.resetPredefinedTeamAll()
718
- this.$emit('change-season-id', season.id)
719
- }
720
- },
721
- changeTournament(tournament) {
722
- if (tournament.id !== this.selectedTournament.id) {
723
- this.selectedTournament = tournament
724
- this.tournamentSelectedObj = { propName: 'id', value: tournament.id }
725
- this.teamselect = 0
726
- this.resetPredefinedTeamAll() //resetpredeterminados
727
- this.setUpTournamentsToFilter()
728
- }
729
- },
730
- changeTournamentMovil(item) {
731
- this.tournamentSelectedObj = { propName: 'id', value: item.id }
732
- this.seasonBytournament = item.seasons
733
- this.teamselect = 0
734
- },
735
- selectedSeasonMovil(item) {
736
- this.seasonActive = item.id
737
- },
738
- setRelevantCategoriesPlayer(positionId) {
739
- return positionId === 1
740
- ? [39, 40, 52, 53, 54, 55, 323, 324, 608, 774, 802]
741
- : [
742
- 10, 12, 14, 15, 27, 35, 61, 217, 257, 466, 519, 607, 702, 730, 98, 101, 109, 112, 121,
743
- 122, 127, 128, 135, 136, 141, 142, 161, 170, 179, 211, 232, 235, 239, 242, 282, 284,
744
- 289, 291, 296, 485, 486, 487, 488,
745
- ]
746
- },
747
-
748
- setOpenMedia(data) {
749
- this.$emit('openmedia', data)
750
- },
751
-
752
- setMediaData(data) {
753
- const videoPlayerSection = 1
754
- const playerType = 2
755
- const playListType = playerType
756
- let playerIds = [data.id]
757
- let teamId = data.team_id
758
- const jsonConfig = {
759
- seasonId: data.season_id,
760
- // seasons: data.seasons,
761
- isFeaturedPlayers: false,
762
- mainSectionType: videoPlayerSection,
763
- playListType: playListType,
764
- gameIds: null,
765
- playerIds: playerIds,
766
- goalkeeperIds: [],
767
- categoryIds: this.setRelevantCategoriesPlayer(data.position),
768
- teamId: teamId || 0,
769
- matchResult: [1, 2, 3],
770
- categorySingleName: '',
771
- isRivalSubject: false,
772
- avoidCategorySingleName: false,
773
- currentPlayIndex: 0,
774
- playData: null,
775
- lastClashedGameId: null,
776
- tournamentsLastClashes: null,
777
- advancedFilter: {
778
- playListTitle: 'Jugadas Relevantes',
779
- },
780
- }
781
- this.$emit('openmedia', jsonConfig)
782
- },
783
- clickprofile(data) {
784
- if (data.isTeam) {
785
- this.$emit('openProfileTeam', { teamId: data.id, seasonId: this.seasonActive })
786
- } else {
787
- this.$emit('openProfilePlayer', {
788
- playerId: data.id,
789
- teamId: data.teamId,
790
- seasonId: this.seasonActive,
791
- })
792
- }
793
- },
794
-
795
- viewprofile(data, seasonId, teamId) {
796
- this.$emit('openProfilePlayer', {
797
- playerId: data,
798
- teamId,
799
- seasonId: seasonId ? seasonId : this.seasonActive,
800
- })
801
- },
802
-
803
- openMenuFilters() {
804
- this.openMenuMobil = !this.openMenuMobil
805
- this.showfiltersPc = true
806
- },
807
- clickexpand() {
808
- // Método eliminado - relacionado con scouting
809
- },
810
- async getScoutingData() {
811
- this.arrayFiltersPlays = []
812
- this.loadingActive = true
813
-
814
- const axiosInstance = axios.create({ headers: { Authorization: `${this.token}` } })
815
- const { data } = await axiosInstance.post(
816
- 'https://eh9nhj69z7.execute-api.us-west-2.amazonaws.com/prod/players/productivity',
817
- this.filterScounting,
818
- { headers: { 'Content-Type': 'application/json' } },
819
- )
820
-
821
- if (this.filterScounting.tournaments.length > 0) {
822
- var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
823
- (objeto) => objeto.type === 'onFiltersTournaments',
824
- )
825
- if (indiceFilterOnPlays !== -1) {
826
- this.arrayFiltersPlays[indiceFilterOnPlays].name =
827
- this.filterScounting.tournaments.length > 1
828
- ? 'Ligas ' + this.filterScounting.tournaments.length
829
- : this.nameLeagueSelected != ''
830
- ? this.nameLeagueSelected
831
- : 'Liga MX'
832
- } else {
833
- this.arrayFiltersPlays.push({
834
- name:
835
- this.filterScounting.tournaments.length > 1
836
- ? 'Ligas ' + this.filterScounting.tournaments.length
837
- : this.nameLeagueSelected != ''
838
- ? this.nameLeagueSelected
839
- : 'Liga MX',
840
- type: 'onFiltersTournaments',
841
- })
842
- }
843
- }
844
-
845
- this.rowScoutingData = []
846
- for (let index = 0; index < data.length; index++) {
847
- const element = data[index]
848
- let arrayDateOfBirth = data[index].dob.split('T')
849
- let dateOfBirth = arrayDateOfBirth[0].split('-')
850
- var dataRow = {
851
- position: index + 1,
852
- player_name: this.abrevName(data[index].name),
853
- player_photo:
854
- 'https://golstatsimages.blob.core.windows.net/players-profile/' +
855
- data[index].player_id +
856
- '.png',
857
- total: data[index].total.toFixed(0),
858
- id: data[index].player_id,
859
- player_age: this.calcularEdad(data[index].dob),
860
- team_abrev: data[index].teams[0].acronym,
861
- team_name: data[index].teams[0].team_name,
862
- team_logo:
863
- 'https://golstatsimages.blob.core.windows.net/teams-80/' +
864
- data[index].teams[0].team_id +
865
- '.png',
866
- player_position: data[index].position_id,
867
- player_country_flag:
868
- 'https://golstatsimages.blob.core.windows.net/flags/' +
869
- data[index].nationality_id +
870
- '.jpg',
871
- date: dateOfBirth[2] + '.' + dateOfBirth[1] + '.' + dateOfBirth[0].substring(2, 4),
872
- team_id: data[index].team_id,
873
- nationality_name: nationalitiesCatalog[data[index].nationality_id],
874
- player_games: data[index].games_played,
875
- player_min: data[index].minutes_played,
876
- league_name: data[index].tournament_name,
877
- seasons: data[index].seasons,
878
- season_id: data[index].seasons[0],
879
- }
880
- this.rowScoutingData.push(dataRow)
881
- }
882
-
883
- if (this.seasonsFilterSelected != 0) {
884
- const datateams = await this.fetchTeamsScouting(this.seasonsFilterSelected)
885
- this.teamselect = 0
886
- this.teamselectrec = 0
887
- this.teamsscouting = []
888
- for (let index = 0; index < datateams.teams.length; index++) {
889
- this.teamsscouting.push({
890
- id: datateams.teams[index].team_id,
891
- team: datateams.teams[index].colloquial_name,
892
- logo: datateams.teams[index].logo,
893
- })
894
- }
895
- }
896
- this.loadingActive = false
897
- },
898
- abrevName(name) {
899
- var NameArrayHome = name.split(',')
900
- var lastArrayName = NameArrayHome[0].split(' ')
901
- var ArrayName = NameArrayHome[1].trim().split(' ')
902
- var lastNameHome = ''
903
- if (lastArrayName.length == 2 || lastArrayName.length == 1) {
904
- if (lastArrayName[0].length < 4) {
905
- lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
906
- } else {
907
- lastNameHome = lastArrayName[0]
908
- }
909
- } else {
910
- if (lastArrayName.length == 3) {
911
- lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
912
- } else {
913
- if (lastArrayName.length == 4) {
914
- lastNameHome = lastArrayName[1] + ' ' + lastArrayName[2] + ' ' + lastArrayName[3]
915
- }
916
- }
917
- }
918
- var nameHome =
919
- ArrayName[ArrayName.length - 1] != ''
920
- ? ArrayName[ArrayName.length - 1].charAt(0)
921
- : ArrayName[ArrayName.length - 2]
922
- ? ArrayName[ArrayName.length - 2].charAt(0)
923
- : ''
924
- lastNameHome = lastNameHome.replace(',', '')
925
- var abrevNamePlayerHome = nameHome + '. ' + lastNameHome
926
- return abrevNamePlayerHome
927
- },
928
- calcularEdad(fechaNacimiento) {
929
- // Parsea la fecha de nacimiento en formato "YYYY-MM-DD"
930
- var fechaNac = new Date(fechaNacimiento)
931
-
932
- // Obtiene la fecha actual
933
- var fechaActual = new Date()
934
-
935
- // Calcula la diferencia en milisegundos entre las dos fechas
936
- var diferencia = fechaActual - fechaNac
937
-
938
- // Convierte la diferencia de milisegundos a años
939
- var edadEnAnios = Math.floor(diferencia / (1000 * 60 * 60 * 24 * 365.25))
940
-
941
- return edadEnAnios
942
- },
943
- async onFiltersTournaments(ObjectFilter) {
944
- this.modifidFiltersFlag = true
945
- var data = []
946
- for (let index = 0; index < ObjectFilter.length; index++) {
947
- if (ObjectFilter[index].isSelected) {
948
- data.push(ObjectFilter[index].id)
949
- }
950
- }
951
- if (data.length == 0) {
952
- data = [1]
953
- }
954
- if (data.length == 1) {
955
- for (let index = 0; index < ObjectFilter.length; index++) {
956
- if (ObjectFilter[index].isSelected) {
957
- this.nameLeagueSelected = ObjectFilter[index].name
958
- this.seasonsFilterSelected = ObjectFilter[index].seasons[0].id
959
- }
960
- }
961
- } else {
962
- this.seasonsFilterSelected = 0
963
- if (data.length > 0) {
964
- this.nameLeagueSelected = data.length + ' Ligas'
965
- }
966
- }
967
- this.filterScounting.tournaments = data
968
- this.filterScounting.seasonId = ObjectFilter[0].seasons[0].id
969
- },
970
- onFiltersPersonalData(ObjectFilter) {
971
- this.modifidFiltersFlag = true
972
- if (ObjectFilter.hasOwnProperty('ageByRange')) {
973
- const min = ObjectFilter.ageByRange.min == 0 ? 10 : ObjectFilter.ageByRange.min
974
- const max = ObjectFilter.ageByRange.max == 0 ? 40 : ObjectFilter.ageByRange.max
975
- this.filterScounting.range_age = [min, max]
976
- this.filterScounting.age_or_year = 1
977
- } else {
978
- this.filterScounting.range_age = []
979
- }
980
- if (ObjectFilter.hasOwnProperty('year')) {
981
- this.filterScounting.year = ObjectFilter.year
982
- this.filterScounting.age_or_year = 0
983
- } else {
984
- this.filterScounting.year = 0
985
- }
986
-
987
- var dataNationalities = []
988
- if (ObjectFilter.hasOwnProperty('nationalities')) {
989
- for (let index = 0; index < ObjectFilter.nationalities.length; index++) {
990
- if (ObjectFilter.nationalities[index].isSelected) {
991
- dataNationalities.push(ObjectFilter.nationalities[index].id)
992
- }
993
- }
994
- if (dataNationalities.length == 0) {
995
- dataNationalities = [
996
- 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
997
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
998
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
999
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 221, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94,
1000
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
1001
- 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
1002
- 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
1003
- 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
1004
- 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
1005
- 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1006
- 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
1007
- 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
1008
- 233, 234, 236, 237, 239,
1009
- ]
1010
- }
1011
- }
1012
- this.filterScounting.elegibles = []
1013
- if (ObjectFilter.hasOwnProperty('eligibility')) {
1014
- this.filterScounting.elegibles = [ObjectFilter.eligibility[0].id]
1015
- }
1016
-
1017
- var dataPositions = []
1018
- for (let index = 0; index < ObjectFilter.positions.length; index++) {
1019
- if (ObjectFilter.positions[index].isSelected) {
1020
- dataPositions.push(ObjectFilter.positions[index].id)
1021
- }
1022
- }
1023
- if (dataPositions.length == 0) {
1024
- dataPositions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1025
- }
1026
- this.filterScounting.positions = dataPositions
1027
- this.filterScounting.nationalities = dataNationalities
1028
- },
1029
- onFiltersUniverse(ObjectFilter) {
1030
- this.modifidFiltersFlag = true
1031
- this.filterScounting.minutes_played = Number(ObjectFilter.minutesPlayed)
1032
- this.filterScounting.last_months = Number(ObjectFilter.lastMonths)
1033
- this.filterScounting.minutes_played_avg = Number(ObjectFilter.percentMinutesPlayed)
1034
- this.filterScounting.type_stats = ObjectFilter.statistics.averagePerGame
1035
- ? 3
1036
- : ObjectFilter.statistics.averagePerMinute
1037
- ? 2
1038
- : 1
1039
- },
1040
- onFiltersProductivity(ObjectFilter) {
1041
- this.modifidFiltersFlag = true
1042
- var dataCategories = []
1043
- for (let index = 0; index < ObjectFilter.productivityFilters.length; index++) {
1044
- dataCategories[ObjectFilter.productivityFilters[index].priority - 1] = {
1045
- name: ObjectFilter.productivityFilters[index].name,
1046
- ids: ObjectFilter.productivityFilters[index].id,
1047
- }
1048
- }
1049
- if (dataCategories.length == 0) {
1050
- dataCategories = [
1051
- /* { name: 'Goles', ids: [12] },
1052
- { name: 'Asistencias', ids: [10] },
1053
- { name: 'Participaciones en gol', ids: [27] },
1054
- { name: 'Cabeceos en área rival', ids: [330, 333, 423, 577, 578, 331, 334, 424] },
1055
- { name: 'Tiros a gol totales', ids: [91, 95, 92, 93, 96, 97] }*/
1056
- ]
1057
- }
1058
- this.filterScounting.categories = dataCategories
1059
- this.filterScounting.fouls = ObjectFilter.offensesConditions.areFoulsCommittedSelected
1060
- this.filterScounting.yellow_cards = ObjectFilter.offensesConditions.areYellowCardsSelected
1061
- this.filterScounting.red_cards = ObjectFilter.offensesConditions.areRedCardsSelected
1062
- },
1063
- onFiltersGolStats(ObjectFilter) {
1064
- if (ObjectFilter.length > 0) {
1065
- var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1066
- (objeto) => objeto.type === 'onFiltersPredefined',
1067
- )
1068
- if (indiceFilterOnPlays !== -1) {
1069
- this.arrayFiltersPlays[indiceFilterOnPlays].name = ObjectFilter[0].name
1070
- } else {
1071
- this.arrayFiltersPlays.push({ name: ObjectFilter[0].name, type: 'onFiltersPredefined' })
1072
- }
1073
- this.filtersPredefinedF = ObjectFilter[0].filters
1074
- } else {
1075
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1076
- (objeto) => objeto.type === 'onFiltersPredefined',
1077
- )
1078
- if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1079
- this.filtersPredefinedF = this.filters
1080
- for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1081
- this.FVfilterGolstats[index].isSelected = false
1082
- }
1083
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1084
- (objeto) => objeto.type === 'onFiltersPredefined',
1085
- )
1086
- if (indiceFilterOnPlaysAuxC !== -1) {
1087
- this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1088
- }
1089
- this.updateFilterGolstats += 1
1090
- }
1091
- }
1092
- },
1093
- shouldRender(index) {
1094
- // Check if the element at the given index should be rendered
1095
- return index <= this.currentIndex
1096
- },
1097
- renderNext() {
1098
- // Render the next element after a delay
1099
- this.currentIndex++
1100
- if (this.currentIndex < this.categoriesDefault.length) {
1101
- setTimeout(() => {
1102
- this.$nextTick(() => {
1103
- this.renderNext()
1104
- })
1105
- }, this.delay)
1106
- }
1107
- },
1108
- async onFiltersPlaysTypes(idplaytype) {
1109
- if (idplaytype.length > 0) {
1110
- this.categoryPredefinedActive = true
1111
- this.loadingActive = true
1112
- this.categoryPredefined = idplaytype[0].id
1113
-
1114
- var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1115
- (objeto) => objeto.type === 'onFiltersPredefined',
1116
- )
1117
-
1118
- if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1119
- this.FVfilterGolstats = []
1120
- this.filtersPredefinedF = {}
1121
-
1122
- this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1123
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1124
- (objeto) => objeto.type === 'onFiltersPredefined',
1125
- )
1126
-
1127
- if (indiceFilterOnPlaysAuxC !== -1) {
1128
- for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1129
- this.FVfilterGolstats[index].isSelected = false
1130
- }
1131
- if (indiceFilterOnPlaysAuxC !== -1) {
1132
- this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1133
- }
1134
- this.updateFilterGolstats += 1
1135
- }
1136
- }
1137
- this.updateTables += 1
1138
- setTimeout(() => {
1139
- this.loadingActive = false
1140
- }, 1000)
1141
- await this.getPredefinedfilters(idplaytype[0])
1142
- if (this.FVfilterGolstats.length > 0) {
1143
- this.onFiltersGolStats([this.FVfilterGolstats[0]])
1144
- this.FVfilterGolstats[0].isSelected = true
1145
- }
1146
- } else {
1147
- var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1148
- (objeto) => objeto.type === 'onFiltersPredefinedCategory',
1149
- )
1150
-
1151
- if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1152
- this.categoryPredefinedActive = false
1153
- this.categoryPredefined = 0
1154
- this.FVfilterGolstats = []
1155
- this.filtersPredefinedF = this.filters
1156
-
1157
- this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1158
- for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1159
- this.categoriesDefault[indexD].isSelected = false
1160
- }
1161
- this.updateFilterPlaytypesGolstats += 1
1162
- //filtro golstats
1163
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1164
- (objeto) => objeto.type === 'onFiltersPredefined',
1165
- )
1166
- if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1167
- for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1168
- this.FVfilterGolstats[index].isSelected = false
1169
- }
1170
- if (indiceFilterOnPlaysAuxC !== -1) {
1171
- this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1172
- }
1173
- this.updateFilterGolstats += 1
1174
- }
1175
- }
1176
- }
1177
- },
1178
- deleteCategoryFilter() {
1179
- this.categoryName = ''
1180
- this.showFullCategory = 0
1181
- this.showFullTable = false
1182
- //this.updateTables -= 1
1183
- delete this.filters.aux
1184
- },
1185
- onShowFullTable(data) {
1186
- this.categoryName = data.categoryName
1187
- this.showFullCategory = data.category
1188
- this.showFullTable = true
1189
- this.loadingActive = true
1190
- setTimeout(() => {
1191
- this.filters = {
1192
- zone: this.fVzone,
1193
- playingAs: this.fVplayingAs,
1194
- sections: this.fVsections,
1195
- matchResult: this.fVmatchResult,
1196
- arrayAgeRange: this.fVarrayAgeRange,
1197
- typeZone: this.fVtypeZone,
1198
- setNationalitiesIds: this.fVnationalities,
1199
- setPositionsIds: this.fVsetPositionsIds,
1200
- setYear: this.FVYear,
1201
- aux: this.getRandomNumber(1, 10000),
1202
- booleanAreNationalTeamsVisible: this.FVbooleanAreNationalTeamsVisible,
1203
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1204
- }
1205
- this.loadingActive = false
1206
- }, 1000)
1207
-
1208
- //this.updateTables += 1
1209
- },
1210
- getRandomNumber(min, max) {
1211
- return Math.floor(Math.random() * (max - min + 1)) + min
1212
- },
1213
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1214
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1215
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1216
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1217
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1218
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1219
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1220
- /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1221
- applyFiltersBtn(aplyval) {},
1222
- onFiltersPlays(plays) {
1223
- this.arrayCategoryFilter = []
1224
- this.arrayCategoryFilterFull = []
1225
- if (plays.playsCategories.length == 0) {
1226
- for (
1227
- let index = 0;
1228
- index < this.categoriesPlaysTypes.offensive.categories.length;
1229
- index++
1230
- ) {
1231
- this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offensive.categories[index].id)
1232
- this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1233
- }
1234
- for (
1235
- let index = 0;
1236
- index < this.categoriesPlaysTypes.defensive.categories.length;
1237
- index++
1238
- ) {
1239
- this.arrayCategoryFilter.push(this.categoriesPlaysTypes.defensive.categories[index].id)
1240
- this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1241
- }
1242
- for (
1243
- let index = 0;
1244
- index < this.categoriesPlaysTypes.possession.categories.length;
1245
- index++
1246
- ) {
1247
- this.arrayCategoryFilter.push(this.categoriesPlaysTypes.possession.categories[index].id)
1248
- this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1249
- }
1250
- for (let index = 0; index < this.categoriesPlaysTypes.offenses.categories.length; index++) {
1251
- this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offenses.categories[index].id)
1252
- this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1253
- }
1254
- } else {
1255
- for (let index = 0; index < plays.playsCategories.length; index++) {
1256
- if (plays.playsCategories[index].isSelected) {
1257
- this.arrayCategoryFilter.push(plays.playsCategories[index].id)
1258
- this.arrayCategoryFilterFull.push(plays.playsCategories[index])
1259
- }
1260
- }
1261
- }
1262
- var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1263
- (objeto) => objeto.type === 'onFiltersPlays',
1264
- )
1265
- if (this.arrayCategoryFilter.length > 0 && this.arrayCategoryFilter.length != 23) {
1266
- if (this.arrayCategoryFilter.length == 1) {
1267
- if (indiceFilterOnPlays != -1) {
1268
- this.arrayFiltersPlays[indiceFilterOnPlays].name = this.arrayCategoryFilterFull[0].name
1269
- } else {
1270
- this.arrayFiltersPlays.push({
1271
- name: this.arrayCategoryFilterFull[0].name,
1272
- type: 'onFiltersPlays',
1273
- })
1274
- }
1275
- } else {
1276
- if (indiceFilterOnPlays != -1) {
1277
- this.arrayFiltersPlays[indiceFilterOnPlays].name =
1278
- this.arrayCategoryFilterFull.length + ' Tipos de jugadas'
1279
- } else {
1280
- this.arrayFiltersPlays.push({
1281
- name: this.arrayCategoryFilterFull.length + ' Tipos de jugadas',
1282
- type: 'onFiltersPlays',
1283
- })
1284
- }
1285
- }
1286
- } else {
1287
- if (indiceFilterOnPlays !== -1) {
1288
- this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1289
- }
1290
- }
1291
- },
1292
- async deleteLabelFilter(deleteFilterValID) {
1293
- var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1294
- (objeto) => objeto.type === deleteFilterValID,
1295
- )
1296
- if (indiceFilterOnPlays !== -1) {
1297
- if (deleteFilterValID == 'onFiltersTournaments') {
1298
- this.arrayFiltersPlays = []
1299
- setTimeout(() => {
1300
- // Reset completado
1301
- }, 200)
1302
- }
1303
- if (deleteFilterValID == 'onFiltersPlays') {
1304
- for (
1305
- let index = 0;
1306
- index < this.categoriesPlaysTypes.offensive.categories.length;
1307
- index++
1308
- ) {
1309
- this.categoriesPlaysTypes.offensive.categories[index].isSelected = true
1310
- }
1311
- for (
1312
- let index = 0;
1313
- index < this.categoriesPlaysTypes.defensive.categories.length;
1314
- index++
1315
- ) {
1316
- this.categoriesPlaysTypes.defensive.categories[index].isSelected = true
1317
- this.arrayCategoryFilter.push()
1318
- this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1319
- }
1320
- for (
1321
- let index = 0;
1322
- index < this.categoriesPlaysTypes.possession.categories.length;
1323
- index++
1324
- ) {
1325
- this.categoriesPlaysTypes.possession.categories[index].isSelected = true
1326
- }
1327
- for (
1328
- let index = 0;
1329
- index < this.categoriesPlaysTypes.offenses.categories.length;
1330
- index++
1331
- ) {
1332
- this.categoriesPlaysTypes.offenses.categories[index].isSelected = true
1333
- }
1334
- }
1335
- if (deleteFilterValID == 'onFiltersField') {
1336
- this.fVzone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1337
-
1338
- this.filters = {
1339
- zone: this.fVzone,
1340
- playingAs: this.fVplayingAs,
1341
- sections: this.fVsections,
1342
- matchResult: this.fVmatchResult,
1343
- arrayAgeRange: this.fVarrayAgeRange,
1344
- typeZone: this.fVtypeZone,
1345
- setNationalitiesIds: this.fVnationalities,
1346
- setPositionsIds: this.fVsetPositionsIds,
1347
- setYear: this.FVYear,
1348
- booleanAreNationalTeamsVisible: false,
1349
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1350
- }
1351
- }
1352
- if (deleteFilterValID == 'onFiltersPredefined') {
1353
- this.filtersPredefinedF = this.filters
1354
- for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1355
- this.FVfilterGolstats[index].isSelected = false
1356
- }
1357
- this.updateFilterGolstats += 1
1358
- this.resetPredefinedTeamAll()
1359
- }
1360
- if (deleteFilterValID == 'onFiltersPredefinedCategory') {
1361
- this.categoryPredefinedActive = false
1362
- this.categoryPredefined = 0
1363
- this.FVfilterGolstats = []
1364
- this.filtersPredefinedF = this.filters
1365
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1366
- (objeto) => objeto.type === 'onFiltersPredefined',
1367
- )
1368
- if (indiceFilterOnPlaysAuxC !== -1) {
1369
- this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1370
- }
1371
- for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1372
- this.categoriesDefault[indexD].isSelected = false
1373
- }
1374
- this.updateFilterPlaytypesGolstats += 1
1375
- }
1376
- if (deleteFilterValID == 'onFiltersDetailsTime') {
1377
- this.detailsObject.gameSections[0].isSelected = true
1378
- this.detailsObject.gameSections[1].isSelected = true
1379
- this.detailsObject.gameSections[2].isSelected = true
1380
- this.detailsObject.gameSections[3].isSelected = true
1381
- this.detailsObject.gameSections[4].isSelected = true
1382
- this.detailsObject.gameSections[5].isSelected = true
1383
- this.fVsections = [1, 2, 3, 4, 5, 6]
1384
-
1385
- this.filters = {
1386
- zone: this.fVzone,
1387
- playingAs: this.fVplayingAs,
1388
- sections: this.fVsections,
1389
- matchResult: this.fVmatchResult,
1390
- arrayAgeRange: this.fVarrayAgeRange,
1391
- typeZone: this.fVtypeZone,
1392
- setNationalitiesIds: this.fVnationalities,
1393
- setPositionsIds: this.fVsetPositionsIds,
1394
- setYear: this.FVYear,
1395
- booleanAreNationalTeamsVisible: false,
1396
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1397
- }
1398
- }
1399
- if (deleteFilterValID == 'onFiltersDetailsPlayingAs') {
1400
- this.detailsObject.playingAs[0].isSelected = true
1401
- this.detailsObject.playingAs[1].isSelected = true
1402
- this.fVplayingAs = [1, 2]
1403
- this.filters = {
1404
- zone: this.fVzone,
1405
- playingAs: this.fVplayingAs,
1406
- sections: this.fVsections,
1407
- matchResult: this.fVmatchResult,
1408
- arrayAgeRange: this.fVarrayAgeRange,
1409
- typeZone: this.fVtypeZone,
1410
- setNationalitiesIds: this.fVnationalities,
1411
- setPositionsIds: this.fVsetPositionsIds,
1412
- setYear: this.FVYear,
1413
- booleanAreNationalTeamsVisible: false,
1414
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1415
- }
1416
- }
1417
- if (deleteFilterValID == 'onFiltersNationality') {
1418
- this.fVnationalities.add(138)
1419
- this.fVnationalities.add(222)
1420
- this.fVnationalities.add(163)
1421
- this.fVnationalities.add(51)
1422
- this.fVnationalities.add(226)
1423
- this.fVnationalities.add(10)
1424
- this.fVnationalities.add(223)
1425
- this.fVnationalities.add(96)
1426
- this.fVnationalities.add(171)
1427
- this.fVnationalities.add(198)
1428
- this.fVnationalities.add(105)
1429
- this.fVnationalities.add(80)
1430
- this.fVnationalities.add(29)
1431
- this.fVnationalities.add(74)
1432
- this.fVnationalities.add(216)
1433
- this.fVnationalities.add(196)
1434
- this.fVnationalities.add(64)
1435
- this.fVnationalities.add(155)
1436
- this.fVnationalities.add(156)
1437
- this.fVnationalities.add(89)
1438
- this.fVnationalities.add(106)
1439
- this.fVnationalities.add(81)
1440
- this.fVnationalities.add(233)
1441
- this.fVnationalities.add(204)
1442
- this.filters = {
1443
- zone: this.fVzone,
1444
- playingAs: this.fVplayingAs,
1445
- sections: this.fVsections,
1446
- matchResult: this.fVmatchResult,
1447
- arrayAgeRange: this.fVarrayAgeRange,
1448
- typeZone: this.fVtypeZone,
1449
- setNationalitiesIds: this.fVnationalities,
1450
- setPositionsIds: this.fVsetPositionsIds,
1451
- setYear: this.FVYear,
1452
- booleanAreNationalTeamsVisible: false,
1453
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1454
- }
1455
- const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1456
- personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.NATIONALITY)
1457
- }
1458
- if (deleteFilterValID == 'onFiltersPosition') {
1459
- this.fVsetPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1460
- this.filters = {
1461
- zone: this.fVzone,
1462
- playingAs: this.fVplayingAs,
1463
- sections: this.fVsections,
1464
- matchResult: this.fVmatchResult,
1465
- arrayAgeRange: this.fVarrayAgeRange,
1466
- typeZone: this.fVtypeZone,
1467
- setNationalitiesIds: this.fVnationalities,
1468
- setPositionsIds: this.fVsetPositionsIds,
1469
- setYear: this.FVYear,
1470
- booleanAreNationalTeamsVisible: false,
1471
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1472
- }
1473
- const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1474
- personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.POSITION)
1475
- }
1476
- if (deleteFilterValID == 'onFiltersAge') {
1477
- this.fVarrayAgeRange = [10, 40]
1478
- this.filters = {
1479
- zone: this.fVzone,
1480
- playingAs: this.fVplayingAs,
1481
- sections: this.fVsections,
1482
- matchResult: this.fVmatchResult,
1483
- arrayAgeRange: this.fVarrayAgeRange,
1484
- typeZone: this.fVtypeZone,
1485
- setNationalitiesIds: this.fVnationalities,
1486
- setPositionsIds: this.fVsetPositionsIds,
1487
- setYear: this.FVYear,
1488
- booleanAreNationalTeamsVisible: false,
1489
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1490
- }
1491
- const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1492
- personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.AGE_RANGE)
1493
- }
1494
- if (deleteFilterValID == 'onFiltersElegibility') {
1495
- const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1496
- personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.ELIGIBILITY)
1497
- }
1498
- if (deleteFilterValID == 'onFiltersYear') {
1499
- const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1500
- personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.YEAR)
1501
- this.FVYear = 1900
1502
- this.filters = {
1503
- zone: this.fVzone,
1504
- playingAs: this.fVplayingAs,
1505
- sections: this.fVsections,
1506
- matchResult: this.fVmatchResult,
1507
- arrayAgeRange: this.fVarrayAgeRange,
1508
- typeZone: this.fVtypeZone,
1509
- setNationalitiesIds: this.fVnationalities,
1510
- setPositionsIds: this.fVsetPositionsIds,
1511
- setYear: this.FVYear,
1512
- booleanAreNationalTeamsVisible: false,
1513
- setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1514
- }
1515
- }
1516
- }
1517
-
1518
- this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1519
- },
1520
- clickAll() {
1521
- // Método eliminado - relacionado con scouting
1522
- },
1523
- clickAllAll() {
1524
- // Método eliminado - relacionado con scouting
1525
- },
1526
- clickTeam() {
1527
- // Método eliminado - relacionado con scouting
1528
- },
1529
- clickTeamScouting() {
1530
- // Método eliminado - relacionado con scouting
1531
- },
1532
- resetFilterTeamAndPlayers() {
1533
- this.filters = {
1534
- zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
1535
- playingAs: [1, 2],
1536
- sections: [1, 2, 3, 4, 5, 6],
1537
- matchResult: [1, 2, 3],
1538
- arrayAgeRange: [1, 60],
1539
- typeZone: 1,
1540
- setNationalitiesIds: this.setNationalitiesIds, //PROBABELMENTE SE OCUPE LLENAR
1541
- setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9], //PROBABELMENTE SE OCUPE LLENAR
1542
- setYear: this.FVYear,
1543
- booleanAreNationalTeamsVisible: false,
1544
- setAvailableNationalTeamsPlayersIds: new Set(),
1545
- }
1546
- },
1547
- async changeTabsGeneral(idchange) {
1548
- this.resetPredefinedTeamAll()
1549
- this.showfiltersPc = true
1550
- this.optionSelected = idchange
1551
- this.optionSelectedSubmenu = 'Todas las jugadas'
1552
- this.filtersPredefinedF = {}
1553
- this.categoryPredefinedActive = false
1554
- this.categoryPredefined = 0
1555
- if (idchange == 'Equipos') {
1556
- this.typeTable = 1
1557
- this.isTeam = true
1558
- this.updateTables += 1
1559
- this.arrayFiltersPlays = []
1560
- this.teamselect = 0
1561
- this.resetFilterTeamAndPlayers()
1562
- }
1563
- if (idchange == 'Jugadores') {
1564
- this.typeTable = 0
1565
- this.isTeam = false
1566
- this.teamselect = 0
1567
- this.updateTables += 1
1568
- this.resetFilterTeamAndPlayers()
1569
- }
1570
- },
1571
- resetPredefinedTeamAll() {
1572
- var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1573
- (objeto) => objeto.type === 'onFiltersPredefined',
1574
- )
1575
-
1576
- if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1577
- this.categoryPredefinedActive = false
1578
- this.categoryPredefined = 0
1579
- this.FVfilterGolstats = []
1580
- this.filtersPredefinedF = {}
1581
-
1582
- this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1583
- for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1584
- this.categoriesDefault[indexD].isSelected = false
1585
- }
1586
- this.updateFilterPlaytypesGolstats += 1
1587
- //filtro golstats
1588
- var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1589
- (objeto) => objeto.type === 'onFiltersPredefined',
1590
- )
1591
-
1592
- if (indiceFilterOnPlaysAuxC !== -1) {
1593
- for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1594
- this.FVfilterGolstats[index].isSelected = false
1595
- }
1596
- if (indiceFilterOnPlaysAuxC !== -1) {
1597
- this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1598
- }
1599
- this.updateFilterGolstats += 1
1600
- }
1601
- }
1602
- },
1603
- changeTabsSubmenu(idchange) {
1604
- if (idchange != 'Predeterminados') {
1605
- this.resetPredefinedTeamAll()
1606
- } else {
1607
- this.arrayFiltersPlays = []
1608
- }
1609
-
1610
- this.optionSelectedSubmenu = idchange
1611
- },
1612
-
1613
- async fetchTournaments() {
1614
- const axiosInstance = axios.create({
1615
- headers: {
1616
- Authorization: `${this.token}`,
1617
- },
1618
- })
1619
- const { data } = await axiosInstance.get(this.tournamentsUrl)
1620
- return data
1621
- },
1622
- async fetchTeams() {
1623
- const axiosInstance = axios.create({
1624
- headers: {
1625
- Authorization: `${this.token}`,
1626
- },
1627
- })
1628
- const { data } = await axiosInstance.get(this.teamsUrl + this.seasonActive)
1629
- return data
1630
- },
1631
- async fetchTeamsScouting(season) {
1632
- const axiosInstance = axios.create({
1633
- headers: {
1634
- Authorization: `${this.token}`,
1635
- },
1636
- })
1637
- const { data } = await axiosInstance.get(this.teamsUrl + season)
1638
- return data
1639
- },
1640
- async getPredefinedfilters(category) {
1641
- this.arrayPredefinedFilters = []
1642
- this.arrayPredefinedOrigin = []
1643
- var url = ''
1644
- if (category.id == 1) {
1645
- url = this.urlFilter
1646
- } else {
1647
- url = this.urlFilter
1648
- }
1649
-
1650
- const axiosInstance = axios.create({
1651
- headers: {
1652
- Authorization: `${this.token}`,
1653
- },
1654
- })
1655
- const { data } = await axiosInstance.get(url + category.id)
1656
- Object.keys(data[0].match_lapse_combinations).forEach((key) => {
1657
- this.predefinedFiltersMatchLapse[key.toString()] = data[0].match_lapse_combinations[key]
1658
- })
1659
- Object.keys(data[0].playing_as_combinations).forEach((key) => {
1660
- this.predefinedFiltersPlayingAs[key.toString()] = data[0].playing_as_combinations[key]
1661
- })
1662
- Object.keys(data[0].field_sections_combinations).forEach((key) => {
1663
- this.predefinedFiltersSections[key.toString()] = data[0].field_sections_combinations[key]
1664
- })
1665
- if (data[0]) {
1666
- for (let indexRecord = 0; indexRecord < data[0].filter_records.length; indexRecord++) {
1667
- var filterText = data[0].description
1668
-
1669
- if (data[0].filter_records[indexRecord].field_sections !== undefined) {
1670
- const filterFieldSearch = data[0].filter_records[indexRecord].field_sections.toString()
1671
- if (
1672
- this.predefinedFiltersSections[filterFieldSearch] ||
1673
- this.predefinedFiltersSections[filterFieldSearch] == ''
1674
- ) {
1675
- if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1676
- filterText = filterText.replace(
1677
- ' [en {field_sections}]',
1678
- this.predefinedFiltersSections[filterFieldSearch],
1679
- )
1680
- } else {
1681
- filterText = filterText.replace(
1682
- '{field_sections}',
1683
- this.predefinedFiltersSections[filterFieldSearch],
1684
- )
1685
- }
1686
- }
1687
- }
1688
- if (data[0].filter_records[indexRecord].match_lapse !== undefined) {
1689
- const filterMatchSearch = data[0].filter_records[indexRecord].match_lapse.toString()
1690
- if (
1691
- this.predefinedFiltersMatchLapse[filterMatchSearch] ||
1692
- this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
1693
- ) {
1694
- if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
1695
- filterText = filterText.replace(
1696
- ' [durante {match_lapse}]',
1697
- this.predefinedFiltersMatchLapse[filterMatchSearch],
1698
- )
1699
- } else {
1700
- filterText = filterText.replace(
1701
- '{match_lapse}',
1702
- this.predefinedFiltersMatchLapse[filterMatchSearch],
1703
- )
1704
- }
1705
- }
1706
- }
1707
- if (data[0].filter_records[indexRecord].playing_as !== undefined) {
1708
- const filterPlayingAsSearch = data[0].filter_records[indexRecord].playing_as.toString()
1709
- if (
1710
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
1711
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
1712
- ) {
1713
- if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
1714
- filterText = filterText.replace(
1715
- ' [jugando como {playing_as}]',
1716
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1717
- )
1718
- } else {
1719
- filterText = filterText.replace(
1720
- '{playing_as}',
1721
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1722
- )
1723
- }
1724
- }
1725
- }
1726
- if (data[0].filter_records[indexRecord].section_type !== undefined) {
1727
- if (this.optionSelected == 'Jugadores') {
1728
- filterText = filterText.replace('{section_type}', 'Jugadores')
1729
- } else {
1730
- filterText = filterText.replace('{section_type}', 'Equipos')
1731
- }
1732
- }
1733
-
1734
- filterText = filterText.replace(/\[/g, '')
1735
- filterText = filterText.replace(/\]/g, '')
1736
- filterText = filterText.replace('{category_name}', data[0].category_name)
1737
- const filterNameItem = filterText.split(': ')
1738
- var textFinal = filterNameItem[1]
1739
- if (textFinal.length > 129 && this.windowWidth > 1358) {
1740
- textFinal = textFinal.substring(0, 129)
1741
- textFinal =
1742
- textFinal +
1743
- "<span id='showIDtootip' class='dots' style='width: 100px; height: 20px; background: red; z-index: 6;'" +
1744
- '>...</span>'
1745
- }
1746
-
1747
- if (!this.isCup || data[0].filter_records[indexRecord].playing_as.length === 2) {
1748
- this.arrayPredefinedFilters.push({
1749
- id: indexRecord,
1750
- category_name: category.name,
1751
- id_category: data[0].id,
1752
- title: filterNameItem[0] + ':',
1753
- text: filterNameItem[1],
1754
- textOrigin: data[0].description,
1755
- titledots: textFinal,
1756
- filtersPredefined: {
1757
- matchResult: data[0].filter_records[indexRecord].match_result,
1758
- playingAs: data[0].filter_records[indexRecord].playing_as,
1759
- sections: data[0].filter_records[indexRecord].match_lapse,
1760
- type: this.optionSelected == 'Equipos' ? 2 : 1,
1761
- typeZone: data[0].type_zone,
1762
- zone: data[0].filter_records[indexRecord].field_sections,
1763
- end_age: 0,
1764
- start_age: 0,
1765
- nationalities: [],
1766
- elegible: [],
1767
- positions: [],
1768
- },
1769
- })
1770
- }
1771
- }
1772
-
1773
- var arrayFVfilterGolstats = []
1774
- for (let index = 0; index < this.arrayPredefinedFilters.length; index++) {
1775
- var numfilterApply = 0
1776
- var nations = new Set()
1777
- var objectFilterApply = {}
1778
-
1779
- var TextFinalSub = this.arrayPredefinedFilters[index].text.replace(/\*.*?\*/, '')
1780
- TextFinalSub = TextFinalSub.replace(/\*/g, '')
1781
- TextFinalSub = TextFinalSub.replace(/ +/g, ' ')
1782
- if (this.arrayPredefinedFilters[index].filtersPredefined.elegible.length > 0) {
1783
- numfilterApply += 1
1784
- }
1785
- if (
1786
- this.arrayPredefinedFilters[index].filtersPredefined.end_age.length != 0 ||
1787
- this.arrayPredefinedFilters[index].filtersPredefined.start_age.length != 0
1788
- ) {
1789
- numfilterApply += 1
1790
- }
1791
- if (
1792
- this.arrayPredefinedFilters[index].filtersPredefined.end_age != 0 &&
1793
- this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0
1794
- ) {
1795
- objectFilterApply.arrayAgeRange = [
1796
- this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1797
- this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1798
- ]
1799
- } else {
1800
- if (
1801
- this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0 &&
1802
- this.arrayPredefinedFilters[index].filtersPredefined.start_age == 0
1803
- ) {
1804
- objectFilterApply.arrayAgeRange = [1, 60]
1805
- } else {
1806
- if (
1807
- this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0 &&
1808
- this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0
1809
- ) {
1810
- objectFilterApply.arrayAgeRange = [
1811
- this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1812
- 60,
1813
- ]
1814
- } else {
1815
- objectFilterApply.arrayAgeRange = [
1816
- 1,
1817
- this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1818
- ]
1819
- }
1820
- }
1821
- }
1822
- if (this.arrayPredefinedFilters[index].filtersPredefined.matchResult.length != 3) {
1823
- numfilterApply += 1
1824
- }
1825
- objectFilterApply.matchResult =
1826
- this.arrayPredefinedFilters[index].filtersPredefined.matchResult
1827
- if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length > 0) {
1828
- numfilterApply += 1
1829
- }
1830
- if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length != 0) {
1831
- for (
1832
- let indexNA = 0;
1833
- indexNA < this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length;
1834
- indexNA++
1835
- ) {
1836
- nations.add(
1837
- this.arrayPredefinedFilters[index].filtersPredefined.nationalities[indexNA],
1838
- )
1839
- }
1840
- objectFilterApply.setNationalitiesIds = nations
1841
- } else {
1842
- nations.add(138)
1843
- nations.add(222)
1844
- nations.add(163)
1845
- nations.add(51)
1846
- nations.add(226)
1847
- nations.add(10)
1848
- nations.add(223)
1849
- nations.add(96)
1850
- nations.add(171)
1851
- nations.add(198)
1852
- nations.add(105)
1853
- nations.add(80)
1854
- nations.add(29)
1855
- nations.add(74)
1856
- nations.add(216)
1857
- nations.add(196)
1858
- nations.add(64)
1859
- nations.add(155)
1860
- nations.add(156)
1861
- nations.add(89)
1862
- nations.add(106)
1863
- nations.add(81)
1864
- nations.add(233)
1865
- nations.add(204)
1866
- objectFilterApply.setNationalitiesIds = nations
1867
- }
1868
- if (this.arrayPredefinedFilters[index].filtersPredefined.playingAs.length != 2) {
1869
- numfilterApply += 1
1870
- }
1871
- objectFilterApply.playingAs =
1872
- this.arrayPredefinedFilters[index].filtersPredefined.playingAs
1873
- if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1874
- numfilterApply += 1
1875
- }
1876
- if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1877
- objectFilterApply.setPositionsIds =
1878
- this.arrayPredefinedFilters[index].filtersPredefined.positions
1879
- } else {
1880
- objectFilterApply.setPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1881
- }
1882
- if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length != 6) {
1883
- numfilterApply += 1
1884
- }
1885
- if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length > 0) {
1886
- objectFilterApply.sections =
1887
- this.arrayPredefinedFilters[index].filtersPredefined.sections
1888
- } else {
1889
- objectFilterApply.sections = [1, 2, 3, 4, 5, 6]
1890
- }
1891
- if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length != 16) {
1892
- numfilterApply += 1
1893
- }
1894
- if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length > 0) {
1895
- objectFilterApply.zone = this.arrayPredefinedFilters[index].filtersPredefined.zone
1896
- } else {
1897
- objectFilterApply.zone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1898
- }
1899
- objectFilterApply.typeZone = this.arrayPredefinedFilters[index].filtersPredefined.typeZone
1900
- arrayFVfilterGolstats.push({
1901
- id: index + 1,
1902
- name: TextFinalSub,
1903
- isSelected: false,
1904
- value: numfilterApply,
1905
- filters: objectFilterApply,
1906
- })
1907
- }
1908
- this.FVfilterGolstats = arrayFVfilterGolstats
1909
- this.updateFilterGolstats += 1
1910
- this.arrayPredefinedOrigin = JSON.parse(JSON.stringify(this.arrayPredefinedFilters))
1911
- }
1912
- },
1913
- getTextFilterPredefinedCustom() {
1914
- this.setDinamicFilters(this.filterEmitAux)
1915
-
1916
- var filterTextCustom =
1917
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].textOrigin
1918
-
1919
- const filterFieldSearch = this.arrayPredefinedFilters[
1920
- this.indexPredefinedFiltersSelected
1921
- ].filtersPredefined.zone
1922
- .sort((a, b) => a - b)
1923
- .toString()
1924
-
1925
- if (
1926
- this.predefinedFiltersSections[filterFieldSearch] ||
1927
- this.predefinedFiltersSections[filterFieldSearch] == ''
1928
- ) {
1929
- if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1930
- filterTextCustom = filterTextCustom.replace(
1931
- ' [en {field_sections}]',
1932
- this.predefinedFiltersSections[filterFieldSearch],
1933
- )
1934
- } else {
1935
- filterTextCustom = filterTextCustom.replace(
1936
- '{field_sections}',
1937
- this.predefinedFiltersSections[filterFieldSearch],
1938
- )
1939
- }
1940
- } else {
1941
- filterTextCustom = filterTextCustom.replace(
1942
- '{field_sections}',
1943
- this.predefinedFiltersSections['other'],
1944
- )
1945
- }
1946
- var flagPosi = false
1947
- if (
1948
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1949
- .nationalities.size > 0
1950
- ) {
1951
- if (
1952
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1953
- .nationalities.size == this.setNationalityIds.size
1954
- ) {
1955
- filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1956
- filterTextCustom = filterTextCustom.replace(
1957
- '[de las nacionalidades y posiciones seleccionadas]',
1958
- '',
1959
- )
1960
- filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1961
- } else {
1962
- if (
1963
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1964
- .nationalities.size == 1
1965
- ) {
1966
- filterTextCustom = filterTextCustom.replace(
1967
- '[{nationality}]',
1968
- this.$t(
1969
- `gentilicios[${
1970
- [
1971
- ...this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected]
1972
- .filtersPredefined.nationalities,
1973
- ][0]
1974
- }]`,
1975
- ),
1976
- )
1977
- filterTextCustom = filterTextCustom.replace(
1978
- '[de las nacionalidades y posiciones seleccionadas]',
1979
- '',
1980
- )
1981
- filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1982
- } else {
1983
- if (
1984
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1985
- .positions.size > 0 &&
1986
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1987
- .positions.size != this.setPositionsIds.size
1988
- ) {
1989
- flagPosi = true
1990
- filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1991
- filterTextCustom = filterTextCustom.replace(
1992
- '[de las nacionalidades seleccionadas]',
1993
- '',
1994
- )
1995
- } else {
1996
- filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1997
- filterTextCustom = filterTextCustom.replace(
1998
- '[de las nacionalidades y posiciones seleccionadas]',
1999
- '',
2000
- )
2001
- }
2002
- }
2003
- }
2004
- } else {
2005
- filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
2006
- filterTextCustom = filterTextCustom.replace(
2007
- '[de las nacionalidades y posiciones seleccionadas]',
2008
- '',
2009
- )
2010
- filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
2011
- }
2012
- if (
2013
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2014
- .nationalities.size > 0
2015
- ) {
2016
- if (flagPosi) {
2017
- filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2018
- } else {
2019
- if (
2020
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2021
- .positions.size == this.setPositionsIds.size
2022
- ) {
2023
- filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2024
- }
2025
- }
2026
- } else {
2027
- filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2028
- }
2029
- if (
2030
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2031
- .start_age != 0 &&
2032
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2033
- .end_age != 0
2034
- ) {
2035
- if (
2036
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2037
- .start_age != this.arrayAgeRange[0] &&
2038
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2039
- .end_age != this.arrayAgeRange[1]
2040
- ) {
2041
- if (
2042
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2043
- .start_age ==
2044
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2045
- .end_age
2046
- ) {
2047
- filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2048
- filterTextCustom = filterTextCustom.replace(
2049
- '[de {min_age} años]',
2050
- '[de ' +
2051
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2052
- .start_age +
2053
- ' años]',
2054
- )
2055
- } else {
2056
- filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2057
- filterTextCustom = filterTextCustom.replace(
2058
- '[de {min_age} a {max_age} años]',
2059
- '[de ' +
2060
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2061
- .start_age +
2062
- ' a ' +
2063
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2064
- .end_age +
2065
- ' años]',
2066
- )
2067
- }
2068
- } else {
2069
- if (
2070
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2071
- .start_age != this.arrayAgeRange[0] ||
2072
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2073
- .end_age != this.arrayAgeRange[1]
2074
- ) {
2075
- if (
2076
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2077
- .start_age ==
2078
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2079
- .end_age
2080
- ) {
2081
- filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2082
- filterTextCustom = filterTextCustom.replace(
2083
- '[de {min_age} años]',
2084
- '[de ' +
2085
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2086
- .start_age +
2087
- ' años]',
2088
- )
2089
- } else {
2090
- filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2091
- filterTextCustom = filterTextCustom.replace(
2092
- '[de {min_age} a {max_age} años]',
2093
- '[de ' +
2094
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2095
- .start_age +
2096
- ' a ' +
2097
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2098
- .end_age +
2099
- ' años]',
2100
- )
2101
- }
2102
- } else {
2103
- filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2104
- filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2105
- }
2106
- }
2107
- } else {
2108
- filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2109
- filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2110
- }
2111
- const filterMatchSearch = this.arrayPredefinedFilters[
2112
- this.indexPredefinedFiltersSelected
2113
- ].filtersPredefined.sections
2114
- .sort()
2115
- .toString()
2116
- if (
2117
- this.predefinedFiltersMatchLapse[filterMatchSearch] ||
2118
- this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
2119
- ) {
2120
- if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
2121
- filterTextCustom = filterTextCustom.replace(
2122
- ' [durante {match_lapse}]',
2123
- this.predefinedFiltersMatchLapse[filterMatchSearch],
2124
- )
2125
- } else {
2126
- filterTextCustom = filterTextCustom.replace(
2127
- '{match_lapse}',
2128
- this.predefinedFiltersMatchLapse[filterMatchSearch],
2129
- )
2130
- }
2131
- } else {
2132
- filterTextCustom = filterTextCustom.replace(
2133
- '{match_lapse}',
2134
- ' ' + this.predefinedFiltersMatchLapse['other'],
2135
- )
2136
- var textfilterMatchAlternative = ''
2137
- if (filterMatchSearch.includes(1)) {
2138
- textfilterMatchAlternative = textfilterMatchAlternative + '0-15, '
2139
- }
2140
- if (filterMatchSearch.includes(2)) {
2141
- textfilterMatchAlternative = textfilterMatchAlternative + '16-30, '
2142
- }
2143
- if (filterMatchSearch.includes(3)) {
2144
- textfilterMatchAlternative = textfilterMatchAlternative + '31-45, '
2145
- }
2146
- if (filterMatchSearch.includes(4)) {
2147
- textfilterMatchAlternative = textfilterMatchAlternative + '46-60, '
2148
- }
2149
- if (filterMatchSearch.includes(5)) {
2150
- textfilterMatchAlternative = textfilterMatchAlternative + '61-75, '
2151
- }
2152
- if (filterMatchSearch.includes(6)) {
2153
- textfilterMatchAlternative = textfilterMatchAlternative + '76-90, '
2154
- }
2155
- textfilterMatchAlternative = textfilterMatchAlternative.slice(0, -2)
2156
- textfilterMatchAlternative = textfilterMatchAlternative.replace(/,([^,]*)$/, ' y ' + '$1')
2157
- filterTextCustom = filterTextCustom.replace(
2158
- '{match_lapse_selected}',
2159
- textfilterMatchAlternative,
2160
- )
2161
- }
2162
- const filterPlayingAsSearch = this.arrayPredefinedFilters[
2163
- this.indexPredefinedFiltersSelected
2164
- ].filtersPredefined.playingAs
2165
- .sort()
2166
- .toString()
2167
- if (
2168
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
2169
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
2170
- ) {
2171
- if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
2172
- filterTextCustom = filterTextCustom.replace(
2173
- ' [jugando como {playing_as}]',
2174
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2175
- )
2176
- } else {
2177
- filterTextCustom = filterTextCustom.replace(
2178
- '{playing_as}',
2179
- this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2180
- )
2181
- }
2182
- }
2183
- if (this.typeSelected == 1) {
2184
- if (this.getUser.tournament == 1001) {
2185
- if (this.category.id == 22) {
2186
- filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteras')
2187
- } else {
2188
- filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadoras')
2189
- }
2190
- } else {
2191
- if (this.category.id == 22) {
2192
- filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteros')
2193
- } else {
2194
- filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadores')
2195
- }
2196
- }
2197
- } else {
2198
- filterTextCustom = filterTextCustom.replace('{section_type}', 'Equipos')
2199
- }
2200
- filterTextCustom = filterTextCustom.replace(/\[/g, '')
2201
- filterTextCustom = filterTextCustom.replace(/\]/g, '')
2202
- filterTextCustom = filterTextCustom.replace(
2203
- '{category_name}',
2204
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].category_name,
2205
- )
2206
- const filterNameItem = filterTextCustom.split(': ')
2207
- let textFinal =
2208
- filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2209
- let textForDots =
2210
- filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2211
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].text = textFinal
2212
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].title =
2213
- filterNameItem[0] + ':'
2214
-
2215
- const matches = textForDots.match(/\*/g)
2216
- if (matches && matches.length) {
2217
- if (matches.length % 2 === 0) {
2218
- for (let i = 1; i <= matches.length; i++) {
2219
- if (i % 2 === 0) {
2220
- // textForDots = textForDots.replace('*', '</span>');
2221
- } else {
2222
- textForDots = textForDots.replace('*', '<span style="color: #ffff03" >')
2223
- }
2224
- }
2225
- } else {
2226
- textForDots = textForDots.replaceAll('*', '')
2227
- }
2228
- }
2229
-
2230
- this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].titledots = textForDots
2231
- },
2232
- intervalidtops(id) {
2233
- this.$emit('intervalidtops', id)
2234
- },
2235
- },
2236
- mounted() {
2237
- if (sessionStorage.getItem('sidpdfil') !== null) {
2238
- sessionStorage.setItem('sidpdfil', 0)
2239
- }
2240
- this.renderNext()
2241
-
2242
- if (this.teamId !== 0) {
2243
- this.clickTeam(this.teamId)
2244
- }
2245
-
2246
- if (this.defaultSection !== 'Jugadores') {
2247
- this.changeTabsGeneral(this.defaultSection)
2248
- }
2249
- },
2250
- async created() {
2251
- try {
2252
- const axiosInstance4 = axios.create({
2253
- headers: { 'Content-Type': 'application/json' },
2254
- })
2255
- axiosInstance4.interceptors.request.use((config) => {
2256
- delete config.headers.Authorization
2257
- return config
2258
- })
2259
- const data = await axiosInstance4.get(
2260
- 'https://golstats-microservices.s3.us-west-2.amazonaws.com/eligibles/elegibles.json',
2261
- { headers: { 'Content-Type': 'application/json' } },
2262
- )
2263
-
2264
- this.fVnationalities.add(138)
2265
- this.fVnationalities.add(222)
2266
- this.fVnationalities.add(163)
2267
- this.fVnationalities.add(51)
2268
- this.fVnationalities.add(226)
2269
- this.fVnationalities.add(10)
2270
- this.fVnationalities.add(223)
2271
- this.fVnationalities.add(96)
2272
- this.fVnationalities.add(171)
2273
- this.fVnationalities.add(198)
2274
- this.fVnationalities.add(105)
2275
- this.fVnationalities.add(80)
2276
- this.fVnationalities.add(29)
2277
- this.fVnationalities.add(74)
2278
- this.fVnationalities.add(216)
2279
- this.fVnationalities.add(196)
2280
- this.fVnationalities.add(64)
2281
- this.fVnationalities.add(155)
2282
- this.fVnationalities.add(156)
2283
- this.fVnationalities.add(89)
2284
- this.fVnationalities.add(106)
2285
- this.fVnationalities.add(81)
2286
- this.fVnationalities.add(233)
2287
- this.fVnationalities.add(204)
2288
- } catch (e) {
2289
- throw new Error(e)
2290
- }
2291
- },
2292
- }
2293
- </script>
2294
- <style lang="scss">
2295
- .cont-leyemd-multipleleagues {
2296
- width: 100%;
2297
- height: 20px;
2298
- display: inline-flex;
2299
- align-content: center;
2300
- justify-content: center;
2301
- align-items: center;
2302
- }
2303
- .img-leyemd-multipleleagues {
2304
- margin-right: 20px;
2305
- }
2306
-
2307
- .HiddenFilters {
2308
- display: none;
2309
- }
2310
- .overlay-loading {
2311
- position: fixed; /* Sit on top of the page content */
2312
- display: flex; /* Hidden by default */
2313
- flex-direction: column;
2314
- justify-content: center;
2315
- align-items: center;
2316
- width: 100%; /* Full width (cover the whole page) */
2317
- height: 100%; /* Full height (cover the whole page) */
2318
- top: 0;
2319
- left: 0;
2320
- right: 0;
2321
- bottom: 0;
2322
- background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
2323
- z-index: 100; /* Specify a stack order in case you're using a different order for other elements */
2324
-
2325
- &__spinner {
2326
- height: 70px;
2327
- -webkit-animation: spin 2s linear infinite; /* Safari */
2328
- animation: spin 2s linear infinite;
2329
-
2330
- & > img {
2331
- height: 70px;
2332
- object-fit: contain;
2333
- }
2334
- }
2335
-
2336
- &__text {
2337
- font-size: 1.4rem;
2338
- margin-top: 0.8em;
2339
- color: white;
2340
- font-family: 'Poppins-Regular';
2341
- }
2342
- }
2343
-
2344
- /* Safari */
2345
- @-webkit-keyframes spin {
2346
- 0% {
2347
- -webkit-transform: rotate(0deg);
2348
- }
2349
- 100% {
2350
- -webkit-transform: rotate(360deg);
2351
- }
2352
- }
2353
-
2354
- @keyframes spin {
2355
- 0% {
2356
- transform: rotate(0deg);
2357
- }
2358
- 100% {
2359
- transform: rotate(360deg);
2360
- }
2361
- }
2362
- </style>
2363
- <style module lang="scss">
2364
- @import '/css/fonts.css';
2365
- @import '/styles.css';
2366
- .containerScountingBtncom {
2367
- width: 100%;
2368
- height: 35px;
2369
- margin-top: 15px;
2370
- display: inline-flex;
2371
- justify-content: center;
2372
- align-items: center;
2373
- align-content: center;
2374
- }
2375
- .btnDeleteAplicacom {
2376
- width: 190px;
2377
- height: 32px;
2378
- background-color: rgba(255, 255, 255, 0.1);
2379
- border-radius: 20px;
2380
- text-align: center;
2381
- font-size: 12px;
2382
- font-family: 'Poppins-Regular';
2383
- display: inline-flex;
2384
- justify-content: center;
2385
- align-items: center;
2386
- align-content: center;
2387
- }
2388
- .btnDeleteAplicacom:hover {
2389
- background-color: rgba(255, 255, 255, 0.8);
2390
- color: #313131;
2391
- cursor: pointer;
2392
- }
2393
- .SearchBtnBarcom {
2394
- width: 85px;
2395
- height: 32px;
2396
- margin-left: 10px;
2397
- font-family: 'Poppins-Medium';
2398
- background-color: rgb(203, 238, 107);
2399
- color: #313131;
2400
- text-align: center;
2401
- font-size: 12px;
2402
- line-height: 32px;
2403
- border-radius: 35px;
2404
- }
2405
- .SearchBtnBarcom:hover {
2406
- background-color: rgb(155, 198, 36);
2407
- color: #313131;
2408
- cursor: pointer;
2409
- }
2410
- .btnLeyendTxtcom {
2411
- font-family: 'Poppins-Regular';
2412
- font-size: 15px;
2413
- color: #e4e5e6;
2414
- margin-left: 5px;
2415
- text-align: center;
2416
- margin-top: 50px;
2417
- }
2418
- .BtnSearchScountingcom {
2419
- width: 65px;
2420
- height: 40px;
2421
- margin-left: 10px;
2422
- font-family: 'Poppins-Medium';
2423
- background-color: rgb(203, 238, 107);
2424
- color: #313131;
2425
- text-align: center;
2426
- line-height: 40px;
2427
- border-radius: 5px;
2428
- @media only screen and (max-width: 760px) {
2429
- width: auto;
2430
- margin-left: 0;
2431
- }
2432
- }
2433
- .BtnSearchScountingcom:hover {
2434
- background-color: rgb(155, 198, 36);
2435
- color: #313131;
2436
- cursor: pointer;
2437
- }
2438
- .containerPredefinedcom {
2439
- width: 94%;
2440
- height: 830px;
2441
- border: 1px solid #717c86;
2442
- border-radius: 8px;
2443
- }
2444
- .containerPredefinedScountingcom {
2445
- width: 100% !important;
2446
- height: 300px;
2447
- margin-top: 20px;
2448
- display: inline-block;
2449
- border-radius: 8px;
2450
- }
2451
- .titleContainerPredefinedcom {
2452
- font-family: 'Poppins-Medium';
2453
- margin: 0 auto;
2454
- text-align: center;
2455
- width: 100%;
2456
- font-size: 14px;
2457
- color: #ffffff;
2458
- margin-top: 340px;
2459
- margin-bottom: 7px;
2460
- }
2461
- .subtitleContainerPredefinedcom {
2462
- font-family: 'Poppins-Regular';
2463
- margin: 0 auto;
2464
- text-align: center;
2465
- width: 100%;
2466
- font-size: 13px;
2467
- color: rgba(255, 255, 255, 0.7);
2468
-
2469
- & > span {
2470
- font-family: 'Poppins-SemiBold';
2471
- }
2472
- }
2473
- </style>
1
+ <template>
2
+ <div ref="myDivRefTopsFull" style="width: 100%; max-width: 100%; box-sizing: border-box">
3
+ <template v-for="(category, index) in categoryView" :key="index">
4
+ <div :class="toniKroosWrapperClass">
5
+ <GSCTopCategory
6
+ :is-widget="isWidget"
7
+ :team-widget="teamWidget"
8
+ :time-live-comparative-avanced="timeLiveComparativeAvanced"
9
+ :is-team="isTeam"
10
+ :carrousel="carrousel"
11
+ :arrow="arrow"
12
+ :border-width="0"
13
+ :can-play-videos="canPlayVideos"
14
+ border-radius="12px"
15
+ :game-id="gameId"
16
+ :game="game"
17
+ :typeData="type"
18
+ :category="category.id"
19
+ :type-table="typeTable"
20
+ :categoryName="category.name"
21
+ :season-selected="seasonSelected"
22
+ :season="seasonActive"
23
+ :filter-team="teamselect"
24
+ :num-rows="numRows"
25
+ :key="updateTables"
26
+ :dummy-data="dummyData"
27
+ />
28
+ </div>
29
+ </template>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import axios from 'axios'
35
+ import computedProperties from './computedProperties.js'
36
+ import useElementSize from './useElementSize'
37
+ import GSCTopCategory from '@/components/comparative/gsc-top.vue'
38
+
39
+ import { filtersTypes, personalDataSubFiltersTypes } from '@golstats/gsc-filters'
40
+
41
+ import '@@/@golstats/gsc-switch-component/dist/style.css'
42
+ import '@@/@golstats/gsc-season-select/dist/style.css'
43
+ import '@@/@golstats/gsc-tournament-select/dist/style.css'
44
+ import '@@/@golstats/gsc-dropdown/dist/style.css'
45
+ import '@@/@golstats/gsc-filters/dist/style.css'
46
+ import '@@/@golstats/gsc-label/dist/style.css'
47
+ import '@@/@golstats/gsc-filterperteam/dist/style.css'
48
+
49
+ import nationalitiesCatalog from '@/components/comparative/nationalities-catalog.js'
50
+ import { getButtonFilterProps } from '@/components/comparative/composable-filters.js'
51
+ const buttonFilterProps = ref(getButtonFilterProps())
52
+
53
+ import { ref } from 'vue'
54
+ export default {
55
+ components: {
56
+ GSCTopCategory,
57
+ },
58
+ computed: {
59
+ ...computedProperties.computed,
60
+ filterChangePredefined() {
61
+ return this.filtersPredefinedF
62
+ },
63
+ filterChange() {
64
+ const filtersaux2 = {
65
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
66
+ playingAs: [1, 2],
67
+ sections: [1, 2, 3, 4, 5, 6],
68
+ matchResult: [1, 2, 3],
69
+ arrayAgeRange: [1, 60],
70
+ typeZone: 1,
71
+ setNationalitiesIds: this.fVnationalities,
72
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
73
+ booleanAreNationalTeamsVisible: false,
74
+ setAvailableNationalTeamsPlayersIds: new Set(),
75
+ }
76
+ const filtersaux2Const = JSON.stringify(filtersaux2)
77
+ if (JSON.stringify(this.filters) != filtersaux2Const) {
78
+ return filtersaux2Const
79
+ }
80
+ return filtersaux2Const
81
+ },
82
+ filterGolstats() {
83
+ return this.FVfilterGolstats
84
+ },
85
+ filterButtonProps() {
86
+ const buttonFilterPropsValues = {
87
+ ...buttonFilterProps.value,
88
+ }
89
+ return buttonFilterPropsValues
90
+ },
91
+ },
92
+ props: {
93
+ timeLiveComparativeAvanced: {
94
+ type: Number,
95
+ default: 60000,
96
+ },
97
+ currentSeasonId: {
98
+ type: Number,
99
+ default: 0,
100
+ },
101
+ type: {
102
+ type: Number,
103
+ default: 0,
104
+ },
105
+ canPlayVideos: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+ carrousel: {
110
+ type: Boolean,
111
+ default: false,
112
+ },
113
+ arrow: {
114
+ type: Boolean,
115
+ default: false,
116
+ },
117
+ teamId: {
118
+ type: Number,
119
+ default: 0,
120
+ },
121
+ gameId: {
122
+ type: Number,
123
+ default: 0,
124
+ },
125
+ isWidget: {
126
+ type: Boolean,
127
+ default: false,
128
+ },
129
+ seasonSelected: {
130
+ type: Object,
131
+ default: () => ({}),
132
+ },
133
+ categoryView: {
134
+ type: Array,
135
+ default: () => [],
136
+ },
137
+ teamWidget: {
138
+ type: Number,
139
+ default: 0,
140
+ },
141
+ game: {
142
+ type: Object,
143
+ default: () => ({}),
144
+ },
145
+ teamselect: {
146
+ type: Number,
147
+ default: 0,
148
+ },
149
+ seasonActive: {
150
+ type: Number,
151
+ default: 0,
152
+ },
153
+ defaultSection: {
154
+ type: String,
155
+ default: 'Jugadores',
156
+ },
157
+ backgroundOdd: { type: String, default: '#172531' },
158
+ backgroundEven: { type: String, default: '#0d1d29' },
159
+ tournamentsApiUrl: {
160
+ type: String,
161
+ default: '',
162
+ },
163
+ numRows: {
164
+ type: Number,
165
+ default: 5,
166
+ },
167
+ dummyData: {
168
+ type: Array,
169
+ default: null,
170
+ },
171
+ },
172
+ watch: {
173
+ async seasonActive() {
174
+ if (this.seasonActive != 0) {
175
+ this.teams = []
176
+ const data = await this.fetchTeams()
177
+ for (let index = 0; index < data.teams.length; index++) {
178
+ this.teams.push({
179
+ id: data.teams[index].team_id,
180
+ team: data.teams[index].colloquial_name,
181
+ logo: data.teams[index].logo,
182
+ })
183
+ }
184
+ }
185
+ },
186
+ },
187
+ setup() {
188
+ const myDivRefTopsFull = ref('myDivRefTopsFull')
189
+ const { elementSize } = useElementSize(myDivRefTopsFull)
190
+ return {
191
+ myDivRefTopsFull,
192
+ elementSize,
193
+ }
194
+ },
195
+
196
+ data() {
197
+ return {
198
+ showfiltersPc: false,
199
+ positions: [
200
+ {
201
+ name: 'Portero',
202
+ fullname: 'POR',
203
+ },
204
+ {
205
+ name: 'Defensa central',
206
+ fullname: 'DFC',
207
+ },
208
+ {
209
+ name: 'Lateral por izquierda',
210
+ fullname: 'LI',
211
+ },
212
+ {
213
+ name: 'Lateral por derecha',
214
+ fullname: 'LD',
215
+ },
216
+ {
217
+ name: 'Volante por izquierda',
218
+ fullname: 'VI',
219
+ },
220
+ {
221
+ name: 'Volante por derecha',
222
+ fullname: 'VD',
223
+ },
224
+ {
225
+ name: 'Volante defensivo',
226
+ fullname: 'VDF',
227
+ },
228
+ {
229
+ name: 'Volante ofensivo',
230
+ fullname: 'VO',
231
+ },
232
+ {
233
+ name: 'Delantero',
234
+ fullname: 'DEL',
235
+ },
236
+ {
237
+ name: 'Desconocida',
238
+ fullname: 'Desc',
239
+ },
240
+ ],
241
+ arrayFiltersPlays: [],
242
+ filtersPredefinedF: {},
243
+ categoryPredefinedActive: false,
244
+ categoryPredefined: 0,
245
+ typeTable: 0,
246
+ keyUpdateFilter: 0,
247
+ loadingActive: false,
248
+ isTeam: false,
249
+ arrayPredefinedFilters: [],
250
+ arrayCategoryFilter: [
251
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
252
+ ],
253
+ arrayCategoryFilterFull: [
254
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
255
+ ],
256
+ FVsetAvailableNationalTeamsPlayersIds: new Set(),
257
+ showOnlyCategories: false,
258
+ showFullCategory: 0,
259
+ categoryName: '',
260
+ showFullTable: false,
261
+ expansionPanelModePropsTypePlays: {
262
+ isExpansionPanel: false,
263
+ templateProps: {
264
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
265
+ width: '400px',
266
+ maxWidth: '400px',
267
+ },
268
+ expansionPanelProps: {
269
+ width: '400px',
270
+ borderRadius: '8px',
271
+ },
272
+ fieldComponentProps: {
273
+ widthContainer: '400px',
274
+ },
275
+ },
276
+ expansionPanelModeProps: {
277
+ isExpansionPanel: false,
278
+ templateProps: {
279
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
280
+ },
281
+ expansionPanelProps: {
282
+ width: '400px',
283
+ borderRadius: '8px',
284
+ fontFamily: "'Poppins-Regular'",
285
+ },
286
+ fieldComponentProps: {
287
+ widthContainer: '100%',
288
+ title: 'Elige el área o zona de cancha',
289
+ titleFontSize: '13px',
290
+ },
291
+ },
292
+ expansionPanelModePropsMobil: {
293
+ isExpansionPanel: true,
294
+ templateProps: {
295
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
296
+ padding: '20px 0',
297
+ },
298
+ expansionPanelProps: {
299
+ width: '300px',
300
+ borderRadius: '8px',
301
+ height: '45px',
302
+ fontColor: 'rgba(255,255,255, 0.7)',
303
+ textFontSize: '14px',
304
+ textFontFamily: "'Poppins-Regular'",
305
+ padding: '0px 10px',
306
+ },
307
+ fieldComponentProps: {
308
+ widthContainer: '100%',
309
+ title: 'Elige el área o zona de cancha',
310
+ titleFontSize: '12px',
311
+ widthField: 268,
312
+ widthFieldGrid: '268px',
313
+ heightField: 180,
314
+ heightFieldGrid: '180px',
315
+ heightContainer: '280px',
316
+ },
317
+ },
318
+ expansionPanelModePropsMobil270: {
319
+ isExpansionPanel: true,
320
+ templateProps: {
321
+ boxShadow: '0px 4px 4px rgba(0, 0, 0, 0)',
322
+ padding: '20px 0',
323
+ },
324
+ expansionPanelProps: {
325
+ width: '270px',
326
+ borderRadius: '8px',
327
+ height: '45px',
328
+ fontColor: 'rgba(255,255,255, 0.7)',
329
+ textFontSize: '14px',
330
+ textFontFamily: "'Poppins-Regular'",
331
+ padding: '0px 10px',
332
+ },
333
+ fieldComponentProps: {
334
+ widthContainer: '100%',
335
+ title: 'Elige el área o zona de cancha',
336
+ titleFontSize: '12px',
337
+ widthField: 268,
338
+ widthFieldGrid: '268px',
339
+ heightField: 180,
340
+ heightFieldGrid: '180px',
341
+ heightContainer: '280px',
342
+ },
343
+ },
344
+ filters: {
345
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
346
+ playingAs: [1, 2],
347
+ sections: [1, 2, 3, 4, 5, 6],
348
+ matchResult: [1, 2, 3],
349
+ arrayAgeRange: [1, 60],
350
+ typeZone: 1,
351
+ setNationalitiesIds: this.setNationalitiesIds,
352
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
353
+ booleanAreNationalTeamsVisible: false,
354
+ setAvailableNationalTeamsPlayersIds: new Set(),
355
+ },
356
+ categoriesPlaysTypes: {
357
+ offensive: {
358
+ title: 'Ofensivo',
359
+ categories: [
360
+ {
361
+ name: 'Goles',
362
+ isSelected: true,
363
+ id: 1,
364
+ },
365
+ {
366
+ name: 'Tiros a gol',
367
+ isSelected: true,
368
+ id: 6,
369
+ },
370
+ {
371
+ name: 'Tiros a gol con destino a portería',
372
+ isSelected: true,
373
+ id: 7,
374
+ },
375
+ {
376
+ name: 'Asistencias',
377
+ isSelected: true,
378
+ id: 4,
379
+ },
380
+ {
381
+ name: 'Centros',
382
+ isSelected: true,
383
+ id: 10,
384
+ },
385
+ {
386
+ name: 'Centros acertados',
387
+ isSelected: true,
388
+ id: 11,
389
+ },
390
+ {
391
+ name: 'Participaciones en gol',
392
+ isSelected: true,
393
+ id: 5,
394
+ },
395
+ {
396
+ name: '1vs1 exitosos ofensivos',
397
+ isSelected: true,
398
+ id: 12,
399
+ },
400
+ {
401
+ name: '1vs1 exitosos ofensivos que terminan en gol',
402
+ isSelected: true,
403
+ id: 13,
404
+ },
405
+ {
406
+ name: 'Balones ganados en área rival',
407
+ isSelected: true,
408
+ id: 17,
409
+ },
410
+ {
411
+ name: 'Cabeceos en área rival',
412
+ isSelected: true,
413
+ id: 8,
414
+ },
415
+ {
416
+ name: 'Tiros de esquina',
417
+ isSelected: true,
418
+ id: 23,
419
+ },
420
+ ],
421
+ },
422
+ defensive: {
423
+ title: 'Defensivo',
424
+ categories: [
425
+ {
426
+ name: '1vs1 defensivos exitosos',
427
+ isSelected: true,
428
+ id: 14,
429
+ },
430
+ {
431
+ name: 'Cabeceo en área propia',
432
+ isSelected: true,
433
+ id: 9,
434
+ },
435
+ {
436
+ name: 'Balones ganados en área propia',
437
+ isSelected: true,
438
+ id: 16,
439
+ },
440
+ {
441
+ name: 'Rechaces',
442
+ isSelected: true,
443
+ id: 15,
444
+ },
445
+ {
446
+ name: 'Atajadas',
447
+ isSelected: true,
448
+ id: 22,
449
+ },
450
+ ],
451
+ },
452
+ possession: {
453
+ title: 'Posesión',
454
+ categories: [
455
+ {
456
+ name: 'Pases acertados',
457
+ isSelected: true,
458
+ id: 2,
459
+ },
460
+ {
461
+ name: 'Balones recuperados en disputa',
462
+ isSelected: true,
463
+ id: 3,
464
+ },
465
+ ],
466
+ },
467
+ offenses: {
468
+ title: 'Infracciones',
469
+ categories: [
470
+ {
471
+ name: 'Faltas cometidas',
472
+ isSelected: true,
473
+ id: 18,
474
+ },
475
+ {
476
+ name: 'Faltas recibidas',
477
+ isSelected: true,
478
+ id: 19,
479
+ },
480
+ {
481
+ name: 'Tarjetas amarillas',
482
+ isSelected: true,
483
+ id: 20,
484
+ },
485
+ {
486
+ name: 'Tarjetas rojas',
487
+ isSelected: true,
488
+ id: 21,
489
+ },
490
+ ],
491
+ },
492
+ offensesConditions: {
493
+ areYellowCardSelected: false,
494
+ areRedCardSelected: false,
495
+ areFoulsCommittedSelected: false,
496
+ },
497
+ },
498
+ categoriesDefault: [
499
+ {
500
+ id: 1,
501
+ name: 'Goles',
502
+ isSelected: false,
503
+ },
504
+ {
505
+ id: 2,
506
+ name: 'Pases acertados',
507
+ isSelected: false,
508
+ },
509
+ {
510
+ id: 23,
511
+ name: 'Tiros de Esquina',
512
+ isSelected: false,
513
+ },
514
+ {
515
+ id: 3,
516
+ name: 'Balones recuperados en disputa',
517
+ isSelected: false,
518
+ },
519
+ {
520
+ id: 4,
521
+ name: 'Asistencias',
522
+ isSelected: false,
523
+ },
524
+ {
525
+ id: 5,
526
+ name: 'Participaciones en gol',
527
+ isSelected: false,
528
+ },
529
+ {
530
+ id: 6,
531
+ name: 'Tiros a gol',
532
+ isSelected: false,
533
+ },
534
+ {
535
+ id: 7,
536
+ name: 'Tiros a gol que llegaron a la portería',
537
+ isSelected: false,
538
+ },
539
+ {
540
+ id: 8,
541
+ name: 'Cabeceos en área rival',
542
+ isSelected: false,
543
+ },
544
+ {
545
+ id: 9,
546
+ name: 'Cabeceos en área propia',
547
+ isSelected: false,
548
+ },
549
+ {
550
+ id: 10,
551
+ name: 'Centros',
552
+ isSelected: false,
553
+ },
554
+ {
555
+ id: 11,
556
+ name: 'Centros acertados',
557
+ isSelected: false,
558
+ },
559
+ {
560
+ id: 12,
561
+ name: '1vs1 exitosos ofensivos',
562
+ isSelected: false,
563
+ },
564
+ {
565
+ id: 13,
566
+ name: '1vs1 exitosos ofensivos que terminaron en gol',
567
+ isSelected: false,
568
+ },
569
+ {
570
+ id: 14,
571
+ name: '1vs1 defensivos exitoso',
572
+ isSelected: false,
573
+ },
574
+ {
575
+ id: 15,
576
+ name: 'Rechaces',
577
+ isSelected: false,
578
+ },
579
+ {
580
+ id: 16,
581
+ name: 'Balones ganados en área propia',
582
+ isSelected: false,
583
+ },
584
+ {
585
+ id: 17,
586
+ name: 'Balones ganados en área rival',
587
+ isSelected: false,
588
+ },
589
+ {
590
+ id: 18,
591
+ name: 'Faltas cometidas',
592
+ isSelected: false,
593
+ },
594
+ {
595
+ id: 19,
596
+ name: 'Faltas recibidas',
597
+ isSelected: false,
598
+ },
599
+ {
600
+ id: 20,
601
+ name: 'Tarjetas amarillas',
602
+ isSelected: false,
603
+ },
604
+ {
605
+ id: 21,
606
+ name: 'Tarjetas rojas',
607
+ isSelected: false,
608
+ },
609
+ {
610
+ id: 22,
611
+ name: 'Atajadas',
612
+ isSelected: false,
613
+ },
614
+ ],
615
+ isCup: false,
616
+ arrayPredefinedOrigin: [],
617
+ indexPredefinedFiltersSelected: 0,
618
+ predefinedFiltersMatchLapse: [],
619
+ predefinedFiltersPlayingAs: [],
620
+ predefinedFiltersSections: [],
621
+ updateTables: 0,
622
+ updateTablesfull: 0,
623
+ optionSelected: 'Jugadores',
624
+ optionSelectedSubmenu: 'Todas las jugadas',
625
+ tournamentsUrl: 'https://17zyhpyc7c.execute-api.us-west-2.amazonaws.com/prod/tournaments',
626
+ teamsUrl: 'https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/',
627
+ urlFilter:
628
+ 'https://cqqxaonvm6.execute-api.us-east-2.amazonaws.com/prod/gs2/tops/filters?categories=',
629
+ retries: 3,
630
+ teams: [],
631
+ updateFilterGolstats: 0,
632
+ updateFilterPlaytypesGolstats: 0,
633
+ arrayTournaments: [],
634
+ arraySeasons: {},
635
+ seasonBytournament: [],
636
+ filtersTypes: filtersTypes,
637
+ token:
638
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE',
639
+ fVnationalities: new Set(),
640
+ fVzone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
641
+ fVplayingAs: [1, 2],
642
+ fVsections: [1, 2, 3, 4, 5, 6],
643
+ fVmatchResult: [1, 2, 3],
644
+ fVarrayAgeRange: [10, 40],
645
+ FVeligible: [],
646
+ FVYear: 1900,
647
+ fVtypeZone: 2,
648
+ fVsetPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9],
649
+ currentIndex: -1,
650
+ delay: 800,
651
+ tournamentSelected: 0,
652
+ tournamentSelectedObj: {},
653
+ FVfilterGolstats: [],
654
+ updateFilterField: 0,
655
+ openMenuMobil: false,
656
+ selectedTournament: { seasons: [] },
657
+ selectedSeasonObj: {},
658
+ }
659
+ },
660
+ methods: {
661
+ getnameshort(namePlayerShort) {
662
+ var NameArrayHomeBench = namePlayerShort.split(',')
663
+ var lastArrayNameBench = NameArrayHomeBench[0].split(' ')
664
+ var ArrayNameBench = NameArrayHomeBench[1].trim().split(' ')
665
+ var lastNameHomeBench = ''
666
+ if (lastArrayNameBench.length == 2 || lastArrayNameBench.length == 1) {
667
+ if (lastArrayNameBench[0].length < 4) {
668
+ lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
669
+ } else {
670
+ lastNameHomeBench = lastArrayNameBench[0]
671
+ }
672
+ } else {
673
+ if (lastArrayNameBench.length == 3) {
674
+ lastNameHomeBench = lastArrayNameBench[0] + ' ' + lastArrayNameBench[1]
675
+ } else {
676
+ if (lastArrayNameBench.length == 4) {
677
+ lastNameHomeBench =
678
+ lastArrayNameBench[1] + ' ' + lastArrayNameBench[2] + ' ' + lastArrayNameBench[3]
679
+ }
680
+ }
681
+ }
682
+ var nameHomeBench =
683
+ ArrayNameBench[ArrayNameBench.length - 1] != ''
684
+ ? ArrayNameBench[ArrayNameBench.length - 1].charAt(0)
685
+ : ArrayNameBench[ArrayNameBench.length - 2]
686
+ ? ArrayNameBench[ArrayNameBench.length - 2].charAt(0)
687
+ : ''
688
+ lastNameHomeBench = lastNameHomeBench.replace(',', '')
689
+ return nameHomeBench + '. ' + lastNameHomeBench
690
+ },
691
+ setUpTournamentsToFilter() {
692
+ this.tournamentsToFilter.forEach((tournament) => {
693
+ const isSameTournament = tournament.id === this.selectedTournament.id
694
+ tournament.isSelected = isSameTournament
695
+ tournament.isDefaultTournament = isSameTournament
696
+ })
697
+ },
698
+ async onClickDeleteFilter() {
699
+ if (this.optionSelectedSubmenu == 'Predeterminados') {
700
+ this.resetPredefinedTeamAll()
701
+ } else {
702
+ this.arrayFiltersPlays = []
703
+ setTimeout(() => {
704
+ // Reset completado
705
+ }, 200)
706
+ }
707
+ },
708
+ clickOpenFilters() {
709
+ this.showfiltersPc = true
710
+ },
711
+ clickCloseFilters() {
712
+ this.showfiltersPc = false
713
+ },
714
+ async selectedSeason(season) {
715
+ if (this.seasonActive !== season.id) {
716
+ this.seasonActive = season.id
717
+ this.resetPredefinedTeamAll()
718
+ this.$emit('change-season-id', season.id)
719
+ }
720
+ },
721
+ changeTournament(tournament) {
722
+ if (tournament.id !== this.selectedTournament.id) {
723
+ this.selectedTournament = tournament
724
+ this.tournamentSelectedObj = { propName: 'id', value: tournament.id }
725
+ this.teamselect = 0
726
+ this.resetPredefinedTeamAll() //resetpredeterminados
727
+ this.setUpTournamentsToFilter()
728
+ }
729
+ },
730
+ changeTournamentMovil(item) {
731
+ this.tournamentSelectedObj = { propName: 'id', value: item.id }
732
+ this.seasonBytournament = item.seasons
733
+ this.teamselect = 0
734
+ },
735
+ selectedSeasonMovil(item) {
736
+ this.seasonActive = item.id
737
+ },
738
+ setRelevantCategoriesPlayer(positionId) {
739
+ return positionId === 1
740
+ ? [39, 40, 52, 53, 54, 55, 323, 324, 608, 774, 802]
741
+ : [
742
+ 10, 12, 14, 15, 27, 35, 61, 217, 257, 466, 519, 607, 702, 730, 98, 101, 109, 112, 121,
743
+ 122, 127, 128, 135, 136, 141, 142, 161, 170, 179, 211, 232, 235, 239, 242, 282, 284,
744
+ 289, 291, 296, 485, 486, 487, 488,
745
+ ]
746
+ },
747
+
748
+ setOpenMedia(data) {
749
+ this.$emit('openmedia', data)
750
+ },
751
+
752
+ setMediaData(data) {
753
+ const videoPlayerSection = 1
754
+ const playerType = 2
755
+ const playListType = playerType
756
+ let playerIds = [data.id]
757
+ let teamId = data.team_id
758
+ const jsonConfig = {
759
+ seasonId: data.season_id,
760
+ // seasons: data.seasons,
761
+ isFeaturedPlayers: false,
762
+ mainSectionType: videoPlayerSection,
763
+ playListType: playListType,
764
+ gameIds: null,
765
+ playerIds: playerIds,
766
+ goalkeeperIds: [],
767
+ categoryIds: this.setRelevantCategoriesPlayer(data.position),
768
+ teamId: teamId || 0,
769
+ matchResult: [1, 2, 3],
770
+ categorySingleName: '',
771
+ isRivalSubject: false,
772
+ avoidCategorySingleName: false,
773
+ currentPlayIndex: 0,
774
+ playData: null,
775
+ lastClashedGameId: null,
776
+ tournamentsLastClashes: null,
777
+ advancedFilter: {
778
+ playListTitle: 'Jugadas Relevantes',
779
+ },
780
+ }
781
+ this.$emit('openmedia', jsonConfig)
782
+ },
783
+ clickprofile(data) {
784
+ if (data.isTeam) {
785
+ this.$emit('openProfileTeam', { teamId: data.id, seasonId: this.seasonActive })
786
+ } else {
787
+ this.$emit('openProfilePlayer', {
788
+ playerId: data.id,
789
+ teamId: data.teamId,
790
+ seasonId: this.seasonActive,
791
+ })
792
+ }
793
+ },
794
+
795
+ viewprofile(data, seasonId, teamId) {
796
+ this.$emit('openProfilePlayer', {
797
+ playerId: data,
798
+ teamId,
799
+ seasonId: seasonId ? seasonId : this.seasonActive,
800
+ })
801
+ },
802
+
803
+ openMenuFilters() {
804
+ this.openMenuMobil = !this.openMenuMobil
805
+ this.showfiltersPc = true
806
+ },
807
+ clickexpand() {
808
+ // Método eliminado - relacionado con scouting
809
+ },
810
+ async getScoutingData() {
811
+ this.arrayFiltersPlays = []
812
+ this.loadingActive = true
813
+
814
+ const axiosInstance = axios.create({ headers: { Authorization: `${this.token}` } })
815
+ const { data } = await axiosInstance.post(
816
+ 'https://eh9nhj69z7.execute-api.us-west-2.amazonaws.com/prod/players/productivity',
817
+ this.filterScounting,
818
+ { headers: { 'Content-Type': 'application/json' } },
819
+ )
820
+
821
+ if (this.filterScounting.tournaments.length > 0) {
822
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
823
+ (objeto) => objeto.type === 'onFiltersTournaments',
824
+ )
825
+ if (indiceFilterOnPlays !== -1) {
826
+ this.arrayFiltersPlays[indiceFilterOnPlays].name =
827
+ this.filterScounting.tournaments.length > 1
828
+ ? 'Ligas ' + this.filterScounting.tournaments.length
829
+ : this.nameLeagueSelected != ''
830
+ ? this.nameLeagueSelected
831
+ : 'Liga MX'
832
+ } else {
833
+ this.arrayFiltersPlays.push({
834
+ name:
835
+ this.filterScounting.tournaments.length > 1
836
+ ? 'Ligas ' + this.filterScounting.tournaments.length
837
+ : this.nameLeagueSelected != ''
838
+ ? this.nameLeagueSelected
839
+ : 'Liga MX',
840
+ type: 'onFiltersTournaments',
841
+ })
842
+ }
843
+ }
844
+
845
+ this.rowScoutingData = []
846
+ for (let index = 0; index < data.length; index++) {
847
+ const element = data[index]
848
+ let arrayDateOfBirth = data[index].dob.split('T')
849
+ let dateOfBirth = arrayDateOfBirth[0].split('-')
850
+ var dataRow = {
851
+ position: index + 1,
852
+ player_name: this.abrevName(data[index].name),
853
+ player_photo:
854
+ 'https://golstatsimages.blob.core.windows.net/players-profile/' +
855
+ data[index].player_id +
856
+ '.png',
857
+ total: data[index].total.toFixed(0),
858
+ id: data[index].player_id,
859
+ player_age: this.calcularEdad(data[index].dob),
860
+ team_abrev: data[index].teams[0].acronym,
861
+ team_name: data[index].teams[0].team_name,
862
+ team_logo:
863
+ 'https://golstatsimages.blob.core.windows.net/teams-80/' +
864
+ data[index].teams[0].team_id +
865
+ '.png',
866
+ player_position: data[index].position_id,
867
+ player_country_flag:
868
+ 'https://golstatsimages.blob.core.windows.net/flags/' +
869
+ data[index].nationality_id +
870
+ '.jpg',
871
+ date: dateOfBirth[2] + '.' + dateOfBirth[1] + '.' + dateOfBirth[0].substring(2, 4),
872
+ team_id: data[index].team_id,
873
+ nationality_name: nationalitiesCatalog[data[index].nationality_id],
874
+ player_games: data[index].games_played,
875
+ player_min: data[index].minutes_played,
876
+ league_name: data[index].tournament_name,
877
+ seasons: data[index].seasons,
878
+ season_id: data[index].seasons[0],
879
+ }
880
+ this.rowScoutingData.push(dataRow)
881
+ }
882
+
883
+ if (this.seasonsFilterSelected != 0) {
884
+ const datateams = await this.fetchTeamsScouting(this.seasonsFilterSelected)
885
+ this.teamselect = 0
886
+ this.teamselectrec = 0
887
+ this.teamsscouting = []
888
+ for (let index = 0; index < datateams.teams.length; index++) {
889
+ this.teamsscouting.push({
890
+ id: datateams.teams[index].team_id,
891
+ team: datateams.teams[index].colloquial_name,
892
+ logo: datateams.teams[index].logo,
893
+ })
894
+ }
895
+ }
896
+ this.loadingActive = false
897
+ },
898
+ abrevName(name) {
899
+ var NameArrayHome = name.split(',')
900
+ var lastArrayName = NameArrayHome[0].split(' ')
901
+ var ArrayName = NameArrayHome[1].trim().split(' ')
902
+ var lastNameHome = ''
903
+ if (lastArrayName.length == 2 || lastArrayName.length == 1) {
904
+ if (lastArrayName[0].length < 4) {
905
+ lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
906
+ } else {
907
+ lastNameHome = lastArrayName[0]
908
+ }
909
+ } else {
910
+ if (lastArrayName.length == 3) {
911
+ lastNameHome = lastArrayName[0] + ' ' + lastArrayName[1]
912
+ } else {
913
+ if (lastArrayName.length == 4) {
914
+ lastNameHome = lastArrayName[1] + ' ' + lastArrayName[2] + ' ' + lastArrayName[3]
915
+ }
916
+ }
917
+ }
918
+ var nameHome =
919
+ ArrayName[ArrayName.length - 1] != ''
920
+ ? ArrayName[ArrayName.length - 1].charAt(0)
921
+ : ArrayName[ArrayName.length - 2]
922
+ ? ArrayName[ArrayName.length - 2].charAt(0)
923
+ : ''
924
+ lastNameHome = lastNameHome.replace(',', '')
925
+ var abrevNamePlayerHome = nameHome + '. ' + lastNameHome
926
+ return abrevNamePlayerHome
927
+ },
928
+ calcularEdad(fechaNacimiento) {
929
+ // Parsea la fecha de nacimiento en formato "YYYY-MM-DD"
930
+ var fechaNac = new Date(fechaNacimiento)
931
+
932
+ // Obtiene la fecha actual
933
+ var fechaActual = new Date()
934
+
935
+ // Calcula la diferencia en milisegundos entre las dos fechas
936
+ var diferencia = fechaActual - fechaNac
937
+
938
+ // Convierte la diferencia de milisegundos a años
939
+ var edadEnAnios = Math.floor(diferencia / (1000 * 60 * 60 * 24 * 365.25))
940
+
941
+ return edadEnAnios
942
+ },
943
+ async onFiltersTournaments(ObjectFilter) {
944
+ this.modifidFiltersFlag = true
945
+ var data = []
946
+ for (let index = 0; index < ObjectFilter.length; index++) {
947
+ if (ObjectFilter[index].isSelected) {
948
+ data.push(ObjectFilter[index].id)
949
+ }
950
+ }
951
+ if (data.length == 0) {
952
+ data = [1]
953
+ }
954
+ if (data.length == 1) {
955
+ for (let index = 0; index < ObjectFilter.length; index++) {
956
+ if (ObjectFilter[index].isSelected) {
957
+ this.nameLeagueSelected = ObjectFilter[index].name
958
+ this.seasonsFilterSelected = ObjectFilter[index].seasons[0].id
959
+ }
960
+ }
961
+ } else {
962
+ this.seasonsFilterSelected = 0
963
+ if (data.length > 0) {
964
+ this.nameLeagueSelected = data.length + ' Ligas'
965
+ }
966
+ }
967
+ this.filterScounting.tournaments = data
968
+ this.filterScounting.seasonId = ObjectFilter[0].seasons[0].id
969
+ },
970
+ onFiltersPersonalData(ObjectFilter) {
971
+ this.modifidFiltersFlag = true
972
+ if (ObjectFilter.hasOwnProperty('ageByRange')) {
973
+ const min = ObjectFilter.ageByRange.min == 0 ? 10 : ObjectFilter.ageByRange.min
974
+ const max = ObjectFilter.ageByRange.max == 0 ? 40 : ObjectFilter.ageByRange.max
975
+ this.filterScounting.range_age = [min, max]
976
+ this.filterScounting.age_or_year = 1
977
+ } else {
978
+ this.filterScounting.range_age = []
979
+ }
980
+ if (ObjectFilter.hasOwnProperty('year')) {
981
+ this.filterScounting.year = ObjectFilter.year
982
+ this.filterScounting.age_or_year = 0
983
+ } else {
984
+ this.filterScounting.year = 0
985
+ }
986
+
987
+ var dataNationalities = []
988
+ if (ObjectFilter.hasOwnProperty('nationalities')) {
989
+ for (let index = 0; index < ObjectFilter.nationalities.length; index++) {
990
+ if (ObjectFilter.nationalities[index].isSelected) {
991
+ dataNationalities.push(ObjectFilter.nationalities[index].id)
992
+ }
993
+ }
994
+ if (dataNationalities.length == 0) {
995
+ dataNationalities = [
996
+ 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
997
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
998
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
999
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 221, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94,
1000
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
1001
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
1002
+ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
1003
+ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
1004
+ 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
1005
+ 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1006
+ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
1007
+ 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
1008
+ 233, 234, 236, 237, 239,
1009
+ ]
1010
+ }
1011
+ }
1012
+ this.filterScounting.elegibles = []
1013
+ if (ObjectFilter.hasOwnProperty('eligibility')) {
1014
+ this.filterScounting.elegibles = [ObjectFilter.eligibility[0].id]
1015
+ }
1016
+
1017
+ var dataPositions = []
1018
+ for (let index = 0; index < ObjectFilter.positions.length; index++) {
1019
+ if (ObjectFilter.positions[index].isSelected) {
1020
+ dataPositions.push(ObjectFilter.positions[index].id)
1021
+ }
1022
+ }
1023
+ if (dataPositions.length == 0) {
1024
+ dataPositions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1025
+ }
1026
+ this.filterScounting.positions = dataPositions
1027
+ this.filterScounting.nationalities = dataNationalities
1028
+ },
1029
+ onFiltersUniverse(ObjectFilter) {
1030
+ this.modifidFiltersFlag = true
1031
+ this.filterScounting.minutes_played = Number(ObjectFilter.minutesPlayed)
1032
+ this.filterScounting.last_months = Number(ObjectFilter.lastMonths)
1033
+ this.filterScounting.minutes_played_avg = Number(ObjectFilter.percentMinutesPlayed)
1034
+ this.filterScounting.type_stats = ObjectFilter.statistics.averagePerGame
1035
+ ? 3
1036
+ : ObjectFilter.statistics.averagePerMinute
1037
+ ? 2
1038
+ : 1
1039
+ },
1040
+ onFiltersProductivity(ObjectFilter) {
1041
+ this.modifidFiltersFlag = true
1042
+ var dataCategories = []
1043
+ for (let index = 0; index < ObjectFilter.productivityFilters.length; index++) {
1044
+ dataCategories[ObjectFilter.productivityFilters[index].priority - 1] = {
1045
+ name: ObjectFilter.productivityFilters[index].name,
1046
+ ids: ObjectFilter.productivityFilters[index].id,
1047
+ }
1048
+ }
1049
+ if (dataCategories.length == 0) {
1050
+ dataCategories = [
1051
+ /* { name: 'Goles', ids: [12] },
1052
+ { name: 'Asistencias', ids: [10] },
1053
+ { name: 'Participaciones en gol', ids: [27] },
1054
+ { name: 'Cabeceos en área rival', ids: [330, 333, 423, 577, 578, 331, 334, 424] },
1055
+ { name: 'Tiros a gol totales', ids: [91, 95, 92, 93, 96, 97] }*/
1056
+ ]
1057
+ }
1058
+ this.filterScounting.categories = dataCategories
1059
+ this.filterScounting.fouls = ObjectFilter.offensesConditions.areFoulsCommittedSelected
1060
+ this.filterScounting.yellow_cards = ObjectFilter.offensesConditions.areYellowCardsSelected
1061
+ this.filterScounting.red_cards = ObjectFilter.offensesConditions.areRedCardsSelected
1062
+ },
1063
+ onFiltersGolStats(ObjectFilter) {
1064
+ if (ObjectFilter.length > 0) {
1065
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1066
+ (objeto) => objeto.type === 'onFiltersPredefined',
1067
+ )
1068
+ if (indiceFilterOnPlays !== -1) {
1069
+ this.arrayFiltersPlays[indiceFilterOnPlays].name = ObjectFilter[0].name
1070
+ } else {
1071
+ this.arrayFiltersPlays.push({ name: ObjectFilter[0].name, type: 'onFiltersPredefined' })
1072
+ }
1073
+ this.filtersPredefinedF = ObjectFilter[0].filters
1074
+ } else {
1075
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1076
+ (objeto) => objeto.type === 'onFiltersPredefined',
1077
+ )
1078
+ if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1079
+ this.filtersPredefinedF = this.filters
1080
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1081
+ this.FVfilterGolstats[index].isSelected = false
1082
+ }
1083
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1084
+ (objeto) => objeto.type === 'onFiltersPredefined',
1085
+ )
1086
+ if (indiceFilterOnPlaysAuxC !== -1) {
1087
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1088
+ }
1089
+ this.updateFilterGolstats += 1
1090
+ }
1091
+ }
1092
+ },
1093
+ shouldRender(index) {
1094
+ // Check if the element at the given index should be rendered
1095
+ return index <= this.currentIndex
1096
+ },
1097
+ renderNext() {
1098
+ // Render the next element after a delay
1099
+ this.currentIndex++
1100
+ if (this.currentIndex < this.categoriesDefault.length) {
1101
+ setTimeout(() => {
1102
+ this.$nextTick(() => {
1103
+ this.renderNext()
1104
+ })
1105
+ }, this.delay)
1106
+ }
1107
+ },
1108
+ async onFiltersPlaysTypes(idplaytype) {
1109
+ if (idplaytype.length > 0) {
1110
+ this.categoryPredefinedActive = true
1111
+ this.loadingActive = true
1112
+ this.categoryPredefined = idplaytype[0].id
1113
+
1114
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1115
+ (objeto) => objeto.type === 'onFiltersPredefined',
1116
+ )
1117
+
1118
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1119
+ this.FVfilterGolstats = []
1120
+ this.filtersPredefinedF = {}
1121
+
1122
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1123
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1124
+ (objeto) => objeto.type === 'onFiltersPredefined',
1125
+ )
1126
+
1127
+ if (indiceFilterOnPlaysAuxC !== -1) {
1128
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1129
+ this.FVfilterGolstats[index].isSelected = false
1130
+ }
1131
+ if (indiceFilterOnPlaysAuxC !== -1) {
1132
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1133
+ }
1134
+ this.updateFilterGolstats += 1
1135
+ }
1136
+ }
1137
+ this.updateTables += 1
1138
+ setTimeout(() => {
1139
+ this.loadingActive = false
1140
+ }, 1000)
1141
+ await this.getPredefinedfilters(idplaytype[0])
1142
+ if (this.FVfilterGolstats.length > 0) {
1143
+ this.onFiltersGolStats([this.FVfilterGolstats[0]])
1144
+ this.FVfilterGolstats[0].isSelected = true
1145
+ }
1146
+ } else {
1147
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1148
+ (objeto) => objeto.type === 'onFiltersPredefinedCategory',
1149
+ )
1150
+
1151
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1152
+ this.categoryPredefinedActive = false
1153
+ this.categoryPredefined = 0
1154
+ this.FVfilterGolstats = []
1155
+ this.filtersPredefinedF = this.filters
1156
+
1157
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1158
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1159
+ this.categoriesDefault[indexD].isSelected = false
1160
+ }
1161
+ this.updateFilterPlaytypesGolstats += 1
1162
+ //filtro golstats
1163
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1164
+ (objeto) => objeto.type === 'onFiltersPredefined',
1165
+ )
1166
+ if (this.FVfilterGolstats.length > 0 && indiceFilterOnPlaysAuxC !== -1) {
1167
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1168
+ this.FVfilterGolstats[index].isSelected = false
1169
+ }
1170
+ if (indiceFilterOnPlaysAuxC !== -1) {
1171
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1172
+ }
1173
+ this.updateFilterGolstats += 1
1174
+ }
1175
+ }
1176
+ }
1177
+ },
1178
+ deleteCategoryFilter() {
1179
+ this.categoryName = ''
1180
+ this.showFullCategory = 0
1181
+ this.showFullTable = false
1182
+ //this.updateTables -= 1
1183
+ delete this.filters.aux
1184
+ },
1185
+ onShowFullTable(data) {
1186
+ this.categoryName = data.categoryName
1187
+ this.showFullCategory = data.category
1188
+ this.showFullTable = true
1189
+ this.loadingActive = true
1190
+ setTimeout(() => {
1191
+ this.filters = {
1192
+ zone: this.fVzone,
1193
+ playingAs: this.fVplayingAs,
1194
+ sections: this.fVsections,
1195
+ matchResult: this.fVmatchResult,
1196
+ arrayAgeRange: this.fVarrayAgeRange,
1197
+ typeZone: this.fVtypeZone,
1198
+ setNationalitiesIds: this.fVnationalities,
1199
+ setPositionsIds: this.fVsetPositionsIds,
1200
+ setYear: this.FVYear,
1201
+ aux: this.getRandomNumber(1, 10000),
1202
+ booleanAreNationalTeamsVisible: this.FVbooleanAreNationalTeamsVisible,
1203
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1204
+ }
1205
+ this.loadingActive = false
1206
+ }, 1000)
1207
+
1208
+ //this.updateTables += 1
1209
+ },
1210
+ getRandomNumber(min, max) {
1211
+ return Math.floor(Math.random() * (max - min + 1)) + min
1212
+ },
1213
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1214
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1215
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1216
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1217
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1218
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1219
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1220
+ /** AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR, AQUI LLEGO EL VALOR */
1221
+ applyFiltersBtn(aplyval) {},
1222
+ onFiltersPlays(plays) {
1223
+ this.arrayCategoryFilter = []
1224
+ this.arrayCategoryFilterFull = []
1225
+ if (plays.playsCategories.length == 0) {
1226
+ for (
1227
+ let index = 0;
1228
+ index < this.categoriesPlaysTypes.offensive.categories.length;
1229
+ index++
1230
+ ) {
1231
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offensive.categories[index].id)
1232
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1233
+ }
1234
+ for (
1235
+ let index = 0;
1236
+ index < this.categoriesPlaysTypes.defensive.categories.length;
1237
+ index++
1238
+ ) {
1239
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.defensive.categories[index].id)
1240
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1241
+ }
1242
+ for (
1243
+ let index = 0;
1244
+ index < this.categoriesPlaysTypes.possession.categories.length;
1245
+ index++
1246
+ ) {
1247
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.possession.categories[index].id)
1248
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1249
+ }
1250
+ for (let index = 0; index < this.categoriesPlaysTypes.offenses.categories.length; index++) {
1251
+ this.arrayCategoryFilter.push(this.categoriesPlaysTypes.offenses.categories[index].id)
1252
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1253
+ }
1254
+ } else {
1255
+ for (let index = 0; index < plays.playsCategories.length; index++) {
1256
+ if (plays.playsCategories[index].isSelected) {
1257
+ this.arrayCategoryFilter.push(plays.playsCategories[index].id)
1258
+ this.arrayCategoryFilterFull.push(plays.playsCategories[index])
1259
+ }
1260
+ }
1261
+ }
1262
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1263
+ (objeto) => objeto.type === 'onFiltersPlays',
1264
+ )
1265
+ if (this.arrayCategoryFilter.length > 0 && this.arrayCategoryFilter.length != 23) {
1266
+ if (this.arrayCategoryFilter.length == 1) {
1267
+ if (indiceFilterOnPlays != -1) {
1268
+ this.arrayFiltersPlays[indiceFilterOnPlays].name = this.arrayCategoryFilterFull[0].name
1269
+ } else {
1270
+ this.arrayFiltersPlays.push({
1271
+ name: this.arrayCategoryFilterFull[0].name,
1272
+ type: 'onFiltersPlays',
1273
+ })
1274
+ }
1275
+ } else {
1276
+ if (indiceFilterOnPlays != -1) {
1277
+ this.arrayFiltersPlays[indiceFilterOnPlays].name =
1278
+ this.arrayCategoryFilterFull.length + ' Tipos de jugadas'
1279
+ } else {
1280
+ this.arrayFiltersPlays.push({
1281
+ name: this.arrayCategoryFilterFull.length + ' Tipos de jugadas',
1282
+ type: 'onFiltersPlays',
1283
+ })
1284
+ }
1285
+ }
1286
+ } else {
1287
+ if (indiceFilterOnPlays !== -1) {
1288
+ this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1289
+ }
1290
+ }
1291
+ },
1292
+ async deleteLabelFilter(deleteFilterValID) {
1293
+ var indiceFilterOnPlays = this.arrayFiltersPlays.findIndex(
1294
+ (objeto) => objeto.type === deleteFilterValID,
1295
+ )
1296
+ if (indiceFilterOnPlays !== -1) {
1297
+ if (deleteFilterValID == 'onFiltersTournaments') {
1298
+ this.arrayFiltersPlays = []
1299
+ setTimeout(() => {
1300
+ // Reset completado
1301
+ }, 200)
1302
+ }
1303
+ if (deleteFilterValID == 'onFiltersPlays') {
1304
+ for (
1305
+ let index = 0;
1306
+ index < this.categoriesPlaysTypes.offensive.categories.length;
1307
+ index++
1308
+ ) {
1309
+ this.categoriesPlaysTypes.offensive.categories[index].isSelected = true
1310
+ }
1311
+ for (
1312
+ let index = 0;
1313
+ index < this.categoriesPlaysTypes.defensive.categories.length;
1314
+ index++
1315
+ ) {
1316
+ this.categoriesPlaysTypes.defensive.categories[index].isSelected = true
1317
+ this.arrayCategoryFilter.push()
1318
+ this.arrayCategoryFilterFull.push(this.categoriesPlaysTypes.offensive.categories[index])
1319
+ }
1320
+ for (
1321
+ let index = 0;
1322
+ index < this.categoriesPlaysTypes.possession.categories.length;
1323
+ index++
1324
+ ) {
1325
+ this.categoriesPlaysTypes.possession.categories[index].isSelected = true
1326
+ }
1327
+ for (
1328
+ let index = 0;
1329
+ index < this.categoriesPlaysTypes.offenses.categories.length;
1330
+ index++
1331
+ ) {
1332
+ this.categoriesPlaysTypes.offenses.categories[index].isSelected = true
1333
+ }
1334
+ }
1335
+ if (deleteFilterValID == 'onFiltersField') {
1336
+ this.fVzone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1337
+
1338
+ this.filters = {
1339
+ zone: this.fVzone,
1340
+ playingAs: this.fVplayingAs,
1341
+ sections: this.fVsections,
1342
+ matchResult: this.fVmatchResult,
1343
+ arrayAgeRange: this.fVarrayAgeRange,
1344
+ typeZone: this.fVtypeZone,
1345
+ setNationalitiesIds: this.fVnationalities,
1346
+ setPositionsIds: this.fVsetPositionsIds,
1347
+ setYear: this.FVYear,
1348
+ booleanAreNationalTeamsVisible: false,
1349
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1350
+ }
1351
+ }
1352
+ if (deleteFilterValID == 'onFiltersPredefined') {
1353
+ this.filtersPredefinedF = this.filters
1354
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1355
+ this.FVfilterGolstats[index].isSelected = false
1356
+ }
1357
+ this.updateFilterGolstats += 1
1358
+ this.resetPredefinedTeamAll()
1359
+ }
1360
+ if (deleteFilterValID == 'onFiltersPredefinedCategory') {
1361
+ this.categoryPredefinedActive = false
1362
+ this.categoryPredefined = 0
1363
+ this.FVfilterGolstats = []
1364
+ this.filtersPredefinedF = this.filters
1365
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1366
+ (objeto) => objeto.type === 'onFiltersPredefined',
1367
+ )
1368
+ if (indiceFilterOnPlaysAuxC !== -1) {
1369
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1370
+ }
1371
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1372
+ this.categoriesDefault[indexD].isSelected = false
1373
+ }
1374
+ this.updateFilterPlaytypesGolstats += 1
1375
+ }
1376
+ if (deleteFilterValID == 'onFiltersDetailsTime') {
1377
+ this.detailsObject.gameSections[0].isSelected = true
1378
+ this.detailsObject.gameSections[1].isSelected = true
1379
+ this.detailsObject.gameSections[2].isSelected = true
1380
+ this.detailsObject.gameSections[3].isSelected = true
1381
+ this.detailsObject.gameSections[4].isSelected = true
1382
+ this.detailsObject.gameSections[5].isSelected = true
1383
+ this.fVsections = [1, 2, 3, 4, 5, 6]
1384
+
1385
+ this.filters = {
1386
+ zone: this.fVzone,
1387
+ playingAs: this.fVplayingAs,
1388
+ sections: this.fVsections,
1389
+ matchResult: this.fVmatchResult,
1390
+ arrayAgeRange: this.fVarrayAgeRange,
1391
+ typeZone: this.fVtypeZone,
1392
+ setNationalitiesIds: this.fVnationalities,
1393
+ setPositionsIds: this.fVsetPositionsIds,
1394
+ setYear: this.FVYear,
1395
+ booleanAreNationalTeamsVisible: false,
1396
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1397
+ }
1398
+ }
1399
+ if (deleteFilterValID == 'onFiltersDetailsPlayingAs') {
1400
+ this.detailsObject.playingAs[0].isSelected = true
1401
+ this.detailsObject.playingAs[1].isSelected = true
1402
+ this.fVplayingAs = [1, 2]
1403
+ this.filters = {
1404
+ zone: this.fVzone,
1405
+ playingAs: this.fVplayingAs,
1406
+ sections: this.fVsections,
1407
+ matchResult: this.fVmatchResult,
1408
+ arrayAgeRange: this.fVarrayAgeRange,
1409
+ typeZone: this.fVtypeZone,
1410
+ setNationalitiesIds: this.fVnationalities,
1411
+ setPositionsIds: this.fVsetPositionsIds,
1412
+ setYear: this.FVYear,
1413
+ booleanAreNationalTeamsVisible: false,
1414
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1415
+ }
1416
+ }
1417
+ if (deleteFilterValID == 'onFiltersNationality') {
1418
+ this.fVnationalities.add(138)
1419
+ this.fVnationalities.add(222)
1420
+ this.fVnationalities.add(163)
1421
+ this.fVnationalities.add(51)
1422
+ this.fVnationalities.add(226)
1423
+ this.fVnationalities.add(10)
1424
+ this.fVnationalities.add(223)
1425
+ this.fVnationalities.add(96)
1426
+ this.fVnationalities.add(171)
1427
+ this.fVnationalities.add(198)
1428
+ this.fVnationalities.add(105)
1429
+ this.fVnationalities.add(80)
1430
+ this.fVnationalities.add(29)
1431
+ this.fVnationalities.add(74)
1432
+ this.fVnationalities.add(216)
1433
+ this.fVnationalities.add(196)
1434
+ this.fVnationalities.add(64)
1435
+ this.fVnationalities.add(155)
1436
+ this.fVnationalities.add(156)
1437
+ this.fVnationalities.add(89)
1438
+ this.fVnationalities.add(106)
1439
+ this.fVnationalities.add(81)
1440
+ this.fVnationalities.add(233)
1441
+ this.fVnationalities.add(204)
1442
+ this.filters = {
1443
+ zone: this.fVzone,
1444
+ playingAs: this.fVplayingAs,
1445
+ sections: this.fVsections,
1446
+ matchResult: this.fVmatchResult,
1447
+ arrayAgeRange: this.fVarrayAgeRange,
1448
+ typeZone: this.fVtypeZone,
1449
+ setNationalitiesIds: this.fVnationalities,
1450
+ setPositionsIds: this.fVsetPositionsIds,
1451
+ setYear: this.FVYear,
1452
+ booleanAreNationalTeamsVisible: false,
1453
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1454
+ }
1455
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1456
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.NATIONALITY)
1457
+ }
1458
+ if (deleteFilterValID == 'onFiltersPosition') {
1459
+ this.fVsetPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1460
+ this.filters = {
1461
+ zone: this.fVzone,
1462
+ playingAs: this.fVplayingAs,
1463
+ sections: this.fVsections,
1464
+ matchResult: this.fVmatchResult,
1465
+ arrayAgeRange: this.fVarrayAgeRange,
1466
+ typeZone: this.fVtypeZone,
1467
+ setNationalitiesIds: this.fVnationalities,
1468
+ setPositionsIds: this.fVsetPositionsIds,
1469
+ setYear: this.FVYear,
1470
+ booleanAreNationalTeamsVisible: false,
1471
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1472
+ }
1473
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1474
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.POSITION)
1475
+ }
1476
+ if (deleteFilterValID == 'onFiltersAge') {
1477
+ this.fVarrayAgeRange = [10, 40]
1478
+ this.filters = {
1479
+ zone: this.fVzone,
1480
+ playingAs: this.fVplayingAs,
1481
+ sections: this.fVsections,
1482
+ matchResult: this.fVmatchResult,
1483
+ arrayAgeRange: this.fVarrayAgeRange,
1484
+ typeZone: this.fVtypeZone,
1485
+ setNationalitiesIds: this.fVnationalities,
1486
+ setPositionsIds: this.fVsetPositionsIds,
1487
+ setYear: this.FVYear,
1488
+ booleanAreNationalTeamsVisible: false,
1489
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1490
+ }
1491
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1492
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.AGE_RANGE)
1493
+ }
1494
+ if (deleteFilterValID == 'onFiltersElegibility') {
1495
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1496
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.ELIGIBILITY)
1497
+ }
1498
+ if (deleteFilterValID == 'onFiltersYear') {
1499
+ const personalDataFilterplayer = this.$refs.personalDataFilterPlayers
1500
+ personalDataFilterplayer.clearFilters(personalDataSubFiltersTypes.YEAR)
1501
+ this.FVYear = 1900
1502
+ this.filters = {
1503
+ zone: this.fVzone,
1504
+ playingAs: this.fVplayingAs,
1505
+ sections: this.fVsections,
1506
+ matchResult: this.fVmatchResult,
1507
+ arrayAgeRange: this.fVarrayAgeRange,
1508
+ typeZone: this.fVtypeZone,
1509
+ setNationalitiesIds: this.fVnationalities,
1510
+ setPositionsIds: this.fVsetPositionsIds,
1511
+ setYear: this.FVYear,
1512
+ booleanAreNationalTeamsVisible: false,
1513
+ setAvailableNationalTeamsPlayersIds: this.FVsetAvailableNationalTeamsPlayersIds,
1514
+ }
1515
+ }
1516
+ }
1517
+
1518
+ this.arrayFiltersPlays.splice(indiceFilterOnPlays, 1)
1519
+ },
1520
+ clickAll() {
1521
+ // Método eliminado - relacionado con scouting
1522
+ },
1523
+ clickAllAll() {
1524
+ // Método eliminado - relacionado con scouting
1525
+ },
1526
+ clickTeam() {
1527
+ // Método eliminado - relacionado con scouting
1528
+ },
1529
+ clickTeamScouting() {
1530
+ // Método eliminado - relacionado con scouting
1531
+ },
1532
+ resetFilterTeamAndPlayers() {
1533
+ this.filters = {
1534
+ zone: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
1535
+ playingAs: [1, 2],
1536
+ sections: [1, 2, 3, 4, 5, 6],
1537
+ matchResult: [1, 2, 3],
1538
+ arrayAgeRange: [1, 60],
1539
+ typeZone: 1,
1540
+ setNationalitiesIds: this.setNationalitiesIds, //PROBABELMENTE SE OCUPE LLENAR
1541
+ setPositionsIds: [1, 2, 3, 4, 5, 6, 7, 8, 9], //PROBABELMENTE SE OCUPE LLENAR
1542
+ setYear: this.FVYear,
1543
+ booleanAreNationalTeamsVisible: false,
1544
+ setAvailableNationalTeamsPlayersIds: new Set(),
1545
+ }
1546
+ },
1547
+ async changeTabsGeneral(idchange) {
1548
+ this.resetPredefinedTeamAll()
1549
+ this.showfiltersPc = true
1550
+ this.optionSelected = idchange
1551
+ this.optionSelectedSubmenu = 'Todas las jugadas'
1552
+ this.filtersPredefinedF = {}
1553
+ this.categoryPredefinedActive = false
1554
+ this.categoryPredefined = 0
1555
+ if (idchange == 'Equipos') {
1556
+ this.typeTable = 1
1557
+ this.isTeam = true
1558
+ this.updateTables += 1
1559
+ this.arrayFiltersPlays = []
1560
+ this.teamselect = 0
1561
+ this.resetFilterTeamAndPlayers()
1562
+ }
1563
+ if (idchange == 'Jugadores') {
1564
+ this.typeTable = 0
1565
+ this.isTeam = false
1566
+ this.teamselect = 0
1567
+ this.updateTables += 1
1568
+ this.resetFilterTeamAndPlayers()
1569
+ }
1570
+ },
1571
+ resetPredefinedTeamAll() {
1572
+ var indiceFilterOnPredefinedCategory = this.arrayFiltersPlays.findIndex(
1573
+ (objeto) => objeto.type === 'onFiltersPredefined',
1574
+ )
1575
+
1576
+ if (this.categoriesDefault.length > 0 && indiceFilterOnPredefinedCategory !== -1) {
1577
+ this.categoryPredefinedActive = false
1578
+ this.categoryPredefined = 0
1579
+ this.FVfilterGolstats = []
1580
+ this.filtersPredefinedF = {}
1581
+
1582
+ this.arrayFiltersPlays.splice(indiceFilterOnPredefinedCategory, 1)
1583
+ for (let indexD = 0; indexD < this.categoriesDefault.length; indexD++) {
1584
+ this.categoriesDefault[indexD].isSelected = false
1585
+ }
1586
+ this.updateFilterPlaytypesGolstats += 1
1587
+ //filtro golstats
1588
+ var indiceFilterOnPlaysAuxC = this.arrayFiltersPlays.findIndex(
1589
+ (objeto) => objeto.type === 'onFiltersPredefined',
1590
+ )
1591
+
1592
+ if (indiceFilterOnPlaysAuxC !== -1) {
1593
+ for (let index = 0; index < this.FVfilterGolstats.length; index++) {
1594
+ this.FVfilterGolstats[index].isSelected = false
1595
+ }
1596
+ if (indiceFilterOnPlaysAuxC !== -1) {
1597
+ this.arrayFiltersPlays.splice(indiceFilterOnPlaysAuxC, 1)
1598
+ }
1599
+ this.updateFilterGolstats += 1
1600
+ }
1601
+ }
1602
+ },
1603
+ changeTabsSubmenu(idchange) {
1604
+ if (idchange != 'Predeterminados') {
1605
+ this.resetPredefinedTeamAll()
1606
+ } else {
1607
+ this.arrayFiltersPlays = []
1608
+ }
1609
+
1610
+ this.optionSelectedSubmenu = idchange
1611
+ },
1612
+
1613
+ async fetchTournaments() {
1614
+ const axiosInstance = axios.create({
1615
+ headers: {
1616
+ Authorization: `${this.token}`,
1617
+ },
1618
+ })
1619
+ const { data } = await axiosInstance.get(this.tournamentsUrl)
1620
+ return data
1621
+ },
1622
+ async fetchTeams() {
1623
+ const axiosInstance = axios.create({
1624
+ headers: {
1625
+ Authorization: `${this.token}`,
1626
+ },
1627
+ })
1628
+ const { data } = await axiosInstance.get(this.teamsUrl + this.seasonActive)
1629
+ return data
1630
+ },
1631
+ async fetchTeamsScouting(season) {
1632
+ const axiosInstance = axios.create({
1633
+ headers: {
1634
+ Authorization: `${this.token}`,
1635
+ },
1636
+ })
1637
+ const { data } = await axiosInstance.get(this.teamsUrl + season)
1638
+ return data
1639
+ },
1640
+ async getPredefinedfilters(category) {
1641
+ this.arrayPredefinedFilters = []
1642
+ this.arrayPredefinedOrigin = []
1643
+ var url = ''
1644
+ if (category.id == 1) {
1645
+ url = this.urlFilter
1646
+ } else {
1647
+ url = this.urlFilter
1648
+ }
1649
+
1650
+ const axiosInstance = axios.create({
1651
+ headers: {
1652
+ Authorization: `${this.token}`,
1653
+ },
1654
+ })
1655
+ const { data } = await axiosInstance.get(url + category.id)
1656
+ Object.keys(data[0].match_lapse_combinations).forEach((key) => {
1657
+ this.predefinedFiltersMatchLapse[key.toString()] = data[0].match_lapse_combinations[key]
1658
+ })
1659
+ Object.keys(data[0].playing_as_combinations).forEach((key) => {
1660
+ this.predefinedFiltersPlayingAs[key.toString()] = data[0].playing_as_combinations[key]
1661
+ })
1662
+ Object.keys(data[0].field_sections_combinations).forEach((key) => {
1663
+ this.predefinedFiltersSections[key.toString()] = data[0].field_sections_combinations[key]
1664
+ })
1665
+ if (data[0]) {
1666
+ for (let indexRecord = 0; indexRecord < data[0].filter_records.length; indexRecord++) {
1667
+ var filterText = data[0].description
1668
+
1669
+ if (data[0].filter_records[indexRecord].field_sections !== undefined) {
1670
+ const filterFieldSearch = data[0].filter_records[indexRecord].field_sections.toString()
1671
+ if (
1672
+ this.predefinedFiltersSections[filterFieldSearch] ||
1673
+ this.predefinedFiltersSections[filterFieldSearch] == ''
1674
+ ) {
1675
+ if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1676
+ filterText = filterText.replace(
1677
+ ' [en {field_sections}]',
1678
+ this.predefinedFiltersSections[filterFieldSearch],
1679
+ )
1680
+ } else {
1681
+ filterText = filterText.replace(
1682
+ '{field_sections}',
1683
+ this.predefinedFiltersSections[filterFieldSearch],
1684
+ )
1685
+ }
1686
+ }
1687
+ }
1688
+ if (data[0].filter_records[indexRecord].match_lapse !== undefined) {
1689
+ const filterMatchSearch = data[0].filter_records[indexRecord].match_lapse.toString()
1690
+ if (
1691
+ this.predefinedFiltersMatchLapse[filterMatchSearch] ||
1692
+ this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
1693
+ ) {
1694
+ if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
1695
+ filterText = filterText.replace(
1696
+ ' [durante {match_lapse}]',
1697
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
1698
+ )
1699
+ } else {
1700
+ filterText = filterText.replace(
1701
+ '{match_lapse}',
1702
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
1703
+ )
1704
+ }
1705
+ }
1706
+ }
1707
+ if (data[0].filter_records[indexRecord].playing_as !== undefined) {
1708
+ const filterPlayingAsSearch = data[0].filter_records[indexRecord].playing_as.toString()
1709
+ if (
1710
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
1711
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
1712
+ ) {
1713
+ if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
1714
+ filterText = filterText.replace(
1715
+ ' [jugando como {playing_as}]',
1716
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1717
+ )
1718
+ } else {
1719
+ filterText = filterText.replace(
1720
+ '{playing_as}',
1721
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
1722
+ )
1723
+ }
1724
+ }
1725
+ }
1726
+ if (data[0].filter_records[indexRecord].section_type !== undefined) {
1727
+ if (this.optionSelected == 'Jugadores') {
1728
+ filterText = filterText.replace('{section_type}', 'Jugadores')
1729
+ } else {
1730
+ filterText = filterText.replace('{section_type}', 'Equipos')
1731
+ }
1732
+ }
1733
+
1734
+ filterText = filterText.replace(/\[/g, '')
1735
+ filterText = filterText.replace(/\]/g, '')
1736
+ filterText = filterText.replace('{category_name}', data[0].category_name)
1737
+ const filterNameItem = filterText.split(': ')
1738
+ var textFinal = filterNameItem[1]
1739
+ if (textFinal.length > 129 && this.windowWidth > 1358) {
1740
+ textFinal = textFinal.substring(0, 129)
1741
+ textFinal =
1742
+ textFinal +
1743
+ "<span id='showIDtootip' class='dots' style='width: 100px; height: 20px; background: red; z-index: 6;'" +
1744
+ '>...</span>'
1745
+ }
1746
+
1747
+ if (!this.isCup || data[0].filter_records[indexRecord].playing_as.length === 2) {
1748
+ this.arrayPredefinedFilters.push({
1749
+ id: indexRecord,
1750
+ category_name: category.name,
1751
+ id_category: data[0].id,
1752
+ title: filterNameItem[0] + ':',
1753
+ text: filterNameItem[1],
1754
+ textOrigin: data[0].description,
1755
+ titledots: textFinal,
1756
+ filtersPredefined: {
1757
+ matchResult: data[0].filter_records[indexRecord].match_result,
1758
+ playingAs: data[0].filter_records[indexRecord].playing_as,
1759
+ sections: data[0].filter_records[indexRecord].match_lapse,
1760
+ type: this.optionSelected == 'Equipos' ? 2 : 1,
1761
+ typeZone: data[0].type_zone,
1762
+ zone: data[0].filter_records[indexRecord].field_sections,
1763
+ end_age: 0,
1764
+ start_age: 0,
1765
+ nationalities: [],
1766
+ elegible: [],
1767
+ positions: [],
1768
+ },
1769
+ })
1770
+ }
1771
+ }
1772
+
1773
+ var arrayFVfilterGolstats = []
1774
+ for (let index = 0; index < this.arrayPredefinedFilters.length; index++) {
1775
+ var numfilterApply = 0
1776
+ var nations = new Set()
1777
+ var objectFilterApply = {}
1778
+
1779
+ var TextFinalSub = this.arrayPredefinedFilters[index].text.replace(/\*.*?\*/, '')
1780
+ TextFinalSub = TextFinalSub.replace(/\*/g, '')
1781
+ TextFinalSub = TextFinalSub.replace(/ +/g, ' ')
1782
+ if (this.arrayPredefinedFilters[index].filtersPredefined.elegible.length > 0) {
1783
+ numfilterApply += 1
1784
+ }
1785
+ if (
1786
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age.length != 0 ||
1787
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age.length != 0
1788
+ ) {
1789
+ numfilterApply += 1
1790
+ }
1791
+ if (
1792
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age != 0 &&
1793
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0
1794
+ ) {
1795
+ objectFilterApply.arrayAgeRange = [
1796
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1797
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1798
+ ]
1799
+ } else {
1800
+ if (
1801
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0 &&
1802
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age == 0
1803
+ ) {
1804
+ objectFilterApply.arrayAgeRange = [1, 60]
1805
+ } else {
1806
+ if (
1807
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age != 0 &&
1808
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age == 0
1809
+ ) {
1810
+ objectFilterApply.arrayAgeRange = [
1811
+ this.arrayPredefinedFilters[index].filtersPredefined.start_age,
1812
+ 60,
1813
+ ]
1814
+ } else {
1815
+ objectFilterApply.arrayAgeRange = [
1816
+ 1,
1817
+ this.arrayPredefinedFilters[index].filtersPredefined.end_age,
1818
+ ]
1819
+ }
1820
+ }
1821
+ }
1822
+ if (this.arrayPredefinedFilters[index].filtersPredefined.matchResult.length != 3) {
1823
+ numfilterApply += 1
1824
+ }
1825
+ objectFilterApply.matchResult =
1826
+ this.arrayPredefinedFilters[index].filtersPredefined.matchResult
1827
+ if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length > 0) {
1828
+ numfilterApply += 1
1829
+ }
1830
+ if (this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length != 0) {
1831
+ for (
1832
+ let indexNA = 0;
1833
+ indexNA < this.arrayPredefinedFilters[index].filtersPredefined.nationalities.length;
1834
+ indexNA++
1835
+ ) {
1836
+ nations.add(
1837
+ this.arrayPredefinedFilters[index].filtersPredefined.nationalities[indexNA],
1838
+ )
1839
+ }
1840
+ objectFilterApply.setNationalitiesIds = nations
1841
+ } else {
1842
+ nations.add(138)
1843
+ nations.add(222)
1844
+ nations.add(163)
1845
+ nations.add(51)
1846
+ nations.add(226)
1847
+ nations.add(10)
1848
+ nations.add(223)
1849
+ nations.add(96)
1850
+ nations.add(171)
1851
+ nations.add(198)
1852
+ nations.add(105)
1853
+ nations.add(80)
1854
+ nations.add(29)
1855
+ nations.add(74)
1856
+ nations.add(216)
1857
+ nations.add(196)
1858
+ nations.add(64)
1859
+ nations.add(155)
1860
+ nations.add(156)
1861
+ nations.add(89)
1862
+ nations.add(106)
1863
+ nations.add(81)
1864
+ nations.add(233)
1865
+ nations.add(204)
1866
+ objectFilterApply.setNationalitiesIds = nations
1867
+ }
1868
+ if (this.arrayPredefinedFilters[index].filtersPredefined.playingAs.length != 2) {
1869
+ numfilterApply += 1
1870
+ }
1871
+ objectFilterApply.playingAs =
1872
+ this.arrayPredefinedFilters[index].filtersPredefined.playingAs
1873
+ if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1874
+ numfilterApply += 1
1875
+ }
1876
+ if (this.arrayPredefinedFilters[index].filtersPredefined.positions.length > 0) {
1877
+ objectFilterApply.setPositionsIds =
1878
+ this.arrayPredefinedFilters[index].filtersPredefined.positions
1879
+ } else {
1880
+ objectFilterApply.setPositionsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1881
+ }
1882
+ if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length != 6) {
1883
+ numfilterApply += 1
1884
+ }
1885
+ if (this.arrayPredefinedFilters[index].filtersPredefined.sections.length > 0) {
1886
+ objectFilterApply.sections =
1887
+ this.arrayPredefinedFilters[index].filtersPredefined.sections
1888
+ } else {
1889
+ objectFilterApply.sections = [1, 2, 3, 4, 5, 6]
1890
+ }
1891
+ if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length != 16) {
1892
+ numfilterApply += 1
1893
+ }
1894
+ if (this.arrayPredefinedFilters[index].filtersPredefined.zone.length > 0) {
1895
+ objectFilterApply.zone = this.arrayPredefinedFilters[index].filtersPredefined.zone
1896
+ } else {
1897
+ objectFilterApply.zone = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1898
+ }
1899
+ objectFilterApply.typeZone = this.arrayPredefinedFilters[index].filtersPredefined.typeZone
1900
+ arrayFVfilterGolstats.push({
1901
+ id: index + 1,
1902
+ name: TextFinalSub,
1903
+ isSelected: false,
1904
+ value: numfilterApply,
1905
+ filters: objectFilterApply,
1906
+ })
1907
+ }
1908
+ this.FVfilterGolstats = arrayFVfilterGolstats
1909
+ this.updateFilterGolstats += 1
1910
+ this.arrayPredefinedOrigin = JSON.parse(JSON.stringify(this.arrayPredefinedFilters))
1911
+ }
1912
+ },
1913
+ getTextFilterPredefinedCustom() {
1914
+ this.setDinamicFilters(this.filterEmitAux)
1915
+
1916
+ var filterTextCustom =
1917
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].textOrigin
1918
+
1919
+ const filterFieldSearch = this.arrayPredefinedFilters[
1920
+ this.indexPredefinedFiltersSelected
1921
+ ].filtersPredefined.zone
1922
+ .sort((a, b) => a - b)
1923
+ .toString()
1924
+
1925
+ if (
1926
+ this.predefinedFiltersSections[filterFieldSearch] ||
1927
+ this.predefinedFiltersSections[filterFieldSearch] == ''
1928
+ ) {
1929
+ if (this.predefinedFiltersSections[filterFieldSearch] == '') {
1930
+ filterTextCustom = filterTextCustom.replace(
1931
+ ' [en {field_sections}]',
1932
+ this.predefinedFiltersSections[filterFieldSearch],
1933
+ )
1934
+ } else {
1935
+ filterTextCustom = filterTextCustom.replace(
1936
+ '{field_sections}',
1937
+ this.predefinedFiltersSections[filterFieldSearch],
1938
+ )
1939
+ }
1940
+ } else {
1941
+ filterTextCustom = filterTextCustom.replace(
1942
+ '{field_sections}',
1943
+ this.predefinedFiltersSections['other'],
1944
+ )
1945
+ }
1946
+ var flagPosi = false
1947
+ if (
1948
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1949
+ .nationalities.size > 0
1950
+ ) {
1951
+ if (
1952
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1953
+ .nationalities.size == this.setNationalityIds.size
1954
+ ) {
1955
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1956
+ filterTextCustom = filterTextCustom.replace(
1957
+ '[de las nacionalidades y posiciones seleccionadas]',
1958
+ '',
1959
+ )
1960
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1961
+ } else {
1962
+ if (
1963
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1964
+ .nationalities.size == 1
1965
+ ) {
1966
+ filterTextCustom = filterTextCustom.replace(
1967
+ '[{nationality}]',
1968
+ this.$t(
1969
+ `gentilicios[${
1970
+ [
1971
+ ...this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected]
1972
+ .filtersPredefined.nationalities,
1973
+ ][0]
1974
+ }]`,
1975
+ ),
1976
+ )
1977
+ filterTextCustom = filterTextCustom.replace(
1978
+ '[de las nacionalidades y posiciones seleccionadas]',
1979
+ '',
1980
+ )
1981
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
1982
+ } else {
1983
+ if (
1984
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1985
+ .positions.size > 0 &&
1986
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
1987
+ .positions.size != this.setPositionsIds.size
1988
+ ) {
1989
+ flagPosi = true
1990
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1991
+ filterTextCustom = filterTextCustom.replace(
1992
+ '[de las nacionalidades seleccionadas]',
1993
+ '',
1994
+ )
1995
+ } else {
1996
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
1997
+ filterTextCustom = filterTextCustom.replace(
1998
+ '[de las nacionalidades y posiciones seleccionadas]',
1999
+ '',
2000
+ )
2001
+ }
2002
+ }
2003
+ }
2004
+ } else {
2005
+ filterTextCustom = filterTextCustom.replace('[{nationality}]', '')
2006
+ filterTextCustom = filterTextCustom.replace(
2007
+ '[de las nacionalidades y posiciones seleccionadas]',
2008
+ '',
2009
+ )
2010
+ filterTextCustom = filterTextCustom.replace('[de las nacionalidades seleccionadas]', '')
2011
+ }
2012
+ if (
2013
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2014
+ .nationalities.size > 0
2015
+ ) {
2016
+ if (flagPosi) {
2017
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2018
+ } else {
2019
+ if (
2020
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2021
+ .positions.size == this.setPositionsIds.size
2022
+ ) {
2023
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2024
+ }
2025
+ }
2026
+ } else {
2027
+ filterTextCustom = filterTextCustom.replace('[de las posiciones seleccionadas]', '')
2028
+ }
2029
+ if (
2030
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2031
+ .start_age != 0 &&
2032
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2033
+ .end_age != 0
2034
+ ) {
2035
+ if (
2036
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2037
+ .start_age != this.arrayAgeRange[0] &&
2038
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2039
+ .end_age != this.arrayAgeRange[1]
2040
+ ) {
2041
+ if (
2042
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2043
+ .start_age ==
2044
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2045
+ .end_age
2046
+ ) {
2047
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2048
+ filterTextCustom = filterTextCustom.replace(
2049
+ '[de {min_age} años]',
2050
+ '[de ' +
2051
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2052
+ .start_age +
2053
+ ' años]',
2054
+ )
2055
+ } else {
2056
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2057
+ filterTextCustom = filterTextCustom.replace(
2058
+ '[de {min_age} a {max_age} años]',
2059
+ '[de ' +
2060
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2061
+ .start_age +
2062
+ ' a ' +
2063
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2064
+ .end_age +
2065
+ ' años]',
2066
+ )
2067
+ }
2068
+ } else {
2069
+ if (
2070
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2071
+ .start_age != this.arrayAgeRange[0] ||
2072
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2073
+ .end_age != this.arrayAgeRange[1]
2074
+ ) {
2075
+ if (
2076
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2077
+ .start_age ==
2078
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2079
+ .end_age
2080
+ ) {
2081
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2082
+ filterTextCustom = filterTextCustom.replace(
2083
+ '[de {min_age} años]',
2084
+ '[de ' +
2085
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2086
+ .start_age +
2087
+ ' años]',
2088
+ )
2089
+ } else {
2090
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2091
+ filterTextCustom = filterTextCustom.replace(
2092
+ '[de {min_age} a {max_age} años]',
2093
+ '[de ' +
2094
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2095
+ .start_age +
2096
+ ' a ' +
2097
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].filtersPredefined
2098
+ .end_age +
2099
+ ' años]',
2100
+ )
2101
+ }
2102
+ } else {
2103
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2104
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2105
+ }
2106
+ }
2107
+ } else {
2108
+ filterTextCustom = filterTextCustom.replace('[de {min_age} años]', '')
2109
+ filterTextCustom = filterTextCustom.replace('[de {min_age} a {max_age} años]', '')
2110
+ }
2111
+ const filterMatchSearch = this.arrayPredefinedFilters[
2112
+ this.indexPredefinedFiltersSelected
2113
+ ].filtersPredefined.sections
2114
+ .sort()
2115
+ .toString()
2116
+ if (
2117
+ this.predefinedFiltersMatchLapse[filterMatchSearch] ||
2118
+ this.predefinedFiltersMatchLapse[filterMatchSearch] == ''
2119
+ ) {
2120
+ if (this.predefinedFiltersMatchLapse[filterMatchSearch] == '') {
2121
+ filterTextCustom = filterTextCustom.replace(
2122
+ ' [durante {match_lapse}]',
2123
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
2124
+ )
2125
+ } else {
2126
+ filterTextCustom = filterTextCustom.replace(
2127
+ '{match_lapse}',
2128
+ this.predefinedFiltersMatchLapse[filterMatchSearch],
2129
+ )
2130
+ }
2131
+ } else {
2132
+ filterTextCustom = filterTextCustom.replace(
2133
+ '{match_lapse}',
2134
+ ' ' + this.predefinedFiltersMatchLapse['other'],
2135
+ )
2136
+ var textfilterMatchAlternative = ''
2137
+ if (filterMatchSearch.includes(1)) {
2138
+ textfilterMatchAlternative = textfilterMatchAlternative + '0-15, '
2139
+ }
2140
+ if (filterMatchSearch.includes(2)) {
2141
+ textfilterMatchAlternative = textfilterMatchAlternative + '16-30, '
2142
+ }
2143
+ if (filterMatchSearch.includes(3)) {
2144
+ textfilterMatchAlternative = textfilterMatchAlternative + '31-45, '
2145
+ }
2146
+ if (filterMatchSearch.includes(4)) {
2147
+ textfilterMatchAlternative = textfilterMatchAlternative + '46-60, '
2148
+ }
2149
+ if (filterMatchSearch.includes(5)) {
2150
+ textfilterMatchAlternative = textfilterMatchAlternative + '61-75, '
2151
+ }
2152
+ if (filterMatchSearch.includes(6)) {
2153
+ textfilterMatchAlternative = textfilterMatchAlternative + '76-90, '
2154
+ }
2155
+ textfilterMatchAlternative = textfilterMatchAlternative.slice(0, -2)
2156
+ textfilterMatchAlternative = textfilterMatchAlternative.replace(/,([^,]*)$/, ' y ' + '$1')
2157
+ filterTextCustom = filterTextCustom.replace(
2158
+ '{match_lapse_selected}',
2159
+ textfilterMatchAlternative,
2160
+ )
2161
+ }
2162
+ const filterPlayingAsSearch = this.arrayPredefinedFilters[
2163
+ this.indexPredefinedFiltersSelected
2164
+ ].filtersPredefined.playingAs
2165
+ .sort()
2166
+ .toString()
2167
+ if (
2168
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] ||
2169
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == ''
2170
+ ) {
2171
+ if (this.predefinedFiltersPlayingAs[filterPlayingAsSearch] == '') {
2172
+ filterTextCustom = filterTextCustom.replace(
2173
+ ' [jugando como {playing_as}]',
2174
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2175
+ )
2176
+ } else {
2177
+ filterTextCustom = filterTextCustom.replace(
2178
+ '{playing_as}',
2179
+ this.predefinedFiltersPlayingAs[filterPlayingAsSearch],
2180
+ )
2181
+ }
2182
+ }
2183
+ if (this.typeSelected == 1) {
2184
+ if (this.getUser.tournament == 1001) {
2185
+ if (this.category.id == 22) {
2186
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteras')
2187
+ } else {
2188
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadoras')
2189
+ }
2190
+ } else {
2191
+ if (this.category.id == 22) {
2192
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Porteros')
2193
+ } else {
2194
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Jugadores')
2195
+ }
2196
+ }
2197
+ } else {
2198
+ filterTextCustom = filterTextCustom.replace('{section_type}', 'Equipos')
2199
+ }
2200
+ filterTextCustom = filterTextCustom.replace(/\[/g, '')
2201
+ filterTextCustom = filterTextCustom.replace(/\]/g, '')
2202
+ filterTextCustom = filterTextCustom.replace(
2203
+ '{category_name}',
2204
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].category_name,
2205
+ )
2206
+ const filterNameItem = filterTextCustom.split(': ')
2207
+ let textFinal =
2208
+ filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2209
+ let textForDots =
2210
+ filterNameItem[1].charAt(0).toUpperCase() + filterNameItem[1].toLowerCase().slice(1)
2211
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].text = textFinal
2212
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].title =
2213
+ filterNameItem[0] + ':'
2214
+
2215
+ const matches = textForDots.match(/\*/g)
2216
+ if (matches && matches.length) {
2217
+ if (matches.length % 2 === 0) {
2218
+ for (let i = 1; i <= matches.length; i++) {
2219
+ if (i % 2 === 0) {
2220
+ // textForDots = textForDots.replace('*', '</span>');
2221
+ } else {
2222
+ textForDots = textForDots.replace('*', '<span style="color: #ffff03" >')
2223
+ }
2224
+ }
2225
+ } else {
2226
+ textForDots = textForDots.replaceAll('*', '')
2227
+ }
2228
+ }
2229
+
2230
+ this.arrayPredefinedFilters[this.indexPredefinedFiltersSelected].titledots = textForDots
2231
+ },
2232
+ intervalidtops(id) {
2233
+ this.$emit('intervalidtops', id)
2234
+ },
2235
+ },
2236
+ mounted() {
2237
+ if (sessionStorage.getItem('sidpdfil') !== null) {
2238
+ sessionStorage.setItem('sidpdfil', 0)
2239
+ }
2240
+ this.renderNext()
2241
+
2242
+ if (this.teamId !== 0) {
2243
+ this.clickTeam(this.teamId)
2244
+ }
2245
+
2246
+ if (this.defaultSection !== 'Jugadores') {
2247
+ this.changeTabsGeneral(this.defaultSection)
2248
+ }
2249
+ },
2250
+ async created() {
2251
+ try {
2252
+ const axiosInstance4 = axios.create({
2253
+ headers: { 'Content-Type': 'application/json' },
2254
+ })
2255
+ axiosInstance4.interceptors.request.use((config) => {
2256
+ delete config.headers.Authorization
2257
+ return config
2258
+ })
2259
+ const data = await axiosInstance4.get(
2260
+ 'https://golstats-microservices.s3.us-west-2.amazonaws.com/eligibles/elegibles.json',
2261
+ { headers: { 'Content-Type': 'application/json' } },
2262
+ )
2263
+
2264
+ this.fVnationalities.add(138)
2265
+ this.fVnationalities.add(222)
2266
+ this.fVnationalities.add(163)
2267
+ this.fVnationalities.add(51)
2268
+ this.fVnationalities.add(226)
2269
+ this.fVnationalities.add(10)
2270
+ this.fVnationalities.add(223)
2271
+ this.fVnationalities.add(96)
2272
+ this.fVnationalities.add(171)
2273
+ this.fVnationalities.add(198)
2274
+ this.fVnationalities.add(105)
2275
+ this.fVnationalities.add(80)
2276
+ this.fVnationalities.add(29)
2277
+ this.fVnationalities.add(74)
2278
+ this.fVnationalities.add(216)
2279
+ this.fVnationalities.add(196)
2280
+ this.fVnationalities.add(64)
2281
+ this.fVnationalities.add(155)
2282
+ this.fVnationalities.add(156)
2283
+ this.fVnationalities.add(89)
2284
+ this.fVnationalities.add(106)
2285
+ this.fVnationalities.add(81)
2286
+ this.fVnationalities.add(233)
2287
+ this.fVnationalities.add(204)
2288
+ } catch (e) {
2289
+ throw new Error(e)
2290
+ }
2291
+ },
2292
+ }
2293
+ </script>
2294
+ <style lang="scss">
2295
+ .cont-leyemd-multipleleagues {
2296
+ width: 100%;
2297
+ height: 20px;
2298
+ display: inline-flex;
2299
+ align-content: center;
2300
+ justify-content: center;
2301
+ align-items: center;
2302
+ }
2303
+ .img-leyemd-multipleleagues {
2304
+ margin-right: 20px;
2305
+ }
2306
+
2307
+ .HiddenFilters {
2308
+ display: none;
2309
+ }
2310
+ .overlay-loading {
2311
+ position: fixed; /* Sit on top of the page content */
2312
+ display: flex; /* Hidden by default */
2313
+ flex-direction: column;
2314
+ justify-content: center;
2315
+ align-items: center;
2316
+ width: 100%; /* Full width (cover the whole page) */
2317
+ height: 100%; /* Full height (cover the whole page) */
2318
+ top: 0;
2319
+ left: 0;
2320
+ right: 0;
2321
+ bottom: 0;
2322
+ background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
2323
+ z-index: 100; /* Specify a stack order in case you're using a different order for other elements */
2324
+
2325
+ &__spinner {
2326
+ height: 70px;
2327
+ -webkit-animation: spin 2s linear infinite; /* Safari */
2328
+ animation: spin 2s linear infinite;
2329
+
2330
+ & > img {
2331
+ height: 70px;
2332
+ object-fit: contain;
2333
+ }
2334
+ }
2335
+
2336
+ &__text {
2337
+ font-size: 1.4rem;
2338
+ margin-top: 0.8em;
2339
+ color: white;
2340
+ font-family: 'Poppins-Regular';
2341
+ }
2342
+ }
2343
+
2344
+ /* Safari */
2345
+ @-webkit-keyframes spin {
2346
+ 0% {
2347
+ -webkit-transform: rotate(0deg);
2348
+ }
2349
+ 100% {
2350
+ -webkit-transform: rotate(360deg);
2351
+ }
2352
+ }
2353
+
2354
+ @keyframes spin {
2355
+ 0% {
2356
+ transform: rotate(0deg);
2357
+ }
2358
+ 100% {
2359
+ transform: rotate(360deg);
2360
+ }
2361
+ }
2362
+ </style>
2363
+ <style module lang="scss">
2364
+ @import '/css/fonts.css';
2365
+ @import '/styles.css';
2366
+ .containerScountingBtncom {
2367
+ width: 100%;
2368
+ height: 35px;
2369
+ margin-top: 15px;
2370
+ display: inline-flex;
2371
+ justify-content: center;
2372
+ align-items: center;
2373
+ align-content: center;
2374
+ }
2375
+ .btnDeleteAplicacom {
2376
+ width: 190px;
2377
+ height: 32px;
2378
+ background-color: rgba(255, 255, 255, 0.1);
2379
+ border-radius: 20px;
2380
+ text-align: center;
2381
+ font-size: 12px;
2382
+ font-family: 'Poppins-Regular';
2383
+ display: inline-flex;
2384
+ justify-content: center;
2385
+ align-items: center;
2386
+ align-content: center;
2387
+ }
2388
+ .btnDeleteAplicacom:hover {
2389
+ background-color: rgba(255, 255, 255, 0.8);
2390
+ color: #313131;
2391
+ cursor: pointer;
2392
+ }
2393
+ .SearchBtnBarcom {
2394
+ width: 85px;
2395
+ height: 32px;
2396
+ margin-left: 10px;
2397
+ font-family: 'Poppins-Medium';
2398
+ background-color: rgb(203, 238, 107);
2399
+ color: #313131;
2400
+ text-align: center;
2401
+ font-size: 12px;
2402
+ line-height: 32px;
2403
+ border-radius: 35px;
2404
+ }
2405
+ .SearchBtnBarcom:hover {
2406
+ background-color: rgb(155, 198, 36);
2407
+ color: #313131;
2408
+ cursor: pointer;
2409
+ }
2410
+ .btnLeyendTxtcom {
2411
+ font-family: 'Poppins-Regular';
2412
+ font-size: 15px;
2413
+ color: #e4e5e6;
2414
+ margin-left: 5px;
2415
+ text-align: center;
2416
+ margin-top: 50px;
2417
+ }
2418
+ .BtnSearchScountingcom {
2419
+ width: 65px;
2420
+ height: 40px;
2421
+ margin-left: 10px;
2422
+ font-family: 'Poppins-Medium';
2423
+ background-color: rgb(203, 238, 107);
2424
+ color: #313131;
2425
+ text-align: center;
2426
+ line-height: 40px;
2427
+ border-radius: 5px;
2428
+ @media only screen and (max-width: 760px) {
2429
+ width: auto;
2430
+ margin-left: 0;
2431
+ }
2432
+ }
2433
+ .BtnSearchScountingcom:hover {
2434
+ background-color: rgb(155, 198, 36);
2435
+ color: #313131;
2436
+ cursor: pointer;
2437
+ }
2438
+ .containerPredefinedcom {
2439
+ width: 94%;
2440
+ height: 830px;
2441
+ border: 1px solid #717c86;
2442
+ border-radius: 8px;
2443
+ }
2444
+ .containerPredefinedScountingcom {
2445
+ width: 100% !important;
2446
+ height: 300px;
2447
+ margin-top: 20px;
2448
+ display: inline-block;
2449
+ border-radius: 8px;
2450
+ }
2451
+ .titleContainerPredefinedcom {
2452
+ font-family: 'Poppins-Medium';
2453
+ margin: 0 auto;
2454
+ text-align: center;
2455
+ width: 100%;
2456
+ font-size: 14px;
2457
+ color: #ffffff;
2458
+ margin-top: 340px;
2459
+ margin-bottom: 7px;
2460
+ }
2461
+ .subtitleContainerPredefinedcom {
2462
+ font-family: 'Poppins-Regular';
2463
+ margin: 0 auto;
2464
+ text-align: center;
2465
+ width: 100%;
2466
+ font-size: 13px;
2467
+ color: rgba(255, 255, 255, 0.7);
2468
+
2469
+ & > span {
2470
+ font-family: 'Poppins-SemiBold';
2471
+ }
2472
+ }
2473
+ </style>