This commit is contained in:
2019-04-19 17:34:51 +00:00
parent c9abfe8ef1
commit 94a1955d86
3 changed files with 21 additions and 19 deletions

View File

@@ -40,7 +40,7 @@ export default {
title: that.$gzlocale.get("Logout"),
icon: "sign-out-alt",
color: "pink",
key: "app||logout"
key: "app:logout"
});
//divider
@@ -50,14 +50,16 @@ export default {
that.appBar.menuItems.push({
title: that.$gzlocale.get("MenuHelp"),
icon: "question-circle",
key: "app||help||" + that.appBar.helpUrl
key: "app:help",
data: that.appBar.helpUrl
});
//ABOUT
that.appBar.menuItems.push({
title: that.$gzlocale.get("HelpAboutAyaNova"),
icon: "info-circle",
key: "app||nav||about"
key: "app:nav:abt",
data: "about"
});
},
///////////////////////////////
@@ -86,20 +88,19 @@ export default {
// Deal with a menu change request
// called from App.vue
handleClick(that, menuitem) {
//Key will start with the string "app||" if it's a global application command that should be handled here,
//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 key after the command portion of the menu item (e.g. the url in a app||help link)
//split a key into component parts, part one is the responsible party, part two is the command, part three to part * are all extra info
//each part is separated by a double pipe symbol ||
//If there is any extended information required for the command it will be in the data property of the menu item
//split a key into component parts, part one is the responsible party, part two is the command, part three only exists to make it unique if necessary
//each part is separated by a colon
//Handle different items
if (!menuitem.disabled && menuitem.key.startsWith("app||")) {
var keyparts = menuitem.key.split("||");
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
var keyparts = menuitem.key.split(":");
var cmd = keyparts[1];
var data = keyparts[2] ? keyparts[2] : null;
switch (cmd) {
case "help":
var helpurl = that.$store.state.helpUrl + data;
var helpurl = that.$store.state.helpUrl + menuitem.data;
window.open(helpurl, "_blank");
break;
case "logout":
@@ -107,7 +108,7 @@ export default {
that.$router.replace({ name: "login" });
break;
case "nav":
that.$router.replace({ name: data });
that.$router.replace({ name: menuitem.data });
break;
default:
alert(