@golstats/gsc-reports 1.0.43 → 1.0.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golstats/gsc-reports",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
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.56",
50
+ "@golstats/gsc-template-report-maker": "^1.0.58",
51
51
  "@golstats/gsc-volumetric-field": "^1.0.1",
52
52
  "axios": "^1.10.0",
53
53
  "gridstack": "^12.1.1",
package/src/App.vue CHANGED
@@ -11,7 +11,7 @@ function handleToHome() {
11
11
  <GSCReports
12
12
  :team="1"
13
13
  :user-id="24254"
14
- token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3NTIwNDY4NTQsImV4cCI6MTc4MzU4Mjg1NH0.cs9r3OnlIh-H0G0yxjKFFYiJoA70PAbvehjcVe4y7jE"
14
+ token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3NTI1Mjc5NzUsImV4cCI6MTc4NDA2Mzk3NX0.MVy0JhRLXvGbg1gQinnR9JrONckDT7FePTzkWdSozgI"
15
15
  @toHome="handleToHome"
16
16
  />
17
17
  </div>
@@ -65,6 +65,7 @@
65
65
  (nombre) => {
66
66
  generarTemplateId = template.id
67
67
  generarTemplateType = template.template_type
68
+ generarTemplate = template
68
69
  showModalGenerarReporte = true
69
70
  }
70
71
  "
@@ -105,6 +106,7 @@
105
106
  :token="token"
106
107
  :template-id="generarTemplateId"
107
108
  :template-type="generarTemplateType"
109
+ :template="generarTemplate"
108
110
  v-if="showModalGenerarReporte"
109
111
  @close="showModalGenerarReporte = false"
110
112
  @switch-to-reports="$emit('switch-to-reports')"
@@ -204,6 +206,7 @@ const duplicarTemplateId = ref('')
204
206
  const generarTemplateId = ref('')
205
207
  const renameTemplateId = ref('')
206
208
  const generarTemplateType = ref('')
209
+ const generarTemplate = ref(null)
207
210
  const sortDropdownRef = ref(null)
208
211
  const templatesSectionRef = ref(null)
209
212
  const templatesListRef = ref(null)
@@ -301,6 +301,10 @@ const props = defineProps({
301
301
  type: String,
302
302
  required: false,
303
303
  },
304
+ template: {
305
+ type: Object,
306
+ required: false,
307
+ },
304
308
  })
305
309
 
306
310
  const emit = defineEmits(['close', 'generar', 'switch-to-reports'])
@@ -609,7 +613,10 @@ async function generarReporte() {
609
613
  // Construir el payload
610
614
  const payload = {
611
615
  template_id: props.templateId,
612
- user_id: parseInt(props.userId),
616
+ user_id:
617
+ props.template && props.template.user_id
618
+ ? parseInt(props.template.user_id)
619
+ : parseInt(props.userId),
613
620
  tournament_id: selectedLiga.value.id || 1,
614
621
  tournament_name: selectedLiga.value.name,
615
622
  season_id: selectedPartido.value.season_id,
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <GSCTemplateReportMaker ref="reportTemplateMaker" :token="token" @close="closeReport" />
2
+ <GSCTemplateReportMaker
3
+ ref="reportTemplateMaker"
4
+ :token="token"
5
+ :user-team-id="team"
6
+ @close="closeReport"
7
+ />
3
8
  <div ref="containerRef" class="reports-container">
4
9
  <ModalSoloEscritorio v-if="showMobileWarning" @toHome="toHome" />
5
10
  <h1 class="title">Mis reportes</h1>
@@ -102,6 +107,7 @@
102
107
  :token="token"
103
108
  :team="team"
104
109
  :searchQuery="searchQuery"
110
+ :key="templatesSectionKey"
105
111
  @switch-to-reports="activeTab = 'reports'"
106
112
  @open-modal-new-template="onOpenModalNewTemplate"
107
113
  @edit-template="onEditTemplate"
@@ -164,6 +170,7 @@ const searchQuery = ref('')
164
170
  const searchQueryReports = ref('')
165
171
  const reportTemplateMaker = ref(null)
166
172
  const templatesSectionRef = ref(null)
173
+ const templatesSectionKey = ref(0) // Key to force re-render of TemplatesSection
167
174
 
168
175
  const emit = defineEmits(['toHome', 'download-report'])
169
176
 
@@ -246,7 +253,9 @@ function closeReport() {
246
253
  if (templatesSectionRef.value) {
247
254
  templatesSectionRef.value.obtenerTemplates()
248
255
  }
256
+ templatesSectionKey.value += 1 // Force re-render of TemplatesSection
249
257
  }
258
+
250
259
  </script>
251
260
  <style>
252
261
  .grid-stack-item-content {