generated from VLADIMIR/template_frontend
clear
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user