mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 20:18:12 +00:00
feat: turning around rolling stock
This commit is contained in:
@@ -67,6 +67,16 @@
|
|||||||
>
|
>
|
||||||
<Shuffle :stroke-width="2.5" />
|
<Shuffle :stroke-width="2.5" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn--image"
|
||||||
|
:data-disabled="stockIsEmpty"
|
||||||
|
:disabled="stockIsEmpty"
|
||||||
|
@click="turnAroundCars"
|
||||||
|
:data-button-tooltip="$t('stocklist.action-switch')"
|
||||||
|
>
|
||||||
|
<Repeat :stroke-width="2.5" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions-bottom" :data-disabled="store.chosenStockListIndex == -1">
|
<div class="actions-bottom" :data-disabled="store.chosenStockListIndex == -1">
|
||||||
@@ -201,6 +211,22 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
turnAroundCars() {
|
||||||
|
if (this.store.stockList.length <= 1) return;
|
||||||
|
|
||||||
|
const isFirstTractionUnit = isTractionUnit(this.store.stockList[0].vehicleRef);
|
||||||
|
|
||||||
|
const sliceToSwap = isFirstTractionUnit
|
||||||
|
? this.store.stockList.slice(1)
|
||||||
|
: this.store.stockList.slice();
|
||||||
|
|
||||||
|
sliceToSwap.reverse();
|
||||||
|
|
||||||
|
if (isFirstTractionUnit) sliceToSwap.unshift(this.store.stockList[0]);
|
||||||
|
|
||||||
|
this.store.stockList = sliceToSwap;
|
||||||
|
},
|
||||||
|
|
||||||
downloadStock() {
|
downloadStock() {
|
||||||
if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty'));
|
if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty'));
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
"action-copy": "COPY TO CLIPBOARD",
|
"action-copy": "COPY TO CLIPBOARD",
|
||||||
"action-reset": "RESET",
|
"action-reset": "RESET",
|
||||||
"action-shuffle": "SHUFFLE",
|
"action-shuffle": "SHUFFLE",
|
||||||
|
"action-switch": "TURN AROUND",
|
||||||
"action-bookmark": "BOOKMARK",
|
"action-bookmark": "BOOKMARK",
|
||||||
"mass": "Mass",
|
"mass": "Mass",
|
||||||
"mass-accepted": "accepted",
|
"mass-accepted": "accepted",
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
"action-copy": "SKOPIUJ DO SCHOWKA",
|
"action-copy": "SKOPIUJ DO SCHOWKA",
|
||||||
"action-reset": "ZRESETUJ",
|
"action-reset": "ZRESETUJ",
|
||||||
"action-shuffle": "PRZETASUJ",
|
"action-shuffle": "PRZETASUJ",
|
||||||
|
"action-switch": "ODWRÓĆ",
|
||||||
"action-bookmark": "ZAPISZ",
|
"action-bookmark": "ZAPISZ",
|
||||||
"mass": "Masa",
|
"mass": "Masa",
|
||||||
"mass-accepted": "dopuszczalna",
|
"mass-accepted": "dopuszczalna",
|
||||||
|
|||||||
Reference in New Issue
Block a user