add email

This commit is contained in:
2026-09-16 04:08:25 +07:00
parent ffa5dd3261
commit 8a3b689c26
47 changed files with 68 additions and 52 deletions
+16 -3
View File
@@ -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>