@golstats/gsc-reports 1.0.73 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{FilterConditions-55d68355-DMqzcKBO-DetRyeQp-D-SFJTPh.js → FilterConditions-55d68355-DMqzcKBO-BUsV1uff-BqhmhIO7.js} +20 -20
- package/dist/{FilterField-59a73e38-CNaE03Ge-y0TJhKzn-DmW2Nen2.js → FilterField-59a73e38-CNaE03Ge-5Ufd6Qjm-CLmzz8wD.js} +3 -3
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-s9tf4U0t-D2WRoC-O.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-DcLxx26Q-CEyuCb0o.js} +10 -10
- package/dist/css/fonts.css +83 -83
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +342 -334
- package/dist/{index-DlP73Y2z.js → index-BlybwR5p.js} +99666 -94932
- package/package.json +2 -2
- package/src/App.vue +28 -0
- package/src/components/TemplatesSection.vue +113 -0
- package/src/components/elementsTemplates/FortalezasView.vue +1193 -0
- package/src/components/elementsTemplates/ModalConfigurarContenido.vue +1229 -0
- package/src/components/elementsTemplates/ModalDeleteTemplate.vue +249 -249
- package/src/components/elementsTemplates/ModalGenerarReporte.vue +39 -1
- package/src/components/elementsTemplates/ModalSoloEscritorio.vue +83 -83
- package/src/components/elementsTemplates/ModalduplicateTemplate.vue +300 -300
- package/src/components/elementsTemplates/TirosEsquinaView.vue +1071 -0
- package/src/components/elementsTemplates/TooltipReportOptions.vue +97 -97
- package/src/components/elementsTemplates/TooltipTemplateOptions.vue +168 -168
- package/src/components/filters.vue +935 -935
- package/src/components/thumbnails-reports/AnalisisPostMatchType1.vue +741 -741
- package/src/components/thumbnails-reports/AnalisisPostMatchType2.vue +743 -743
- package/src/components/thumbnails-reports/AnalisisPrematchType3.vue +173 -173
- package/src/components/thumbnails-reports/AnalisisPrematchType4.vue +173 -173
- package/src/index.js +4 -4
- package/src/types.d.ts +45 -45
- package/src/utils/dateUtils.js +52 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golstats/gsc-reports",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"main": "dist/gsc-reports.umd.js",
|
|
5
5
|
"module": "dist/gsc-reports.es.js",
|
|
6
6
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@golstats/gsc-checkbox": "^1.0.13",
|
|
50
|
-
"@golstats/gsc-template-report-maker": "^1.0.
|
|
50
|
+
"@golstats/gsc-template-report-maker": "^1.0.107",
|
|
51
51
|
"axios": "^1.10.0",
|
|
52
52
|
"gridstack": "^12.1.1",
|
|
53
53
|
"tiny-emitter": "^2.1.0",
|
package/src/App.vue
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import GSCReports from './components/gsc-reports.vue'
|
|
3
|
+
import ModalConfigurarContenido from './components/elementsTemplates/ModalConfigurarContenido.vue'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
|
|
6
|
+
const showModal = ref(true)
|
|
3
7
|
|
|
4
8
|
function handleToHome() {
|
|
5
9
|
console.log('Evento toHome recibido en App.vue')
|
|
6
10
|
}
|
|
11
|
+
|
|
12
|
+
function handleModalClose() {
|
|
13
|
+
console.log('Modal cerrado')
|
|
14
|
+
showModal.value = false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function handleModalBack() {
|
|
18
|
+
console.log('Regresar al modal anterior')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function handleModalNext(options) {
|
|
22
|
+
console.log('Opciones seleccionadas:', options)
|
|
23
|
+
// Aquí puedes manejar las opciones seleccionadas
|
|
24
|
+
}
|
|
7
25
|
</script>
|
|
8
26
|
|
|
9
27
|
<template>
|
|
@@ -14,6 +32,16 @@ function handleToHome() {
|
|
|
14
32
|
token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3NTIwNDY4NTQsImV4cCI6MTc4MzU4Mjg1NH0.cs9r3OnlIh-H0G0yxjKFFYiJoA70PAbvehjcVe4y7jE"
|
|
15
33
|
@toHome="handleToHome"
|
|
16
34
|
/>
|
|
35
|
+
|
|
36
|
+
<!-- Modal de configuración de contenido
|
|
37
|
+
<ModalConfigurarContenido
|
|
38
|
+
v-if="showModal"
|
|
39
|
+
:has-rival="true"
|
|
40
|
+
token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3NTIwNDY4NTQsImV4cCI6MTc4MzU4Mjg1NH0.cs9r3OnlIh-H0G0yxjKFFYiJoA70PAbvehjcVe4y7jE"
|
|
41
|
+
@close="handleModalClose"
|
|
42
|
+
@back="handleModalBack"
|
|
43
|
+
@next="handleModalNext"
|
|
44
|
+
/>-->
|
|
17
45
|
</div>
|
|
18
46
|
</template>
|
|
19
47
|
<style>
|
|
@@ -111,6 +111,18 @@
|
|
|
111
111
|
v-if="showModalGenerarReporte"
|
|
112
112
|
@close="showModalGenerarReporte = false"
|
|
113
113
|
@switch-to-reports="$emit('switch-to-reports')"
|
|
114
|
+
@open-configurar-contenido="onOpenConfigurarContenido"
|
|
115
|
+
/>
|
|
116
|
+
<ModalConfigurarContenido
|
|
117
|
+
v-if="showModalConfigurarContenido"
|
|
118
|
+
:has-rival="true"
|
|
119
|
+
:token="token"
|
|
120
|
+
:template="configurarContenidoData?.template || null"
|
|
121
|
+
:team="team"
|
|
122
|
+
:partido="configurarContenidoData?.partido || null"
|
|
123
|
+
@close="showModalConfigurarContenido = false"
|
|
124
|
+
@back="onBackFromConfigurar"
|
|
125
|
+
@next="onNextFromConfigurar"
|
|
114
126
|
/>
|
|
115
127
|
<ModalRenameTemplate
|
|
116
128
|
v-if="showModalRenameTemplate"
|
|
@@ -167,6 +179,7 @@ import ModalGenerarReporte from './elementsTemplates/ModalGenerarReporte.vue'
|
|
|
167
179
|
import ModalRenameTemplate from './elementsTemplates/ModalRenameTemplate.vue'
|
|
168
180
|
import ModalduplicateTemplate from './elementsTemplates/ModalduplicateTemplate.vue'
|
|
169
181
|
import ModalDeleteTemplate from './elementsTemplates/ModalDeleteTemplate.vue'
|
|
182
|
+
import ModalConfigurarContenido from './elementsTemplates/ModalConfigurarContenido.vue'
|
|
170
183
|
|
|
171
184
|
// Definir las props y emits
|
|
172
185
|
const emit = defineEmits(['switch-to-reports', 'open-modal-new-template', 'edit-template'])
|
|
@@ -198,6 +211,8 @@ const showModalGenerarReporte = ref(false)
|
|
|
198
211
|
const showModalRenameTemplate = ref(false)
|
|
199
212
|
const showModalDuplicateTemplate = ref(false)
|
|
200
213
|
const showModalDeleteTemplate = ref(false)
|
|
214
|
+
const showModalConfigurarContenido = ref(false)
|
|
215
|
+
const configurarContenidoData = ref(null)
|
|
201
216
|
const renameTemplateName = ref('')
|
|
202
217
|
const renameTemplateType = ref('')
|
|
203
218
|
const duplicateTemplateName = ref('')
|
|
@@ -359,6 +374,104 @@ function onEditTemplate(template) {
|
|
|
359
374
|
emit('edit-template', template)
|
|
360
375
|
}
|
|
361
376
|
|
|
377
|
+
// Función para manejar cuando se detecta componente Fortalezas y se necesita abrir ModalConfigurarContenido
|
|
378
|
+
function onOpenConfigurarContenido(data) {
|
|
379
|
+
configurarContenidoData.value = data
|
|
380
|
+
showModalGenerarReporte.value = false
|
|
381
|
+
showModalConfigurarContenido.value = true
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Función para volver desde ModalConfigurarContenido a ModalGenerarReporte
|
|
385
|
+
function onBackFromConfigurar() {
|
|
386
|
+
showModalConfigurarContenido.value = false
|
|
387
|
+
showModalGenerarReporte.value = true
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Función para finalizar la configuración y generar el reporte
|
|
391
|
+
async function onNextFromConfigurar(options) {
|
|
392
|
+
try {
|
|
393
|
+
// Cerrar ModalConfigurarContenido
|
|
394
|
+
showModalConfigurarContenido.value = false
|
|
395
|
+
|
|
396
|
+
// Aquí podrías guardar las opciones si es necesario para el reporte
|
|
397
|
+
// Por ahora, generar el reporte normalmente
|
|
398
|
+
if (!configurarContenidoData.value) {
|
|
399
|
+
return
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Generar el reporte con los datos guardados
|
|
403
|
+
const payload = {
|
|
404
|
+
template_id: configurarContenidoData.value.template.id,
|
|
405
|
+
user_id: props.userId,
|
|
406
|
+
tournament_id: configurarContenidoData.value.liga.id || 1,
|
|
407
|
+
tournament_name: configurarContenidoData.value.liga.name,
|
|
408
|
+
season_id: configurarContenidoData.value.partido.season_id,
|
|
409
|
+
season_name: configurarContenidoData.value.torneo?.name || '',
|
|
410
|
+
game_id:
|
|
411
|
+
configurarContenidoData.value.partido.id || configurarContenidoData.value.partido.game_id,
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Generar el reporte y obtener el report_id
|
|
415
|
+
const reportResponse = await axios.post(
|
|
416
|
+
`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${props.userId}/reports`,
|
|
417
|
+
payload,
|
|
418
|
+
{
|
|
419
|
+
headers: {
|
|
420
|
+
Authorization: props.token,
|
|
421
|
+
'Content-Type': 'application/json',
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
// Intentar obtener el report_id de diferentes posibles ubicaciones en la respuesta
|
|
427
|
+
const reportId =
|
|
428
|
+
reportResponse.data?.id ||
|
|
429
|
+
reportResponse.data?.report_id ||
|
|
430
|
+
reportResponse.data?.data?.id ||
|
|
431
|
+
reportResponse.data?.data?.report_id
|
|
432
|
+
|
|
433
|
+
console.log('Report ID obtenido:', reportId)
|
|
434
|
+
console.log('Strengths Payload recibido:', options?.strengthsPayload)
|
|
435
|
+
|
|
436
|
+
// Si hay payload de fortalezas y tenemos report_id, guardar las fortalezas
|
|
437
|
+
if (options?.strengthsPayload && Object.keys(options.strengthsPayload).length > 0 && reportId) {
|
|
438
|
+
try {
|
|
439
|
+
console.log('Enviando strengths al endpoint...')
|
|
440
|
+
const strengthsResponse = await axios.post(
|
|
441
|
+
`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${props.userId}/reports/${reportId}/strengths`,
|
|
442
|
+
options.strengthsPayload,
|
|
443
|
+
{
|
|
444
|
+
headers: {
|
|
445
|
+
Authorization: props.token,
|
|
446
|
+
'Content-Type': 'application/json',
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
)
|
|
450
|
+
console.log('Strengths guardados exitosamente:', strengthsResponse.data)
|
|
451
|
+
} catch (strengthsError) {
|
|
452
|
+
console.error('Error al guardar las fortalezas:', strengthsError)
|
|
453
|
+
console.error('Error response:', strengthsError.response?.data)
|
|
454
|
+
// No bloqueamos el flujo si falla guardar las fortalezas
|
|
455
|
+
}
|
|
456
|
+
} else {
|
|
457
|
+
console.warn('No se enviaron strengths porque:', {
|
|
458
|
+
hasPayload: !!options?.strengthsPayload,
|
|
459
|
+
payloadKeys: options?.strengthsPayload ? Object.keys(options.strengthsPayload).length : 0,
|
|
460
|
+
hasReportId: !!reportId,
|
|
461
|
+
})
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Emitir evento para cambiar al tab de reportes
|
|
465
|
+
emit('switch-to-reports')
|
|
466
|
+
|
|
467
|
+
// Limpiar datos
|
|
468
|
+
configurarContenidoData.value = null
|
|
469
|
+
} catch (error) {
|
|
470
|
+
console.error('Error al generar el reporte:', error)
|
|
471
|
+
alert('Error al generar el reporte. Por favor, intenta de nuevo.')
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
362
475
|
// Resize observer para detectar cambios en el tamaño del contenedor
|
|
363
476
|
let resizeObserver = null
|
|
364
477
|
|