This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
//big object so maybe it's own thing, not part of locale at all or locale fronts for it??
|
//big object so maybe it's own thing, not part of locale at all or locale fronts for it??
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
//enums.AuthorizationRoles[0]
|
//enums.AuthorizationRoles[0]
|
||||||
getEnumDisplay(enumKey, enumValue) {
|
getEnumDisplay(enumKey, enumValue) {
|
||||||
// debugger;
|
// debugger;
|
||||||
enumKey = enumKey.toLowerCase();
|
enumKey = enumKey.toLowerCase();
|
||||||
@@ -41,34 +41,22 @@ export default {
|
|||||||
if (!window.$gz._.has(window.$gz.store.state.enums, enumKey)) {
|
if (!window.$gz._.has(window.$gz.store.state.enums, enumKey)) {
|
||||||
var that = this;
|
var that = this;
|
||||||
(async function() {
|
(async function() {
|
||||||
await that.fetch(enumKey).then(res => {
|
await that.fetch(enumKey).then(dat => {
|
||||||
//massage the data as necessary
|
//massage the data as necessary
|
||||||
debugger;
|
debugger;
|
||||||
// console.log(res);
|
|
||||||
/**
|
var e = { enumKey: enumKey, items: {} };
|
||||||
Turn this: [
|
for (var i = 0; i < dat.length; i++) {
|
||||||
{
|
var o = dat[i];
|
||||||
"id": 0,
|
e.items[o.id] = o.name;
|
||||||
"name": "No role"
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Business administration - limited"
|
|
||||||
},
|
|
||||||
|
|
||||||
Into this:
|
|
||||||
{0:"No role",1:"Business..."}
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
//stuff the data into the store
|
//stuff the data into the store
|
||||||
// window.$gz.store.commit("setEnum", item);
|
window.$gz.store.commit("setEnum", e);
|
||||||
return window.$gz.store.state.enums[enumKey];
|
return window.$gz.store.state.enums[enumKey];
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
} else {
|
} else {
|
||||||
debugger;
|
|
||||||
return window.$gz.store.state.enums[enumKey];
|
return window.$gz.store.state.enums[enumKey];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -81,76 +69,3 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
*
|
|
||||||
* /** */
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Business administration - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Dispatch - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 8,
|
|
||||||
"name": "Dispatch - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 16,
|
|
||||||
"name": "Inventory - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 32,
|
|
||||||
"name": "Inventory - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 64,
|
|
||||||
"name": "Accounting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 128,
|
|
||||||
"name": "Service technician - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 256,
|
|
||||||
"name": "Service technician - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 512,
|
|
||||||
"name": "Subcontractor - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1024,
|
|
||||||
"name": "Subcontractor - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2048,
|
|
||||||
"name": "Customer user - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4096,
|
|
||||||
"name": "Customer user - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 8192,
|
|
||||||
"name": "System operations - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 16384,
|
|
||||||
"name": "System operations - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 65536,
|
|
||||||
"name": "Sales - limited"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 32768,
|
|
||||||
"name": "Sales - full"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 131071,
|
|
||||||
"name": "All roles"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
@@ -520,12 +520,12 @@ function buildRecords(listData, columndefinitions, filters) {
|
|||||||
break;
|
break;
|
||||||
case 10: //enum
|
case 10: //enum
|
||||||
//TODO: Need enum translator
|
//TODO: Need enum translator
|
||||||
//AuthorizationRoles.128
|
//AuthorizationRoles.128
|
||||||
//window.$gz.local.enumLocalized(enumType, enumValue)
|
//window.$gz.local.enumLocalized(enumType, enumValue)
|
||||||
//(in locale) check if have that type already featched, if not fetches the whole list and caches it locally
|
//(in locale) check if have that type already featched, if not fetches the whole list and caches it locally
|
||||||
//also a method to return the list of enumerated types in ID order with localized names
|
//also a method to return the list of enumerated types in ID order with localized names
|
||||||
//window.$gz.local.enumList(enumType) - returns a list usable on edit forms
|
//window.$gz.local.enumList(enumType) - returns a list usable on edit forms
|
||||||
/* enums: {
|
/* enums: {
|
||||||
AuthorizationRoles0:"No role",
|
AuthorizationRoles0:"No role",
|
||||||
AuthorizationRoles1:"Business admin limited"
|
AuthorizationRoles1:"Business admin limited"
|
||||||
etc
|
etc
|
||||||
@@ -536,7 +536,7 @@ function buildRecords(listData, columndefinitions, filters) {
|
|||||||
This way entirely bypasses locale stuff
|
This way entirely bypasses locale stuff
|
||||||
//big object so maybe it's own thing, not part of locale at all or locale fronts for it??
|
//big object so maybe it's own thing, not part of locale at all or locale fronts for it??
|
||||||
*/
|
*/
|
||||||
window.$gz.enums.getEnumList(columndefinitions[iColumn].et);
|
window.$gz.enums.getEnumList(columndefinitions[iColumn].et);
|
||||||
display = columndefinitions[iColumn].et + "." + display;
|
display = columndefinitions[iColumn].et + "." + display;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user