diff --git a/public/images/loco-s-unknown.png b/public/images/loco-diesel-unknown.png similarity index 100% rename from public/images/loco-s-unknown.png rename to public/images/loco-diesel-unknown.png diff --git a/public/images/loco-e-unknown.png b/public/images/loco-electric-unknown.png similarity index 100% rename from public/images/loco-e-unknown.png rename to public/images/loco-electric-unknown.png diff --git a/public/images/loco-ezt-unknown.png b/public/images/unit-electric-unknown.png similarity index 100% rename from public/images/loco-ezt-unknown.png rename to public/images/unit-electric-unknown.png diff --git a/public/images/car-cargo-unknown.png b/public/images/wagon-freight-unknown.png similarity index 100% rename from public/images/car-cargo-unknown.png rename to public/images/wagon-freight-unknown.png diff --git a/public/images/car-passenger-unknown.png b/public/images/wagon-passenger-unknown.png similarity index 100% rename from public/images/car-passenger-unknown.png rename to public/images/wagon-passenger-unknown.png diff --git a/src/components/sections/InputsSection.vue b/src/components/sections/InputsSection.vue index bff3fb8..98e67c3 100644 --- a/src/components/sections/InputsSection.vue +++ b/src/components/sections/InputsSection.vue @@ -9,7 +9,7 @@ v-for="locoType in locomotiveTypeList" :key="locoType.id" class="btn btn--choice" - :data-selected="locoType.id == store.chosenLocoPower" + :data-selected="locoType.id == store.chosenLocoGroup" @click="selectLocoType(locoType.id)" > {{ $t(`inputs.${locoType.id}`) }} @@ -39,7 +39,7 @@ v-for="carType in carTypeList" :key="carType.id" class="btn btn--choice" - :data-selected="carType.id == store.chosenCarUseType" + :data-selected="carType.id == store.chosenCarGroup" @click="selectCarWagonType(carType.id)" > {{ $t(`inputs.${carType.id}`) }} @@ -70,7 +70,7 @@ id="cargo-select" :disabled=" (store.chosenCar && !store.chosenCar.loadable) || - (store.chosenCar && store.chosenCar.useType == 'car-passenger') || + (store.chosenCar && store.chosenCar.group == 'wagon-passenger') || !store.chosenCar " data-select="cargo" @@ -123,6 +123,7 @@ import imageMixin from '../../mixins/imageMixin'; import { useStore } from '../../store'; import stockPreviewMixin from '../../mixins/stockPreviewMixin'; import stockMixin from '../../mixins/stockMixin'; +import { LocoGroupType, WagonGroupType } from '../../types'; export default defineComponent({ mixins: [imageMixin, stockPreviewMixin, stockMixin], @@ -131,33 +132,33 @@ export default defineComponent({ store: useStore(), locomotiveTypeList: [ { - id: 'loco-e', + id: 'loco-electric', desc: 'ELEKTRYCZNE', }, { - id: 'loco-s', + id: 'loco-diesel', desc: 'SPALINOWE', }, { - id: 'loco-ezt', + id: 'unit-electric', desc: 'ELEKTR. ZESPOŁY TRAKCYJNE', }, { - id: 'loco-szt', + id: 'unit-diesel', desc: 'SPAL. ZESPOŁY TRAKCYJNE', }, - ], + ] as { id: LocoGroupType; desc: string }[], carTypeList: [ { - id: 'car-passenger', + id: 'wagon-passenger', desc: 'PASAŻERSKIE', }, { - id: 'car-cargo', + id: 'wagon-freight', desc: 'TOWAROWE', }, - ], + ] as { id: WagonGroupType; desc: string }[], }), computed: { @@ -165,14 +166,14 @@ export default defineComponent({ return this.store.locoDataList .slice() .sort((a, b) => (a.type > b.type ? 1 : -1)) - .filter((loco) => loco.power == this.store.chosenLocoPower); + .filter((loco) => loco.group == this.store.chosenLocoGroup); }, carOptions() { return this.store.carDataList .slice() .sort((a, b) => (a.type > b.type ? 1 : -1)) - .filter((car) => car.useType == this.store.chosenCarUseType); + .filter((car) => car.group == this.store.chosenCarGroup); }, }, @@ -209,14 +210,14 @@ export default defineComponent({ this.store.stockList[this.store.chosenStockListIndex] = stockObject; }, - selectLocoType(locoTypeId: string) { - this.store.chosenLocoPower = locoTypeId; + selectLocoType(locoGroupType: LocoGroupType) { + this.store.chosenLocoGroup = locoGroupType; this.store.chosenVehicle = this.locoOptions[0]; this.store.chosenLoco = this.locoOptions[0]; }, - selectCarWagonType(carWagonTypeId: string) { - this.store.chosenCarUseType = carWagonTypeId; + selectCarWagonType(wagonGroupType: WagonGroupType) { + this.store.chosenCarGroup = wagonGroupType; this.store.chosenVehicle = this.carOptions[0]; this.store.chosenCar = this.carOptions[0]; this.store.chosenCargo = null; diff --git a/src/components/sections/TrainImageSection.vue b/src/components/sections/TrainImageSection.vue index 5843d45..4ab8859 100644 --- a/src/components/sections/TrainImageSection.vue +++ b/src/components/sections/TrainImageSection.vue @@ -20,7 +20,7 @@ {{ $t( - `preview.${isLocomotive(store.chosenVehicle) ? store.chosenVehicle.power : store.chosenVehicle.useType}` + `preview.${isLocomotive(store.chosenVehicle) ? store.chosenVehicle.group : store.chosenVehicle.group}` ) }} @@ -37,7 +37,7 @@
{{ - store.chosenVehicle.useType == 'car-cargo' + store.chosenVehicle.group == 'wagon-freight' ? $t(`usage.${store.chosenVehicle.constructionType}`) : `${$t('preview.construction')} ${store.chosenVehicle.constructionType}` }} @@ -60,7 +60,7 @@