This commit is contained in:
@@ -6,69 +6,22 @@ export default {
|
|||||||
//
|
//
|
||||||
// Deal with a request to open an object (from main datatables mainly)
|
// Deal with a request to open an object (from main datatables mainly)
|
||||||
// called from App.vue
|
// called from App.vue
|
||||||
handleOpenObjectClick(vm, menuItem) {
|
handleOpenObjectClick(vm, tid) {
|
||||||
//Key will start with the string "app:" if it's a global application command that should be handled here,
|
//expects extra data (tid) to be { type: [AYATYPE], id: [RECORDID] }
|
||||||
//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
|
if (tid.type && tid.id) {
|
||||||
var item = this.parseMenuItem(menuItem);
|
switch (tid.type) {
|
||||||
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":
|
case "customize":
|
||||||
vm.$router.push({
|
vm.$router.push({
|
||||||
name: "ay-customize",
|
name: "ay-customize",
|
||||||
params: { formCustomTemplateKey: item.data }
|
params: { formCustomTemplateKey: item.data }
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "nav":
|
|
||||||
vm.$router.push({ name: item.data });
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
"gzmenu:handleAppClick - unrecognized command [" +
|
"open-object-handler: unrecognized type [" + tid.type + "]"
|
||||||
menuItem.key +
|
|
||||||
"]"
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,9 +34,9 @@ export default {
|
|||||||
//
|
//
|
||||||
wireUpEventHandlers(vm) {
|
wireUpEventHandlers(vm) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
//expects extra data (tid) to be { type: [AYATYPE], id: [RECORDID] }
|
||||||
window.$gz.eventBus.$on("openobject", function handleOpenObjectClick(data) {
|
window.$gz.eventBus.$on("openobject", function handleOpenObjectClick(tid) {
|
||||||
self.handleAppClick(vm, data);
|
self.handleAppClick(vm, tid);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//new functions above here
|
//new functions above here
|
||||||
|
|||||||
Reference in New Issue
Block a user