generated from VLADIMIR/template_frontend
up
This commit is contained in:
@@ -1777,6 +1777,7 @@ message AddTeamReq {
|
|||||||
int32 gameID = 1;
|
int32 gameID = 1;
|
||||||
string name = 2;
|
string name = 2;
|
||||||
string captain_email = 3;
|
string captain_email = 3;
|
||||||
|
int32 participants_count = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AddTeamRsp {
|
message AddTeamRsp {
|
||||||
|
|||||||
@@ -808,6 +808,7 @@ export type AddTeamReq = {
|
|||||||
gameID: number | undefined;
|
gameID: number | undefined;
|
||||||
name: string | undefined;
|
name: string | undefined;
|
||||||
captainEmail: string | undefined;
|
captainEmail: string | undefined;
|
||||||
|
participantsCount: number | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AddTeamRsp = {
|
export type AddTeamRsp = {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ const showDeleteTeamModal = ref(false)
|
|||||||
const showDeleteGameModal = ref(false)
|
const showDeleteGameModal = ref(false)
|
||||||
const newTeamName = ref('')
|
const newTeamName = ref('')
|
||||||
const newTeamEmail = ref('')
|
const newTeamEmail = ref('')
|
||||||
|
const newTeamParticipants = ref(1)
|
||||||
const deletedGameName = ref('')
|
const deletedGameName = ref('')
|
||||||
const showQR = ref(false)
|
const showQR = ref(false)
|
||||||
const urlQR = ref('')
|
const urlQR = ref('')
|
||||||
@@ -432,14 +433,20 @@ function giveApplication(team: Team, application: Application) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addTeam() {
|
async function addTeam() {
|
||||||
|
if (newTeamParticipants.value < 1 || newTeamParticipants.value > 8) {
|
||||||
|
message.error('Укажите от 1 до 8 игроков')
|
||||||
|
return
|
||||||
|
}
|
||||||
await client.AddTeam({
|
await client.AddTeam({
|
||||||
gameID: game.value.ID,
|
gameID: game.value.ID,
|
||||||
name: newTeamName.value,
|
name: newTeamName.value,
|
||||||
captainEmail: newTeamEmail.value.trim(),
|
captainEmail: newTeamEmail.value.trim(),
|
||||||
|
participantsCount: newTeamParticipants.value,
|
||||||
})
|
})
|
||||||
await getGame(game.value.ID!)
|
await getGame(game.value.ID!)
|
||||||
showAddTeamModal.value = false
|
showAddTeamModal.value = false
|
||||||
newTeamEmail.value = ''
|
newTeamEmail.value = ''
|
||||||
|
newTeamParticipants.value = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirmGiveApplication() {
|
async function confirmGiveApplication() {
|
||||||
@@ -1135,6 +1142,14 @@ useSimplePolling(() => {
|
|||||||
placeholder="Почта капитана (необязательно)"
|
placeholder="Почта капитана (необязательно)"
|
||||||
aria-label="Почта капитана (необязательно)"
|
aria-label="Почта капитана (необязательно)"
|
||||||
/>
|
/>
|
||||||
|
<n-input-number
|
||||||
|
v-model:value="newTeamParticipants"
|
||||||
|
:min="1"
|
||||||
|
:max="8"
|
||||||
|
:precision="0"
|
||||||
|
placeholder="Количество игроков"
|
||||||
|
aria-label="Количество игроков"
|
||||||
|
/>
|
||||||
</n-space>
|
</n-space>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<n-flex justify="end">
|
<n-flex justify="end">
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ async function addGame(name: string, id: number) {
|
|||||||
name: 'Тестовая команда',
|
name: 'Тестовая команда',
|
||||||
captainEmail: '',
|
captainEmail: '',
|
||||||
gameID: resAddGame.ID!,
|
gameID: resAddGame.ID!,
|
||||||
|
participantsCount: undefined,
|
||||||
})
|
})
|
||||||
router.push('/team-story/' + resAddTeam.ID! + '?password=' + resAddTeam.password!)
|
router.push('/team-story/' + resAddTeam.ID! + '?password=' + resAddTeam.password!)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user