mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 05:18:10 +00:00
chore: added detecting whether PRSM4 is at the end of a rolling stock
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
{{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }}
|
||||
</div>
|
||||
|
||||
<div class="warning" v-if="!isRearPRSM4">(!) {{ $t('stocklist.warning-prsm4-not-at-the-rear') }}</div>
|
||||
|
||||
<div class="warning" v-if="weightExceeded">
|
||||
(!)
|
||||
<i18n-t keypath="stocklist.warning-too-heavy">
|
||||
@@ -68,6 +70,12 @@ export default defineComponent({
|
||||
this.store.stockList.some((stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP'))
|
||||
);
|
||||
},
|
||||
|
||||
isRearPRSM4() {
|
||||
if (this.store.stockList.length <= 1) return true;
|
||||
|
||||
return this.store.stockList.findIndex((stock) => stock.vehicleRef.type.startsWith('PRSM4')) == (this.store.stockList.length - 1 || -1);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
"warning-too-many-locos": "This train has too many traction units!",
|
||||
"warning-too-heavy": "This train is too heavy! Check {href}",
|
||||
"warning-team-only-vehicle": "There's at least one vehicle available only for TD2 team members in your stock composition! ({0})",
|
||||
"warning-prsm4-not-at-the-rear": "PRSM4 welding car must be at the end of a train!",
|
||||
"acceptable-mass-docs": "acceptable rolling stock masses (PL)",
|
||||
"stock-loading-error": "An error occurred: cannot parse data from the file - make sure it's in a proper format!",
|
||||
"stock-clipboard-error": "An error occurred: cannot read data from the clipboard - make sure the site has been granted right permissions for this action!"
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
"warning-too-many-locos": "Ten skład posiada za dużo pojazdów trakcyjnych!",
|
||||
"warning-too-heavy": "Ten skład jest za ciężki! Sprawdź {href}",
|
||||
"warning-team-only-vehicle": "W zestawieniu znajduje się co najmniej jeden pojazd dostępny tylko dla członków zespołu TD2! ({0})",
|
||||
"warning-prsm4-not-at-the-rear": "Zgrzewarka PRSM4 może znajdować się jedynie na końcu składu w przypadku jazdy pociągowej!",
|
||||
"acceptable-mass-docs": "dopuszczalne masy składów",
|
||||
"stock-loading-error": "Wystąpił błąd: nie można przetworzyć danych ze schowka! Upewnij się, że są one w poprawnym formacie!",
|
||||
"stock-clipboard-error": "Wystąpił błąd: nie można odczytać danych ze schowka! Upewnij się, że nadałeś uprawnienia stronie do tej akcji!"
|
||||
|
||||
Reference in New Issue
Block a user