This commit is contained in:
2020-01-30 21:30:59 +00:00
parent 1b0a98095c
commit e028b609ac
3 changed files with 98 additions and 9 deletions

View File

@@ -0,0 +1,90 @@
/* xxxeslint-disable */
export default {
///////////////////////////////
// APP (GLOBAL) openobject CLICK HANDLER
//
// Deal with a request to open an object (from main datatables mainly)
// called from App.vue
handleOpenObjectClick(vm, 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
//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
var item = this.parseMenuItem(menuItem);
if (!item.disabled && item.owner == "app") {
switch (item.key) {
case "help":
var helpurl = vm.$store.state.helpUrl + item.data;
window.open(helpurl, "_blank");
break;
case "search":
vm.$router.push({
name: "home-search",
params: { ayatype: item.data }
});
break;
case "attachments":
vm.$router.push({
name: "ay-attachments",
params: { ayatype: item.data.ayaType, recordid: item.data.recordId }
});
break;
case "wiki":
vm.$router.push({
name: "ay-wiki",
params: { ayatype: item.data.ayaType, recordid: item.data.recordId }
});
break;
case "review":
vm.$router.push({
name: "ay-review",
params: { ayatype: item.data.ayaType, recordid: item.data.recordId }
});
break;
case "history":
vm.$router.push({
name: "ay-history",
params: { ayatype: item.data.ayaType, recordid: item.data.recordId }
});
break;
case "logout":
vm.$router.push("/login");
break;
case "customize":
vm.$router.push({
name: "ay-customize",
params: { formCustomTemplateKey: item.data }
});
break;
case "nav":
vm.$router.push({ name: item.data });
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
"gzmenu:handleAppClick - unrecognized command [" +
menuItem.key +
"]"
);
}
}
},
///////////////////////////////////
// WIRE UP MENU EVENTS
//
// called once from app.vue only
//
wireUpEventHandlers(vm) {
var self = this;
window.$gz.eventBus.$on("openobject", function handleOpenObjectClick(data) {
self.handleAppClick(vm, data);
});
}
//new functions above here
};