chore: added detecting whether PRSM4 is at the end of a rolling stock

This commit is contained in:
2025-11-04 01:03:23 +01:00
parent 32594e2f67
commit bd70e0f071
3 changed files with 10 additions and 0 deletions
@@ -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>