generated from VLADIMIR/template_frontend
add email
This commit is contained in:
@@ -52,6 +52,7 @@ const showAddTeamModal = ref(false)
|
||||
const showDeleteTeamModal = ref(false)
|
||||
const showDeleteGameModal = ref(false)
|
||||
const newTeamName = ref('')
|
||||
const newTeamEmail = ref('')
|
||||
const deletedGameName = ref('')
|
||||
const showQR = ref(false)
|
||||
const urlQR = ref('')
|
||||
@@ -206,9 +207,11 @@ function moveMapDrag(event: PointerEvent) {
|
||||
if (!dragState) return
|
||||
const step = dragState.item.kind === 'team' ? 20 : 1
|
||||
dragState.item.x =
|
||||
Math.round((dragState.itemX + (event.clientX - dragState.startX) / mapScale.value) / step) * step
|
||||
Math.round((dragState.itemX + (event.clientX - dragState.startX) / mapScale.value) / step) *
|
||||
step
|
||||
dragState.item.y =
|
||||
Math.round((dragState.itemY + (event.clientY - dragState.startY) / mapScale.value) / step) * step
|
||||
Math.round((dragState.itemY + (event.clientY - dragState.startY) / mapScale.value) / step) *
|
||||
step
|
||||
}
|
||||
|
||||
async function endMapDrag() {
|
||||
@@ -412,6 +415,7 @@ async function addTeam() {
|
||||
const res = await client.AddTeam({
|
||||
gameId: game.value.id,
|
||||
name: newTeamName.value,
|
||||
captainEmail: newTeamEmail.value.trim(),
|
||||
})
|
||||
if (res.error != '') {
|
||||
message.error(res.error!)
|
||||
@@ -419,6 +423,7 @@ async function addTeam() {
|
||||
}
|
||||
await getGame(game.value.id!)
|
||||
showAddTeamModal.value = false
|
||||
newTeamEmail.value = ''
|
||||
}
|
||||
|
||||
async function confirmGiveApplication() {
|
||||
@@ -1070,7 +1075,15 @@ useSimplePolling(() => {
|
||||
<template #header-extra>
|
||||
<n-button @click="showAddTeamModal = false"> x </n-button>
|
||||
</template>
|
||||
<n-input v-model:value="newTeamName" type="text" placeholder="Три дебила" />
|
||||
<n-space vertical>
|
||||
<n-input v-model:value="newTeamName" type="text" placeholder="Три дебила" />
|
||||
<n-input
|
||||
v-model:value="newTeamEmail"
|
||||
:input-props="{ type: 'email', autocomplete: 'email' }"
|
||||
placeholder="Почта капитана (необязательно)"
|
||||
aria-label="Почта капитана (необязательно)"
|
||||
/>
|
||||
</n-space>
|
||||
<template #footer>
|
||||
<n-flex justify="end">
|
||||
<n-button @click="addTeam()" :disabled="newTeamName.length == 0"> Создать </n-button>
|
||||
|
||||
@@ -202,6 +202,7 @@ async function addGame(name: string, id: number) {
|
||||
}
|
||||
const resAddTeam = await client.AddTeam({
|
||||
name: 'Тестовая команда',
|
||||
captainEmail: '',
|
||||
gameId: resAddGame.id!,
|
||||
})
|
||||
if (resAddTeam.error != '') {
|
||||
|
||||
Reference in New Issue
Block a user