mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-02 21:08:12 +00:00
feat(scenery): added optional displaying active timetables' rolling stock thumbnails
This commit is contained in:
@@ -54,14 +54,11 @@
|
|||||||
{{ $t('scenery.no-timetables') }}
|
{{ $t('scenery.no-timetables') }}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li
|
<li v-else class="timetable-item" v-for="(row, i) in sceneryTimetables" :key="row.train.id">
|
||||||
v-else
|
|
||||||
v-for="(row, i) in sceneryTimetables"
|
|
||||||
:key="row.train.id"
|
|
||||||
>
|
|
||||||
<!-- {{ row.train.id + row.checkpointStop.arrivalTimestamp.toString() }} -->
|
<!-- {{ row.train.id + row.checkpointStop.arrivalTimestamp.toString() }} -->
|
||||||
<router-link class="timetable-item-link" tabindex="0" :to="row.train.driverRouteLocation">
|
<router-link class="item-link" tabindex="0" :to="row.train.driverRouteLocation">
|
||||||
<span class="item-general">
|
<div class="item-top">
|
||||||
|
<div class="top-general">
|
||||||
<span class="general-info">
|
<span class="general-info">
|
||||||
<div class="info-train">
|
<div class="info-train">
|
||||||
<!-- Cargo warnings & details badges -->
|
<!-- Cargo warnings & details badges -->
|
||||||
@@ -130,9 +127,9 @@
|
|||||||
|
|
||||||
<ScheduledTrainStatus :sceneryTimetableRow="row" />
|
<ScheduledTrainStatus :sceneryTimetableRow="row" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</div>
|
||||||
|
|
||||||
<span class="item-schedule">
|
<div class="top-schedule">
|
||||||
<span class="schedule-arrival">
|
<span class="schedule-arrival">
|
||||||
<span class="arrival-time begins" v-if="row.checkpointStop.beginsHere">
|
<span class="arrival-time begins" v-if="row.checkpointStop.beginsHere">
|
||||||
{{ $t('timetables.begins') }}
|
{{ $t('timetables.begins') }}
|
||||||
@@ -180,7 +177,9 @@
|
|||||||
|
|
||||||
<span class="departure-time" v-else>
|
<span class="departure-time" v-else>
|
||||||
<div v-if="row.checkpointStop.departureDelay == 0">
|
<div v-if="row.checkpointStop.departureDelay == 0">
|
||||||
<span>{{ timestampToTimeString(row.checkpointStop.departureTimestamp) }}</span>
|
<span>{{
|
||||||
|
timestampToTimeString(row.checkpointStop.departureTimestamp)
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div>
|
<div>
|
||||||
@@ -197,7 +196,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-stock-list" v-if="showStockThumbnails">
|
||||||
|
<StockList :trainStockList="row.train.stockList" />
|
||||||
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
@@ -206,7 +210,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ComputedRef, PropType } from 'vue';
|
import { computed, ComputedRef, PropType, ref } from 'vue';
|
||||||
import { Station, ActiveScenery } from '../../../typings/common';
|
import { Station, ActiveScenery } from '../../../typings/common';
|
||||||
import { SceneryTimetableRow } from '../typings';
|
import { SceneryTimetableRow } from '../typings';
|
||||||
import { getTrainStopStatus, stopStatusPriorities } from '../utils';
|
import { getTrainStopStatus, stopStatusPriorities } from '../utils';
|
||||||
@@ -216,6 +220,7 @@ import { useApiStore } from '../../../store/apiStore';
|
|||||||
import { timestampToTimeString } from '../../../composables/time';
|
import { timestampToTimeString } from '../../../composables/time';
|
||||||
import ScheduledTrainStatus from './ScheduledTrainStatus.vue';
|
import ScheduledTrainStatus from './ScheduledTrainStatus.vue';
|
||||||
import Loading from '../../Global/Loading.vue';
|
import Loading from '../../Global/Loading.vue';
|
||||||
|
import StockList from '../../Global/StockList.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
station: {
|
station: {
|
||||||
@@ -236,6 +241,8 @@ const route = useRoute();
|
|||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
const apiStore = useApiStore();
|
const apiStore = useApiStore();
|
||||||
|
|
||||||
|
const showStockThumbnails = ref(false);
|
||||||
|
|
||||||
const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
||||||
if (!props.onlineScenery) return [];
|
if (!props.onlineScenery) return [];
|
||||||
|
|
||||||
@@ -292,7 +299,7 @@ const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
|||||||
gap: 1em;
|
gap: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-general {
|
.top-general {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -300,7 +307,7 @@ const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-schedule {
|
.top-schedule {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 0.2em;
|
gap: 0.2em;
|
||||||
@@ -341,18 +348,12 @@ const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timetable-item,
|
.timetable-item {
|
||||||
.timetable-item-link {
|
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
padding: 0.5em;
|
padding: 0.35em;
|
||||||
max-width: 1100px;
|
max-width: 1100px;
|
||||||
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
||||||
gap: 1.2em 0.5em;
|
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
background: #353535;
|
background: #353535;
|
||||||
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
@@ -364,6 +365,16 @@ const sceneryTimetables: ComputedRef<SceneryTimetableRow[]> = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.timetable-item > .item-link > .item-top {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||||
|
gap: 1.2em 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timetable-item > .item-link > .item-stock-list {
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.general-info {
|
.general-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user