Wyświetlanie historii dyżurnych tylko dla PL1

This commit is contained in:
2022-01-10 18:57:02 +01:00
parent e63dbb9633
commit 69c32294f6
3 changed files with 19 additions and 5 deletions
@@ -40,8 +40,11 @@
</template>
<script lang="ts">
import { GETTERS } from '@/constants/storeConstants';
import { useStore } from '@/store';
import axios from 'axios';
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';
interface DispatcherTimeline {
date: string;
@@ -92,6 +95,9 @@ export default defineComponent({
},
},
setup() {
const store = useStore();
const router = useRouter();
return {};
},
-1
View File
@@ -23,7 +23,6 @@ import { DataStatus } from "@/scripts/enums/DataStatus";
import { getLocoURL, getStatusID, getStatusTimestamp, getTimestamp, getTrainStopStatus, parseSpawns, timestampToString } from "@/scripts/utils/storeUtils";
import { URLs } from '@/scripts/utils/apiURLs';
import StorageManager from '@/scripts/managers/storageManager';
import ScheduledTrain from '@/scripts/interfaces/ScheduledTrain';
export interface State {
+13 -4
View File
@@ -9,12 +9,17 @@
</div>
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
<button v-if="!timetableOnly" class="back-btn btn btn--image" :title="$t('scenery.return-btn')" @click="navigateTo('/')">
<button
v-if="!timetableOnly"
class="back-btn btn btn--image"
:title="$t('scenery.return-btn')"
@click="navigateTo('/')"
>
<img :src="icons.back" alt="Back to scenery" />
</button>
<button
v-if="!timetableOnly"
v-if="!timetableOnly && currentRegion.id == 'eu'"
class="history-btn btn btn--image"
@click="setCardViewMode(viewMode == 'history' ? 'info' : 'history')"
:title="viewMode == 'history' ? $t('scenery.info-btn') : $t('scenery.history-btn')"
@@ -85,6 +90,7 @@ export default defineComponent({
return {
data,
currentRegion: computed(() => store.getters[GETTERS.currentRegion]),
timetableOnly,
isComponentVisible,
isDataLoaded,
@@ -99,12 +105,16 @@ export default defineComponent({
navigateTo(path: string) {
this.$router.push(path);
}
},
},
mounted() {
this.cardHeight = (this.$refs['card-wrapper'] as HTMLElement).getBoundingClientRect().height;
},
activated() {
if (this.currentRegion.id != 'eu' && this.viewMode == 'history') this.viewMode = 'info';
},
});
</script>
@@ -144,7 +154,6 @@ $sceneryBgCol: #333;
width: 75%;
max-width: 950px;
@include midScreen {
width: 95%;
}