This commit is contained in:
2026-09-16 04:28:47 +07:00
parent 8a3b689c26
commit 4d3fe17bcd
42 changed files with 47 additions and 83 deletions
+1 -37
View File
@@ -68,36 +68,14 @@ const game = ref<Game>({
scenario: undefined,
teams: undefined,
})
const participationFilter = ref('all')
const participationOptions = [
{ label: 'Все команды', value: 'all' },
{ label: 'Ожидает ответа', value: 'pending' },
{ label: 'Подтверждено', value: 'confirmed' },
{ label: 'Отменено', value: 'cancelled' },
]
const participationSummary = computed(() =>
participationOptions.slice(1).map((option) => {
const teams = (game.value.teams || []).filter(
(team) =>
team.participationStatus === option.value &&
(option.value !== 'pending' || Boolean(team.captainEmail)),
)
return {
...option,
count: teams.length,
participants: teams.reduce((sum, team) => sum + (team.participantsCount || 0), 0),
}
}),
)
const activeTeamCount = computed(
() => (game.value.teams || []).filter((team) => team.participationStatus !== 'cancelled').length,
)
const visibleTeams = computed(() =>
(game.value.teams || []).filter(
(team) =>
participationFilter.value === 'all' || team.participationStatus === participationFilter.value,
),
)
const teamsNeedingApplications = computed(
() =>
new Map(
@@ -882,21 +860,7 @@ useSimplePolling(() => {
<p class="place-image-plus">+</p>
</div>
<n-space vertical>
<n-tag>
<template v-for="(item, index) in participationSummary" :key="item.value">
{{ index ? ' | ' : '' }}{{ item.label }}: {{ item.count }} команд ·
{{ item.participants }} участников
</template>
</n-tag>
<n-select
v-model:value="participationFilter"
:options="participationOptions"
aria-label="Статус участия"
/>
</n-space>
<div v-for="team in visibleTeams" :key="team.id" class="team-block">
<div v-for="team in game.teams" :key="team.id" class="team-block">
<div class="team-content-block">
<n-flex justify="space-between">
<div class="title-block">