From a01fd5c45281bd20244b43eb544e96499f96737e Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Sun, 11 Oct 2026 03:05:44 +0700 Subject: [PATCH] up --- src/components/GameInputForm.vue | 20 ++++++++++------ src/components/GamePage.vue | 40 ++++++++++++++++++++++++++++---- src/components/TeamStoryPage.vue | 27 ++++++++++++--------- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/src/components/GameInputForm.vue b/src/components/GameInputForm.vue index 09cc310..bd8525e 100644 --- a/src/components/GameInputForm.vue +++ b/src/components/GameInputForm.vue @@ -8,18 +8,24 @@ import BeltBlock from './BeltBlock.vue' import HeaderText from './HeaderText.vue' import MetalPlate from './MetalPlate.vue' -const code = ref('') - const props = defineProps<{ - addAction: (param: string) => void + addAction: (param: string) => Promise allPlacesCount: number newPlacesCount: number gameStatus: string }>() +const code = ref('') +const isSubmitting = ref(false) + async function addClickButton() { - await props.addAction(code.value) - code.value = '' + if (isSubmitting.value || props.gameStatus != 'run' || code.value.length == 0) return + isSubmitting.value = true + try { + if (await props.addAction(code.value)) code.value = '' + } finally { + isSubmitting.value = false + } } function getTextForCounter(count: number): string[] { @@ -87,14 +93,14 @@ function getTextForCounter(count: number): string[] { v-model="code" type="text" :placeholder="props.gameStatus == 'run' ? 'Место назначения' : 'Ходы запрещены'" - :disabled="props.gameStatus != 'run'" + :disabled="props.gameStatus != 'run' || isSubmitting" />