mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 13:38:12 +00:00
feat/restruct: saving timetables to local storage
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="globalStore.selectedStorageTimetable == null && Object.keys(globalStore.storageTimetables).length == 0">
|
||||
<div class="font-bold text-xl">TRYB WYSZUKIWANA ZAPISANYCH ROZKŁADÓW JAZDY</div>
|
||||
<div>Użyj funkcji zapisu rozkładu jazdy, aby go tutaj wyświetlić.</div>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<ul class="flex flex-col gap-3">
|
||||
<li v-for="timetable in globalStore.storageTimetables" class="text-left">
|
||||
<button class="bg-zinc-900 p-2 w-full text-zinc-300 cursor-pointer hover:bg-zinc-800" @click="selectTimetable(timetable)">
|
||||
<b>{{ timetable.category }} {{ timetable.trainNo }}</b> {{ timetable.route.replace('|', ' - ') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useGlobalStore } from '../../stores/global.store';
|
||||
import type { TimetableData } from '../../types/common.types';
|
||||
|
||||
const globalStore = useGlobalStore();
|
||||
|
||||
function selectTimetable(timetable: TimetableData) {
|
||||
globalStore.selectedStorageTimetable = timetable;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user