mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 03:58:11 +00:00
code adaptation for API changes; tons changed to kilos
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { useStore } from '../store';
|
||||
import { ICargo, ICarWagon, ILocomotive, IStock, Vehicle } from '../types';
|
||||
import { ICarWagon, ILocomotive, IStock, ICargo, Vehicle } from '../types';
|
||||
import { isLocomotive } from '../utils/vehicleUtils';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -22,7 +22,7 @@ export default defineComponent({
|
||||
id: this.getStockId(),
|
||||
type: vehicle.type,
|
||||
length: vehicle.length,
|
||||
mass: vehicle.mass,
|
||||
weight: vehicle.weight,
|
||||
maxSpeed: vehicle.maxSpeed,
|
||||
isLoco,
|
||||
cargo: !isLoco && vehicle.loadable && cargo ? cargo : undefined,
|
||||
@@ -88,7 +88,7 @@ export default defineComponent({
|
||||
const [carType, cargo] = type.split(':');
|
||||
vehicle = this.store.carDataList.find((car) => car.type == carType) || null;
|
||||
|
||||
if (cargo) vehicleCargo = vehicle?.cargoList.find((c) => c.id == cargo) || null;
|
||||
if (cargo) vehicleCargo = vehicle?.cargoTypes.find((c) => c.id == cargo) || null;
|
||||
}
|
||||
|
||||
if (!vehicle) console.log('Brak pojazdu / rodzaj pojazdu źle wczytany:', type);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineComponent } from "vue";
|
||||
import { useStore } from "../store";
|
||||
import { defineComponent } from 'vue';
|
||||
import { useStore } from '../store';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
@@ -11,17 +11,11 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
trainTooLong() {
|
||||
return (
|
||||
(this.store.totalLength > 350 && this.store.isTrainPassenger) ||
|
||||
(this.store.totalLength > 650 && !this.store.isTrainPassenger)
|
||||
);
|
||||
return (this.store.totalLength > 350 && this.store.isTrainPassenger) || (this.store.totalLength > 650 && !this.store.isTrainPassenger);
|
||||
},
|
||||
|
||||
trainTooHeavy() {
|
||||
return (
|
||||
this.store.acceptableMass &&
|
||||
this.store.totalMass > this.store.acceptableMass
|
||||
);
|
||||
return this.store.acceptableWeight && this.store.totalWeight > this.store.acceptableWeight;
|
||||
},
|
||||
|
||||
locoNotSuitable() {
|
||||
@@ -29,9 +23,7 @@ export default defineComponent({
|
||||
!this.store.isTrainPassenger &&
|
||||
this.store.stockList.length > 1 &&
|
||||
!this.store.stockList.every((stock) => stock.isLoco) &&
|
||||
this.store.stockList.some(
|
||||
(stock) => stock.isLoco && stock.type.startsWith("EP"),
|
||||
)
|
||||
this.store.stockList.some((stock) => stock.isLoco && stock.type.startsWith('EP'))
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user