Revert "Refactor DirectorInfo and SaleSection components to unify speedLabel logic and remove unnecessary watch properties"
This reverts commit 8c40144734.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user