add action
This commit is contained in:
parent
7b620dffd4
commit
dd41cd08dd
@ -6,26 +6,12 @@ import VueQrcode from '@chenfengyuan/vue-qrcode';
|
||||
import BeltBlock from './BeltBlock.vue';
|
||||
import MetalPlate from './MetalPlate.vue';
|
||||
import GameHeader from './GameHeader.vue';
|
||||
import type { Application } from './application';
|
||||
import type { Action } from './action';
|
||||
import type { Door } from './door';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
type Action = {
|
||||
id: string
|
||||
place: string
|
||||
name: string
|
||||
text: string
|
||||
image: string
|
||||
applications: Application[]
|
||||
hidden: boolean
|
||||
doors: Door[]
|
||||
|
||||
isOpen: boolean
|
||||
buttons: Door[]
|
||||
}
|
||||
|
||||
type Team = {
|
||||
name: string
|
||||
actions: Action[]
|
||||
@ -94,7 +80,7 @@ function getTeam() {
|
||||
}
|
||||
for (let i = 0; i < team.value.actions.length; i++) {
|
||||
const element = team.value.actions[i];
|
||||
team.value.actions[i].buttons = element.doors.filter((door) => { return door.show })
|
||||
team.value.actions[i].buttons = element.doors.filter((door: Door) => { return door.show })
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
29
src/components/action.ts
Normal file
29
src/components/action.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import type { Application } from './application'
|
||||
import type { Door } from './door'
|
||||
|
||||
// Действие
|
||||
// Посещение точки игры
|
||||
export type Action = {
|
||||
// Идентификатор действия
|
||||
id: string
|
||||
// Код точки
|
||||
place: string
|
||||
// Название точки
|
||||
name: string
|
||||
// Текст точки
|
||||
text: string
|
||||
// Ссылка на картинку
|
||||
image: string
|
||||
// Список приложений
|
||||
applications: Application[]
|
||||
// Видимость/доступность точки
|
||||
hidden: boolean
|
||||
// Двери точки
|
||||
doors: Door[]
|
||||
|
||||
// Поля для интерфейса
|
||||
// Сворачивание
|
||||
isOpen: boolean
|
||||
// Кнопки
|
||||
buttons: Door[]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user