Enhance vehicle speed display by adding localized labels in DirectorInfo, SaleSection, and BranchView components
This commit is contained in:
@@ -132,7 +132,7 @@
|
|||||||
<select v-model.number="emptyTransportForm.vehicleTypeId" @change="loadEmptyTransportRoute">
|
<select v-model.number="emptyTransportForm.vehicleTypeId" @change="loadEmptyTransportRoute">
|
||||||
<option :value="null" disabled>{{ $t('falukant.branch.director.emptyTransport.selectVehicle') }}</option>
|
<option :value="null" disabled>{{ $t('falukant.branch.director.emptyTransport.selectVehicle') }}</option>
|
||||||
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
||||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }})
|
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }}) - {{ speedLabel(vt.speed) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
@@ -255,6 +255,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
speedLabel(value) {
|
||||||
|
const key = value == null ? 'unknown' : String(value);
|
||||||
|
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||||
|
const translated = this.$t(tKey);
|
||||||
|
if (!translated || translated === tKey) return value;
|
||||||
|
return translated;
|
||||||
|
},
|
||||||
|
|
||||||
openNewDirectorDialog() {
|
openNewDirectorDialog() {
|
||||||
console.log('openNewDirectorDialog');
|
console.log('openNewDirectorDialog');
|
||||||
this.$refs.newDirectorDialog.open(this.branchId);
|
this.$refs.newDirectorDialog.open(this.branchId);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<select v-model.number="transportForm.vehicleTypeId" @change="() => { recalcMaxQuantity(); loadRouteInfo(); }">
|
<select v-model.number="transportForm.vehicleTypeId" @change="() => { recalcMaxQuantity(); loadRouteInfo(); }">
|
||||||
<option :value="null" disabled>{{ $t('falukant.branch.sale.transportVehiclePlaceholder') }}</option>
|
<option :value="null" disabled>{{ $t('falukant.branch.sale.transportVehiclePlaceholder') }}</option>
|
||||||
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
||||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }})
|
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }}) - {{ speedLabel(vt.speed) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
@@ -251,6 +251,13 @@
|
|||||||
return new Date(a.eta).getTime() - new Date(b.eta).getTime();
|
return new Date(a.eta).getTime() - new Date(b.eta).getTime();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
speedLabel(value) {
|
||||||
|
const key = value == null ? 'unknown' : String(value);
|
||||||
|
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||||
|
const translated = this.$t(tKey);
|
||||||
|
if (!translated || translated === tKey) return value;
|
||||||
|
return translated;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.loadInventory();
|
await this.loadInventory();
|
||||||
|
|||||||
@@ -351,6 +351,13 @@
|
|||||||
"status": "Status",
|
"status": "Status",
|
||||||
"actions": "Aktionen"
|
"actions": "Aktionen"
|
||||||
},
|
},
|
||||||
|
"speed": {
|
||||||
|
"1": "Langsam",
|
||||||
|
"2": "Mittel",
|
||||||
|
"3": "Schnell",
|
||||||
|
"4": "Sehr schnell",
|
||||||
|
"unknown": "Unbekannt"
|
||||||
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"inUse": "In Benutzung",
|
"inUse": "In Benutzung",
|
||||||
"building": "Im Bau",
|
"building": "Im Bau",
|
||||||
@@ -391,6 +398,7 @@
|
|||||||
"repairSuccess": "Fahrzeug wird repariert!",
|
"repairSuccess": "Fahrzeug wird repariert!",
|
||||||
"repairError": "Fehler beim Reparieren des Fahrzeugs."
|
"repairError": "Fehler beim Reparieren des Fahrzeugs."
|
||||||
},
|
},
|
||||||
|
|
||||||
"stocktype": {
|
"stocktype": {
|
||||||
"wood": "Holzlager",
|
"wood": "Holzlager",
|
||||||
"stone": "Steinlager",
|
"stone": "Steinlager",
|
||||||
|
|||||||
@@ -22,6 +22,14 @@
|
|||||||
},
|
},
|
||||||
"transport": {
|
"transport": {
|
||||||
"waiting": "Transport waiting"
|
"waiting": "Transport waiting"
|
||||||
|
,
|
||||||
|
"speed": {
|
||||||
|
"1": "Slow",
|
||||||
|
"2": "Medium",
|
||||||
|
"3": "Fast",
|
||||||
|
"4": "Very fast",
|
||||||
|
"unknown": "Unknown"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"random_event": {
|
"random_event": {
|
||||||
"windfall": {
|
"windfall": {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<td>{{ v.type.capacity }}</td>
|
<td>{{ v.type.capacity }}</td>
|
||||||
<td>{{ conditionLabel(v.condition) }}</td>
|
<td>{{ conditionLabel(v.condition) }}</td>
|
||||||
<td>{{ v.type.transportMode }}</td>
|
<td>{{ v.type.transportMode }}</td>
|
||||||
<td>{{ v.type.speed }}</td>
|
<td>{{ speedLabel(v.type.speed) }}</td>
|
||||||
<td>{{ formatDateTime(v.availableFrom) }}</td>
|
<td>{{ formatDateTime(v.availableFrom) }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="v.status === 'travelling'">
|
<span v-if="v.status === 'travelling'">
|
||||||
@@ -601,6 +601,16 @@ export default {
|
|||||||
return 'Unbekannt';
|
return 'Unbekannt';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
speedLabel(value) {
|
||||||
|
// Expect numeric speeds 1..4; provide localized labels as fallback to raw value
|
||||||
|
const key = value == null ? 'unknown' : String(value);
|
||||||
|
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||||
|
const translated = this.$t(tKey);
|
||||||
|
// If translation returns the key (no translation found), fall back to the numeric value
|
||||||
|
if (!translated || translated === tKey) return value;
|
||||||
|
return translated;
|
||||||
|
},
|
||||||
|
|
||||||
async loadVehicles() {
|
async loadVehicles() {
|
||||||
if (!this.selectedBranch) return;
|
if (!this.selectedBranch) return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user