feat: unterstütze mehrere Spielplan-Team-IDs und verbessere die Zuordnung importierter Mannschaften
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 7m17s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m46s

This commit is contained in:
Torsten Schulz (local)
2026-07-17 11:49:55 +02:00
parent 75a7c409cd
commit 461f2de8dc
5 changed files with 165 additions and 12 deletions

View File

@@ -203,19 +203,21 @@
>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Spielplan-Team-ID</label>
<label class="block text-sm font-medium text-gray-700 mb-2">Spielplan-Team-IDs</label>
<select
v-model="formData.spielplan_mannschaft_id"
:value="selectedSpielplanTeamIds"
multiple
size="4"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
:disabled="isSaving"
@change="updateSpielplanTeamIds"
>
<option value="">Keine ID auswählen</option>
<option v-for="team in spielplanTeams" :key="team.id" :value="team.id">
{{ team.label }}
</option>
</select>
<p class="mt-1 text-xs text-gray-500">
Nach dem myTischtennis-Import das passende Team auswählen.
Nach dem myTischtennis-Import alle passenden Einträge auswählen (z. B. Liga und Pokal). Mit Strg bzw. Cmd lassen sich mehrere Einträge markieren.
</p>
</div>
<div>
@@ -444,6 +446,10 @@ function newSpielerItem(name = '') { return { id: `${Date.now()}-${Math.random()
function parseSpielerString(s) { if (!s) return []; return String(s).split(';').map(x => x.trim()).filter(Boolean).map(name => newSpielerItem(name)) }
function serializeSpielerList(list) { return (list || []).map(s => (s?.name || '').trim()).filter(Boolean).join('; ') }
function serializeSpielerNames(names) { return (names || []).map(s => String(s || '').trim()).filter(Boolean).join('; ') }
const selectedSpielplanTeamIds = computed(() => String(formData.value.spielplan_mannschaft_id || '').split(',').map(id => id.trim()).filter(Boolean))
const updateSpielplanTeamIds = (event) => {
formData.value.spielplan_mannschaft_id = Array.from(event.target.selectedOptions, option => option.value).join(',')
}
async function fetchCsvText(url) {
const attempt = async () => { const r = await fetch(`${url}${url.includes('?') ? '&' : '?'}_t=${Date.now()}`, { cache: 'no-store' }); if (!r.ok) throw new Error(`HTTP ${r.status}`); return await r.text() }
@@ -531,7 +537,7 @@ const loadSpielplanTeams = async () => {
const isHarheimer = String(row[`${side}VereinNr`] || '') === '43030' || String(row[`${side}VereinName`] || '') === 'Harheimer TC'
const id = String(row[`${side}MannschaftId`] || '').trim()
if (!isHarheimer || !id || teams.has(id)) continue
const label = [row[`${side}Mannschaft`], row[`${side}MannschaftAltersklasse`], row[`${side}MannschaftNr`] ? `Nr. ${row[`${side}MannschaftNr`]}` : ''].filter(Boolean).join(' · ')
const label = [row[`${side}Mannschaft`], row[`${side}MannschaftAltersklasse`], row.Liga || row.Staffel, row[`${side}MannschaftNr`] ? `Nr. ${row[`${side}MannschaftNr`]}` : ''].filter(Boolean).join(' · ')
teams.set(id, { id, label: `${label} [${id}]` })
}
}