This commit is contained in:
2019-04-19 20:57:06 +00:00
parent 56f8ee0a35
commit 2a15d8e1aa
6 changed files with 39 additions and 33 deletions

View File

@@ -87,7 +87,7 @@ export default {
//
// Deal with a menu change request
// called from App.vue
handleAppClick(that, menuitem) {
handleAppClick(that, menuItem) {
//Key will start with the string "app:" if it's a global application command that should be handled here,
//otherwise it's a local command for a local form only
//If there is any extended information required for the command it will be in the data property of the menu item
@@ -95,41 +95,45 @@ export default {
//each part is separated by a colon
//Handle different items
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
var keyparts = menuitem.key.split(":");
var cmd = keyparts[1];
switch (cmd) {
var item = this.parseMenuItem(menuItem);
if (!item.disabled && item.owner == "app") {
switch (item.key) {
case "help":
var helpurl = that.$store.state.helpUrl + menuitem.data;
var helpurl = that.$store.state.helpUrl + item.data;
window.open(helpurl, "_blank");
break;
case "logout":
processLogout();
that.$router.replace({ name: "login" });
that.$router.push({ name: "login" });
break;
case "nav":
that.$router.replace({ name: menuitem.data });
that.$router.push({ name: item.data });
break;
default:
alert(
"gzmenu:handleAppClick - unrecognized command [" +
menuitem.key +
menuItem.key +
"]"
);
}
}
},
///////////////////////////////
// CONFIRM RELEVANT CLICK
// PARSE MENU ITEM CLICK
//
// confirm the click is relevant
// to a contextual caller
// called by all forms except app.vue
isRelevantClick(menuitem) {
if (!menuitem.disabled && !menuitem.key.startsWith("app:")) {
return true;
}
return false;
// parse out the parts of a
// menu item from a click event
//
parseMenuItem(menuItem) {
//format is "AREA:KEY:UNIQUEID"
//and data is in data portion
var keyparts = menuItem.key.split(":");
return {
owner: keyparts[0],
key: keyparts[1],
data: menuItem.data,
disabled: menuItem.disabled
};
}
//new functions above here
};