Revert "Refactor DirectorInfo and SaleSection components to unify speedLabel logic and remove unnecessary watch properties"

This reverts commit 8c40144734.
This commit is contained in:
Torsten Schulz (local)
2026-02-09 15:56:48 +01:00
parent 9c91d99bed
commit a7688e4ed5
12 changed files with 2245 additions and 515 deletions

View File

@@ -210,6 +210,14 @@ export default {
},
};
},
watch: {
branchId: {
immediate: false,
handler() {
this.loadDirector();
},
},
},
async mounted() {
await this.loadDirector();
},
@@ -256,11 +264,17 @@ export default {
},
speedLabel(value) {
const key = value == null ? 'unknown' : String(value);
if (value == null) return this.$t('falukant.branch.transport.speed.unknown') || '—';
if (typeof value === 'object') {
const k = value.tr ?? value.id ?? 'unknown';
const tKey = `falukant.branch.transport.speed.${k}`;
const t = this.$t(tKey);
return (t && t !== tKey) ? t : String(k);
}
const key = String(value);
const tKey = `falukant.branch.transport.speed.${key}`;
const translated = this.$t(tKey);
if (!translated || translated === tKey) return value;
return translated;
return (!translated || translated === tKey) ? key : translated;
},
openNewDirectorDialog() {