generated from VLADIMIR/template_frontend
up
This commit is contained in:
@@ -183,10 +183,14 @@ async function getGameScreens() {
|
||||
}
|
||||
getGameScreens()
|
||||
|
||||
function isScreenPlanEditing() {
|
||||
return screenPlanMode.value === 'edit'
|
||||
}
|
||||
|
||||
async function getScreenPlan() {
|
||||
if (screenPlanMode.value === 'edit' || screenPlanDirty.value) return
|
||||
if (isScreenPlanEditing() || screenPlanDirty.value) return
|
||||
const res = await client.GetScreenPlan({ gameID: Number(gameId) })
|
||||
if (screenPlanDirty.value) return
|
||||
if (isScreenPlanEditing() || screenPlanDirty.value) return
|
||||
screenPlan.value = res.plan
|
||||
screenPlanDraft.value = res.plan?.steps?.map((step) => ({ ...step })) || []
|
||||
}
|
||||
@@ -233,13 +237,6 @@ function markScreenPlanDirty() {
|
||||
screenPlanDirty.value = true
|
||||
}
|
||||
|
||||
function updateScreenPlanText(index: number, value: string | null) {
|
||||
const step = screenPlanDraft.value[index]
|
||||
if (!step) return
|
||||
step.text = value || ''
|
||||
screenPlanDirty.value = true
|
||||
}
|
||||
|
||||
async function saveScreenPlan() {
|
||||
if (screenPlanSaving.value) return
|
||||
screenPlanSaving.value = true
|
||||
@@ -965,11 +962,11 @@ useSimplePolling(() => {
|
||||
/>
|
||||
<n-input
|
||||
v-if="step.mode === 'SCREEN_MODE_TEXT'"
|
||||
:value="step.text"
|
||||
v-model:value="step.text"
|
||||
size="small"
|
||||
placeholder="Текст экрана"
|
||||
style="min-width: 240px"
|
||||
@update:value="(value) => updateScreenPlanText(index, value)"
|
||||
@update:value="markScreenPlanDirty"
|
||||
/>
|
||||
<template v-if="step.mode === 'SCREEN_MODE_TIMER'">
|
||||
<n-input
|
||||
|
||||
Reference in New Issue
Block a user