mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Dodano odświeżony widok historii rozkładów jazdy
This commit is contained in:
+2
-4
@@ -199,12 +199,10 @@
|
||||
"search": "Search",
|
||||
"search-train": "Train no.",
|
||||
"search-driver": "Driver name",
|
||||
"driver-name": "Driver:",
|
||||
"route-length": "Route length:",
|
||||
"station-count": "Stations:",
|
||||
"begins-at": "Begins at:",
|
||||
"terminates-at": "Terminates at:",
|
||||
"terminates-at-actual": "Terminates at (actual time):",
|
||||
"dispatcher-name": "Created by",
|
||||
"timetable-day": "Timetable created at",
|
||||
"timetable-active": "ACTIVE",
|
||||
"timetable-fulfilled": "FULFILLED",
|
||||
"timetable-abandoned": "ABANDONED"
|
||||
|
||||
+2
-4
@@ -199,12 +199,10 @@
|
||||
"search": "Szukaj",
|
||||
"search-train": "Numer pociągu",
|
||||
"search-driver": "Nick maszynisty",
|
||||
"driver-name": "Maszynista:",
|
||||
"route-length": "Kilometraż:",
|
||||
"station-count": "Stacje:",
|
||||
"begins-at": "Rozpoczęcie:",
|
||||
"terminates-at": "Zakończenie (planowe):",
|
||||
"terminates-at-actual": "Zakończenie (rzeczywiste):",
|
||||
"dispatcher-name": "Wystawiony przez dyżurnego",
|
||||
"timetable-day": "Rozkład z dnia",
|
||||
"timetable-active": "AKTYWNY",
|
||||
"timetable-fulfilled": "WYPEŁNIONY",
|
||||
"timetable-abandoned": "PORZUCONY"
|
||||
|
||||
+23
-8
@@ -3,14 +3,29 @@ import { defineComponent } from 'vue';
|
||||
export default defineComponent({
|
||||
methods: {
|
||||
localeDate(dateString: string, locale: string) {
|
||||
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
hour:"2-digit",
|
||||
minute: "2-digit"
|
||||
})
|
||||
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit"
|
||||
})
|
||||
},
|
||||
|
||||
localeDay(dateString: string, locale: string) {
|
||||
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||
day: "numeric",
|
||||
month: "2-digit",
|
||||
year: "numeric"
|
||||
})
|
||||
},
|
||||
|
||||
localeTime(dateString: string, locale: string) {
|
||||
return new Date(dateString).toLocaleTimeString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
+41
-24
@@ -22,21 +22,25 @@
|
||||
<div class="history_item-top">
|
||||
<span>
|
||||
<span @click="navigateToTrain(!item.terminated ? item.trainNo : null)" style="cursor: pointer">
|
||||
<b class="text--primary">{{ item.trainCategoryCode }}</b>
|
||||
{{ item.trainNo }}
|
||||
<b class="text--primary">{{ item.trainCategoryCode }} </b>
|
||||
<b>{{ item.trainNo }}</b>
|
||||
| {{ item.driverName }}
|
||||
| {{ item.timetableId }}
|
||||
</span>
|
||||
|
||||
<div>
|
||||
<b>{{ item.route.replace('|', ' - ') }}</b>
|
||||
</div>
|
||||
|
||||
<hr style="margin: 0.25em 0" />
|
||||
|
||||
<div class="scenery-list">
|
||||
<span
|
||||
v-for="(scenery, i) in sceneryList(item)"
|
||||
:key="scenery.name"
|
||||
:class="{ confirmed: scenery.confirmed }"
|
||||
>
|
||||
{{ i > 0 ? ' - ' : '' }} {{ scenery.name }}
|
||||
{{ i > 0 ? ' > ' : '' }} {{ scenery.name }}
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
@@ -59,11 +63,34 @@
|
||||
</b>
|
||||
</div>
|
||||
|
||||
<div style="margin: 1em 0">
|
||||
<div>
|
||||
<b>{{ $t('history.driver-name') }}</b>
|
||||
{{ item.driverName }}
|
||||
<div class="schedule-dates" style="margin-top: 1em;">
|
||||
<div>{{ $t('history.timetable-day') }} {{ localeDay(item.beginDate, $i18n.locale) }}</div>
|
||||
|
||||
<!-- Data odjazdu ze stacji początkowej -->
|
||||
<b>{{ item.route.split('|')[0] }}:</b>
|
||||
<s v-if="item.beginDate != item.scheduledBeginDate" class="text--grayed">
|
||||
{{ localeTime(item.scheduledBeginDate, $i18n.locale) }}
|
||||
</s>
|
||||
<span>{{ localeTime(item.beginDate, $i18n.locale) }} </span>•
|
||||
|
||||
<!-- Data przyjazdu na stację końcową / porzucenia -->
|
||||
<b v-if="(item.fulfilled && item.terminated) || !item.terminated"
|
||||
>{{ item.route.split('|').slice(-1)[0] }}:</b
|
||||
>
|
||||
<i v-else>{{ $t('history.timetable-abandoned') }} </i>
|
||||
|
||||
<s v-if="item.endDate != item.scheduledEndDate" class="text--grayed">
|
||||
{{ localeTime(item.scheduledEndDate, $i18n.locale) }}
|
||||
</s>
|
||||
<span>{{ localeTime(item.endDate, $i18n.locale) }} </span>
|
||||
|
||||
<!-- Nick dyżurnego -->
|
||||
<div v-if="item.authorName" class="text--grayed">
|
||||
<b>{{ $t('history.dispatcher-name') }} {{ item.authorName }}</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 1em;">
|
||||
<div>
|
||||
<b>{{ $t('history.route-length') }}</b>
|
||||
{{ !item.fulfilled ? item.currentDistance + ' /' : '' }}
|
||||
@@ -75,21 +102,6 @@
|
||||
{{ item.confirmedStopsCount }} /
|
||||
{{ item.allStopsCount }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<b>{{ $t('history.begins-at') }}</b>
|
||||
{{ localeDate(item.beginDate, $i18n.locale) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<b>{{ $t('history.terminates-at') }}</b>
|
||||
{{ localeDate(item.scheduledEndDate, $i18n.locale) }}
|
||||
</div>
|
||||
|
||||
<div v-if="item.terminated">
|
||||
<b>{{ $t('history.terminates-at-actual') }}</b>
|
||||
{{ localeDate(item.endDate, $i18n.locale) }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -150,6 +162,9 @@ interface TimetableHistory {
|
||||
|
||||
terminated: boolean;
|
||||
fulfilled: boolean;
|
||||
|
||||
authorName?: string;
|
||||
authorId?: number;
|
||||
}
|
||||
|
||||
const initFilters = {
|
||||
@@ -266,8 +281,6 @@ export default defineComponent({
|
||||
if (this.sorterActive.id == 'distance') queries.push('sortBy=routeDistance');
|
||||
else if (this.sorterActive.id == 'total-stops') queries.push('sortBy=allStopsCount');
|
||||
|
||||
console.log(queries);
|
||||
|
||||
try {
|
||||
const responseData: APIResponse | null = await (await axios.get(`${API_URL}?${queries.join('&')}`)).data;
|
||||
|
||||
@@ -384,6 +397,10 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
.schedule-dates > * {
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
|
||||
li,
|
||||
.history_warning {
|
||||
background: #202020;
|
||||
|
||||
Reference in New Issue
Block a user