mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
address: sort cities by code and then by name + improve city display
This commit is contained in:
parent
f7954d5159
commit
62c0410bf5
@ -72,7 +72,7 @@ export default {
|
||||
addresses() {
|
||||
return this.entity.loaded.addresses.sort(
|
||||
(a, b) => a.street > b.street || Number(a.streetNumber) - Number(b.streetNumber)
|
||||
)
|
||||
)
|
||||
},
|
||||
street: {
|
||||
set(value) {
|
||||
|
@ -68,7 +68,9 @@ export default {
|
||||
return this.$data.value !== null && typeof this.$data.value.text !== 'undefined';
|
||||
},
|
||||
cities() {
|
||||
return this.entity.loaded.cities;
|
||||
return this.entity.loaded.cities.sort(
|
||||
(a, b) => Number(a.code) - Number(b.code) || a.name > b.name
|
||||
)
|
||||
},
|
||||
name: {
|
||||
set(value) {
|
||||
@ -92,7 +94,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
transName(value) {
|
||||
return (value.code && value.name) ? `${value.code}-${value.name}` : '';
|
||||
return (value.code && value.name) ? `${value.name} (${value.code})` : '';
|
||||
},
|
||||
selectCity(value) {
|
||||
this.entity.selected.city = value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user