generated from VLADIMIR/template_frontend
add online games
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { Flag, Pause, Play, Reset, Settings, Trophy } from '@vicons/carbon'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { NButton, NTag } from 'naive-ui'
|
||||
import { NCard, NFlex, NInput, NInputNumber, NModal, NQrCode, NSpace, NText } from 'naive-ui'
|
||||
import { NCard, NFlex, NInput, NInputNumber, NModal, NQrCode, NSelect, NSpace, NText } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
@@ -36,7 +36,7 @@ const gameId = route.params.id
|
||||
const message = useMessage()
|
||||
|
||||
const showSettingsModal = ref(false)
|
||||
const settingsDraft = ref({ name: '', description: '' })
|
||||
const settingsDraft = ref({ name: '', description: '', format: 'online' })
|
||||
const showGiveApplicationModal = ref(false)
|
||||
const showAddTeamModal = ref(false)
|
||||
const showDeleteTeamModal = ref(false)
|
||||
@@ -53,6 +53,7 @@ const game = ref<Game>({
|
||||
description: undefined,
|
||||
startAt: undefined,
|
||||
status: undefined,
|
||||
format: undefined,
|
||||
scenario: undefined,
|
||||
teams: undefined,
|
||||
})
|
||||
@@ -272,6 +273,7 @@ function openSettings() {
|
||||
settingsDraft.value = {
|
||||
name: game.value.name || '',
|
||||
description: game.value.description || '',
|
||||
format: game.value.format || 'online',
|
||||
}
|
||||
showSettingsModal.value = true
|
||||
}
|
||||
@@ -285,6 +287,7 @@ async function updateGame() {
|
||||
id: game.value.id,
|
||||
name: settingsDraft.value.name,
|
||||
description: settingsDraft.value.description,
|
||||
format: settingsDraft.value.format,
|
||||
startAt: game.value.startAt,
|
||||
scenarioId: game.value.scenario?.id,
|
||||
})
|
||||
@@ -738,6 +741,13 @@ useSimplePolling(() => {
|
||||
<p>Название</p>
|
||||
<n-input v-model:value="settingsDraft.name" type="text" placeholder='Дело №0 "Следствие ведут овечки"' />
|
||||
|
||||
<p class="settings-header">Формат игры</p>
|
||||
<n-select
|
||||
v-model:value="settingsDraft.format"
|
||||
:options="[{ label: 'Online', value: 'online' }, { label: 'Offline', value: 'offline' }]"
|
||||
aria-label="Формат игры"
|
||||
/>
|
||||
|
||||
<p class="settings-header">Описание</p>
|
||||
<n-input v-model:value="settingsDraft.description" type="textarea" placeholder="Убийство пастуха..." />
|
||||
</n-space>
|
||||
|
||||
Reference in New Issue
Block a user