diff --git a/src/App.vue b/src/App.vue index 59ba941..bb9360f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,510 +1,19 @@ - - - diff --git a/src/components/App/MainBottom.vue b/src/components/App/MainBottom.vue new file mode 100644 index 0000000..ed31273 --- /dev/null +++ b/src/components/App/MainBottom.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/components/App/MainContainer.vue b/src/components/App/MainContainer.vue new file mode 100644 index 0000000..a27f6ac --- /dev/null +++ b/src/components/App/MainContainer.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/components/App/Navbar.vue b/src/components/App/Navbar.vue new file mode 100644 index 0000000..36ac27f --- /dev/null +++ b/src/components/App/Navbar.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/components/Timetable/TimetableBody.vue b/src/components/Timetable/TimetableBody.vue new file mode 100644 index 0000000..8c967b1 --- /dev/null +++ b/src/components/Timetable/TimetableBody.vue @@ -0,0 +1,331 @@ + + + + + diff --git a/src/components/Timetable/TimetableHeader.vue b/src/components/Timetable/TimetableHeader.vue new file mode 100644 index 0000000..3c5151d --- /dev/null +++ b/src/components/Timetable/TimetableHeader.vue @@ -0,0 +1,42 @@ + diff --git a/src/components/Timetable/TimetableSelect.vue b/src/components/Timetable/TimetableSelect.vue new file mode 100644 index 0000000..4369c81 --- /dev/null +++ b/src/components/Timetable/TimetableSelect.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/components/Timetable/TrainTimetable.vue b/src/components/Timetable/TrainTimetable.vue new file mode 100644 index 0000000..f23aeb8 --- /dev/null +++ b/src/components/Timetable/TrainTimetable.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/stores/global.store.ts b/src/stores/global.store.ts index f443b54..c5f6400 100644 --- a/src/stores/global.store.ts +++ b/src/stores/global.store.ts @@ -1,7 +1,23 @@ import { defineStore } from 'pinia'; +import { useApiStore } from './api.store'; +import type { ActiveTrain } from '../types/common.types'; export const useGlobalStore = defineStore('global', { - state: () => ({}), - getters: {}, + state: () => ({ + selectedTrain: null as ActiveTrain | null, + + + generatedDate: null as Date | null, + generatedMs: 0, + }), + getters: { + activeTimetableTrains() { + const apiStore = useApiStore(); + + if (!apiStore.activeData) return []; + + return apiStore.activeData.trains.filter((train) => train.timetable).sort((t1, t2) => t1.driverName.localeCompare(t2.driverName, 'pl-PL')); + }, + }, actions: {}, }); diff --git a/src/types/common.types.ts b/src/types/common.types.ts index 40823a9..572255c 100644 --- a/src/types/common.types.ts +++ b/src/types/common.types.ts @@ -121,3 +121,28 @@ export interface SceneryRoute { hidden?: boolean; realLineNo?: number; } + +export interface StopRow { + pointName: string; + pointKm: string; + isMain: boolean; + stopTime: number; + stopType: string; + scheduledArrivalDate: Date | null; + scheduledDepartureDate: Date | null; + realLine: string; + driveTime: number; + controlAbbrevs: string[]; + additionalAbbrevs: string[]; + sceneryName: string; + arrivalKm: string; + arrivalSpeed: number; + arrivalTracks: number; + departureKm: string; + departureSpeed: number; + departureTracks: number; + headLocos: string[]; + stockVmax: number; + stockLength: number; + stockMass: number; +}