From 5621830803e416107182619a1aa849f61e516cfa Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Sat, 21 Feb 2026 19:16:27 +0100 Subject: [PATCH] feat(controller): aggiunge modal formazione a inizio set Dopo la conferma di un set finito appare automaticamente un secondo modal "FORMAZIONE SET N" con gli input (resettati a 1-6) per registrare la formazione del set successivo. Al click INIZIA vengono inviati setFormazione per home e guest, e la formazione viene archiviata in formInizioSet (e quindi nel DB a fine partita via strisce[].formInizio). Se la conferma del set conclude la partita, il modal formazione viene chiuso automaticamente non appena lo stato con partitaFinita arriva dal server --- src/components/ControllerPage.vue | 69 ++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/src/components/ControllerPage.vue b/src/components/ControllerPage.vue index 6b14d27..2740f72 100644 --- a/src/components/ControllerPage.vue +++ b/src/components/ControllerPage.vue @@ -87,7 +87,51 @@
{{ state.sp.punt.home }} – {{ state.sp.punt.guest }}
- + +
+ + + + +
+
+
+ FORMAZIONE SET {{ state.sp.set.home + state.sp.set.guest + 1 }} +
+
+ +
+
+ + + +
+
+
+ + + +
+
+
+
+ +
+
+ + + +
+
+
+ + + +
+
+
+
+
@@ -201,6 +245,11 @@ export default { reconnectAttempts: 0, maxReconnectDelay: 30000, confirmReset: false, + showFormazioneModal: false, + formazioneSetData: { + home: ["1", "2", "3", "4", "5", "6"], + guest: ["1", "2", "3", "4", "5", "6"], + }, showConfig: false, showCambiTeam: false, showCambi: false, @@ -374,6 +423,9 @@ export default { if (msg.type === 'state') { this.state = msg.state + if (this.state.sp.partitaFinita && this.showFormazioneModal) { + this.showFormazioneModal = false + } } else if (msg.type === 'error') { console.error('[Controller] Server error:', msg.message) // Fornisce feedback di errore all'utente. @@ -454,6 +506,21 @@ export default { console.error('[Controller] Error:', message) }, + confermaSetEApriFormazione() { + this.sendAction({ type: 'confermaSet' }) + this.formazioneSetData = { + home: ["1", "2", "3", "4", "5", "6"], + guest: ["1", "2", "3", "4", "5", "6"], + } + this.showFormazioneModal = true + }, + + confermaFormazioneSet() { + this.sendAction({ type: 'setFormazione', team: 'home', form: this.formazioneSetData.home }) + this.sendAction({ type: 'setFormazione', team: 'guest', form: this.formazioneSetData.guest }) + this.showFormazioneModal = false + }, + doReset() { this.sendAction({ type: 'resetta' }) this.confirmReset = false