mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano listę brakujących ikon pojazdów trakcyjnych
This commit is contained in:
@@ -4,19 +4,19 @@
|
|||||||
{{ $t('trains.distance-exceeded') }}
|
{{ $t('trains.distance-exceeded') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="no-trains" v-if="computedTrains.length == 0 && timetableLoaded">
|
<div class="table-info no-trains" v-if="computedTrains.length == 0 && timetableLoaded">
|
||||||
{{ $t('trains.no-trains') }}
|
{{ $t('trains.no-trains') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="no-trains" v-if="computedTrains.length == 0 && !timetableLoaded">
|
<div class="table-info loading" v-if="computedTrains.length == 0 && !timetableLoaded">
|
||||||
{{ $t('trains.loading') }}
|
{{ $t('trains.loading') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="train-list">
|
<ul class="train-list">
|
||||||
<li
|
<li
|
||||||
class="train-row"
|
class="train-row"
|
||||||
v-for="(train, i) in computedTrains"
|
v-for="(train) in computedTrains.filter((_, i) => i < 10)"
|
||||||
:key="i"
|
:key="train.trainNo + train.driverId"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@keydown.enter="changeScheduleShowState(train.timetableData?.timetableId)"
|
@keydown.enter="changeScheduleShowState(train.timetableData?.timetableId)"
|
||||||
:ref="(el) => registerReference(el, train.timetableData?.timetableId)"
|
:ref="(el) => registerReference(el, train.timetableData?.timetableId)"
|
||||||
@@ -107,8 +107,10 @@
|
|||||||
|
|
||||||
<span v-else>{{ displayLocoInfo(train.locoType) }}</span>
|
<span v-else>{{ displayLocoInfo(train.locoType) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<img v-if="defaultVehicleIcons.includes(train.locoType)" class="train-image" :src="defaultLocoImage" alt="default vehicle">
|
||||||
|
<img v-else class="train-image" :src="train.locoURL" :alt="train.locoType" @error="onImageError" />
|
||||||
|
|
||||||
<img class="train-image" :src="train.locoURL" @error="onImageError" />
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -139,18 +141,25 @@
|
|||||||
/>
|
/>
|
||||||
</transition>
|
</transition>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<div class="table-info limit" v-if="timetableLoaded && computedTrains.length > 10">
|
||||||
|
{{ $t('trains.table-limit') }}
|
||||||
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Train from '@/scripts/interfaces/Train';
|
|
||||||
import TrainStop from '@/scripts/interfaces/TrainStop';
|
|
||||||
|
|
||||||
import TrainSchedule from '@/components/TrainsView/TrainSchedule.vue';
|
|
||||||
import { DataStatus } from '@/scripts/enums/DataStatus';
|
|
||||||
import { computed, ComputedRef, defineComponent, Ref, ref } from '@vue/runtime-core';
|
import { computed, ComputedRef, defineComponent, Ref, ref } from '@vue/runtime-core';
|
||||||
import { useStore } from '@/store';
|
import { useStore } from '@/store';
|
||||||
|
|
||||||
|
import defaultVehicleIconsJSON from "@/data/defaultVehicleIcons.json";
|
||||||
|
|
||||||
|
import Train from '@/scripts/interfaces/Train';
|
||||||
|
import TrainStop from '@/scripts/interfaces/TrainStop';
|
||||||
|
import TrainSchedule from '@/components/TrainsView/TrainSchedule.vue';
|
||||||
|
|
||||||
|
import { DataStatus } from '@/scripts/enums/DataStatus';
|
||||||
import { GETTERS } from '@/constants/storeConstants';
|
import { GETTERS } from '@/constants/storeConstants';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -180,6 +189,8 @@ export default defineComponent({
|
|||||||
arrowDesc: require('@/assets/icon-arrow-desc.svg'),
|
arrowDesc: require('@/assets/icon-arrow-desc.svg'),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
defaultVehicleIcons: defaultVehicleIconsJSON,
|
||||||
|
|
||||||
stats: {
|
stats: {
|
||||||
main: [
|
main: [
|
||||||
{
|
{
|
||||||
@@ -240,7 +251,7 @@ export default defineComponent({
|
|||||||
() =>
|
() =>
|
||||||
props.computedTrains.findIndex(({ timetableData }) => timetableData && timetableData.routeDistance > 200) !=
|
props.computedTrains.findIndex(({ timetableData }) => timetableData && timetableData.routeDistance > 200) !=
|
||||||
-1
|
-1
|
||||||
),
|
)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -353,7 +364,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-trains {
|
.table-info {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
["EP07-356","EP07-356","EP07-356","ET41-074","2EN57-694+716rb","EU07E-083","EN57-716rb","EN57-716rb","EN57-716rb","EN57-038rb","EN57-038rb","SM42-329_PLREG","2EN57-038+1715rb","EN57-1953rb","EN57-1953rb","SM42-1121","SM42-091","SM42-404","SM42-404","EN57-1914rb","EN57-961rb"]
|
||||||
+2
-1
@@ -135,7 +135,8 @@
|
|||||||
"loco-electric": "Electric locomotive",
|
"loco-electric": "Electric locomotive",
|
||||||
"loco-diesel": "Diesel locomotive",
|
"loco-diesel": "Diesel locomotive",
|
||||||
"timetable-comments": "Exploitation comments available for this train",
|
"timetable-comments": "Exploitation comments available for this train",
|
||||||
"comment": "Exploitation comment"
|
"comment": "Exploitation comment",
|
||||||
|
"table-limit": "For performance reasons there's a limit of 10 trains shown at the same time."
|
||||||
},
|
},
|
||||||
"journal": {
|
"journal": {
|
||||||
"title": "SCENERY ACTIVITY JOURNAL",
|
"title": "SCENERY ACTIVITY JOURNAL",
|
||||||
|
|||||||
+2
-1
@@ -135,7 +135,8 @@
|
|||||||
"loco-electric": "Elektrowóz",
|
"loco-electric": "Elektrowóz",
|
||||||
"loco-diesel": "Spalinowóz",
|
"loco-diesel": "Spalinowóz",
|
||||||
"timetable-comments": "Pociąg z uwagami eksploatacyjnymi",
|
"timetable-comments": "Pociąg z uwagami eksploatacyjnymi",
|
||||||
"comment": "Uwaga eksploatacyjna"
|
"comment": "Uwaga eksploatacyjna",
|
||||||
|
"table-limit": "Dla płynności działania strony pokazanych jest tylko 10 pociągów zgodnie z wybranymi filtrami."
|
||||||
},
|
},
|
||||||
"journal": {
|
"journal": {
|
||||||
"title": "DZIENNIK AKTYWNOŚCI SCENERII",
|
"title": "DZIENNIK AKTYWNOŚCI SCENERII",
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ const filteredTrainList = (
|
|||||||
return trainList
|
return trainList
|
||||||
.filter(
|
.filter(
|
||||||
(train) =>
|
(train) =>
|
||||||
train.online &&
|
|
||||||
(searchedTrain.length > 0
|
(searchedTrain.length > 0
|
||||||
? train.trainNo.toString().includes(searchedTrain)
|
? train.trainNo.toString().includes(searchedTrain)
|
||||||
: true) &&
|
: true) &&
|
||||||
@@ -81,7 +80,7 @@ const filteredTrainList = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
});
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
Reference in New Issue
Block a user