This commit is contained in:
@@ -30,7 +30,7 @@ export default {
|
||||
// Used by forms to fetch selection list data
|
||||
// Sorts alphabetically by default but can be turned off with do not sort
|
||||
//
|
||||
getSelectionList(enumKey) {
|
||||
getSelectionList(enumKey, noSort) {
|
||||
enumKey = enumKey.toLowerCase();
|
||||
let e = window.$gz.store.state.enums[enumKey];
|
||||
if (!e) {
|
||||
@@ -42,19 +42,14 @@ export default {
|
||||
}
|
||||
let ret = [];
|
||||
|
||||
//de-lodash
|
||||
// //turn it into an array suitable for selection lists
|
||||
// window.$gz. _.forOwn(e, function(value, key) {
|
||||
// ret.push({ id: Number(key), name: value });
|
||||
// });
|
||||
//return window.$gz. _.sortBy(ret, "name");
|
||||
|
||||
//turn it into an array suitable for selection lists
|
||||
for (const [key, value] of Object.entries(e)) {
|
||||
ret.push({ id: Number(key), name: value });
|
||||
}
|
||||
//sort by name
|
||||
ret.sort(window.$gz.util.sortByKey("name"));
|
||||
if (!noSort) {
|
||||
ret.sort(window.$gz.util.sortByKey("name"));
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
///////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user