This commit is contained in:
2020-07-31 23:54:46 +00:00
parent 15e8f4f81d
commit e7fe223c07
2 changed files with 8 additions and 10 deletions

View File

@@ -28,8 +28,9 @@ 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, doNotSort) {
enumKey = enumKey.toLowerCase();
let e = window.$gz.store.state.enums[enumKey];
if (!e) {
@@ -42,7 +43,12 @@ export default {
window.$gz._.forOwn(e, function(value, key) {
ret.push({ id: Number(key), name: value });
});
return ret;
if (doNotSort == true) {
return ret;
} else {
return window.$gz._.sortBy(ret, "name");
}
},
///////////////////////////////////
//