diff --git a/src/components/PlaceBlock.vue b/src/components/PlaceBlock.vue index 0d0d5e2..ce78ce9 100644 --- a/src/components/PlaceBlock.vue +++ b/src/components/PlaceBlock.vue @@ -1,7 +1,9 @@ - + + - + + + + + + + + + + + [{{ props.place.code }}] - {{ props.place.name }} {{ props.place.text }} - - {{ application.name }} + + + {{ door.name }} + + + {{ key.name }} + + + + + Приложение: {{ application.name }} + + + + + Скрытая точка + + + + + {{ key.name }} + - - + + - - - + + + + Скрытая точка + + + Обычная точка + + + Улики Добавить улику @@ -104,25 +115,42 @@ function onCreateKey(): Key { + Действия Добавить действие + + + create(index)" class="plus-minus-buttons">+ + remove(index)" class="plus-minus-buttons">- + + - - - + + + + + + + + + Требуемые ключи + + + Добавить ключ + + + + + + + + - - Добавить ключ - - - - - - + Получаемые ключи Добавить ключ @@ -132,30 +160,23 @@ function onCreateKey(): Key { - + + + diff --git a/src/components/ScenariosEditorPage.vue b/src/components/ScenariosEditorPage.vue index d1dae29..a7dda93 100644 --- a/src/components/ScenariosEditorPage.vue +++ b/src/components/ScenariosEditorPage.vue @@ -126,9 +126,37 @@ async function addPlace() { applications: undefined, doors: undefined, keys: undefined, + mode: 'add' } } +async function addNotFoundDoors(scenario: Scenario, place: Place) { + place.doors?.forEach(async (door) => { + let place = scenario.story?.places?.find((place) => { + return place.code == door.code + }) + if (place == undefined) { + const res = await client.AddScenarioPlace({ + id: scenario.id, + place: { + code: door.code, + name: door.name, + text: undefined, + image: undefined, + hidden: undefined, + applications: undefined, + doors: undefined, + keys: undefined + }, + }) + if (res.error != '') { + message.error(res.error!) + return + } + } + }) +} + async function collapseAddPlace(place: Place) { place.mode = 'mini-add' } @@ -140,6 +168,7 @@ async function cancelUpdatePlace(place: Place) { } async function updatePlace(place: Place) { + await addNotFoundDoors(scenario.value, place) const res = await client.UpdateScenarioPlace({ id: scenario.value.id, code: place.oldCode, @@ -188,12 +217,8 @@ async function deletePlace(place: Place) { - + Удалить Отмена @@ -205,39 +230,20 @@ async function deletePlace(place: Place) { - + x Название - + Описание - + Картинка - + @@ -254,17 +260,9 @@ async function deletePlace(place: Place) { Введите название сценария {{ scenario.name }} чтобы удалить его - - + + Удалить сценарий @@ -312,7 +310,7 @@ async function deletePlace(place: Place) { /* border: 1px solid red; */ } -@media (width >= 1024px) { +@media (width >=1024px) { .places-container { padding: 20px 250px; height: calc(100vh - 70px);
+
[{{ props.place.code }}] - {{ props.place.name }}
- {{ application.name }} + +
+ + Скрытая точка + + + + + {{ key.name }} +
Требуемые ключи
Название
Описание
Картинка