mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Wyświetlanie historii dyżurnych tylko dla PL1
This commit is contained in:
@@ -40,8 +40,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { GETTERS } from '@/constants/storeConstants';
|
||||||
|
import { useStore } from '@/store';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
interface DispatcherTimeline {
|
interface DispatcherTimeline {
|
||||||
date: string;
|
date: string;
|
||||||
@@ -92,6 +95,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
|
const store = useStore();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import { DataStatus } from "@/scripts/enums/DataStatus";
|
|||||||
|
|
||||||
import { getLocoURL, getStatusID, getStatusTimestamp, getTimestamp, getTrainStopStatus, parseSpawns, timestampToString } from "@/scripts/utils/storeUtils";
|
import { getLocoURL, getStatusID, getStatusTimestamp, getTimestamp, getTrainStopStatus, parseSpawns, timestampToString } from "@/scripts/utils/storeUtils";
|
||||||
import { URLs } from '@/scripts/utils/apiURLs';
|
import { URLs } from '@/scripts/utils/apiURLs';
|
||||||
import StorageManager from '@/scripts/managers/storageManager';
|
|
||||||
import ScheduledTrain from '@/scripts/interfaces/ScheduledTrain';
|
import ScheduledTrain from '@/scripts/interfaces/ScheduledTrain';
|
||||||
|
|
||||||
export interface State {
|
export interface State {
|
||||||
|
|||||||
@@ -9,12 +9,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
|
<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" />
|
<img :src="icons.back" alt="Back to scenery" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-if="!timetableOnly"
|
v-if="!timetableOnly && currentRegion.id == 'eu'"
|
||||||
class="history-btn btn btn--image"
|
class="history-btn btn btn--image"
|
||||||
@click="setCardViewMode(viewMode == 'history' ? 'info' : 'history')"
|
@click="setCardViewMode(viewMode == 'history' ? 'info' : 'history')"
|
||||||
:title="viewMode == 'history' ? $t('scenery.info-btn') : $t('scenery.history-btn')"
|
:title="viewMode == 'history' ? $t('scenery.info-btn') : $t('scenery.history-btn')"
|
||||||
@@ -85,6 +90,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
|
currentRegion: computed(() => store.getters[GETTERS.currentRegion]),
|
||||||
timetableOnly,
|
timetableOnly,
|
||||||
isComponentVisible,
|
isComponentVisible,
|
||||||
isDataLoaded,
|
isDataLoaded,
|
||||||
@@ -99,12 +105,16 @@ export default defineComponent({
|
|||||||
|
|
||||||
navigateTo(path: string) {
|
navigateTo(path: string) {
|
||||||
this.$router.push(path);
|
this.$router.push(path);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.cardHeight = (this.$refs['card-wrapper'] as HTMLElement).getBoundingClientRect().height;
|
this.cardHeight = (this.$refs['card-wrapper'] as HTMLElement).getBoundingClientRect().height;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
activated() {
|
||||||
|
if (this.currentRegion.id != 'eu' && this.viewMode == 'history') this.viewMode = 'info';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -144,7 +154,6 @@ $sceneryBgCol: #333;
|
|||||||
width: 75%;
|
width: 75%;
|
||||||
max-width: 950px;
|
max-width: 950px;
|
||||||
|
|
||||||
|
|
||||||
@include midScreen {
|
@include midScreen {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user