This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
v-if="item.surface"
|
||||
:key="item.key"
|
||||
:disabled="item.disabled"
|
||||
@click="$gzevent.$emit('menu-click', item)"
|
||||
@click="window.$gz.eventbus.$emit('menu-click', item)"
|
||||
>
|
||||
<v-icon :color="item.color ? item.color : ''">
|
||||
{{ "fa-" + item.icon }}
|
||||
@@ -66,7 +66,7 @@
|
||||
v-else
|
||||
:key="item.key"
|
||||
:disabled="item.disabled"
|
||||
@click="$gzevent.$emit('menu-click', item)"
|
||||
@click="window.$gz.eventbus.$emit('menu-click', item)"
|
||||
v-bind:class="{ 'hidden-sm-and-up': item.surface }"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
@@ -136,12 +136,12 @@ export default {
|
||||
// ON GZEVENTBUS
|
||||
//
|
||||
//
|
||||
this.$gzmenu.wireUpEventHandlers(this);
|
||||
window.$gz.menu.wireUpEventHandlers(this);
|
||||
this.$gzdialog.wireUpEventHandlers(this);
|
||||
},
|
||||
beforeDestroy() {
|
||||
//UNWIRE ALL EVENT HANDLERS FROM GZEVENTBUS
|
||||
this.$gzevent.$off();
|
||||
this.window.$gz.eventbus.$off();
|
||||
},
|
||||
mounted() {
|
||||
//redirect to login if not authenticated
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
|
||||
///////////
|
||||
//ERROR
|
||||
vm.$gzevent.$on("notify-error", function handleNotifyWarn(msg) {
|
||||
window.$gz.eventbus.$on("notify-error", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.info(msg, {
|
||||
position: "bottom-right",
|
||||
icon: "fa-exclamation-triangle",
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
|
||||
///////////
|
||||
//WARNING
|
||||
vm.$gzevent.$on("notify-warning", function handleNotifyWarn(msg) {
|
||||
window.$gz.eventbus.$on("notify-warning", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.warning(msg, {
|
||||
position: "bottom-right",
|
||||
icon: "fa-exclamation",
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
|
||||
///////////
|
||||
//INFO
|
||||
vm.$gzevent.$on("notify-info", function handleNotifyWarn(msg) {
|
||||
window.$gz.eventbus.$on("notify-info", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.info(msg, {
|
||||
position: "bottom-right",
|
||||
icon: "fa-info-circle",
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
|
||||
///////////
|
||||
//SUCCESS
|
||||
vm.$gzevent.$on("notify-success", function handleNotifyWarn(msg) {
|
||||
window.$gz.eventbus.$on("notify-success", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.success(msg, {
|
||||
position: "bottom-right",
|
||||
icon: "fa-check-circle ",
|
||||
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
vm.$router.push({ name: item.data });
|
||||
break;
|
||||
default:
|
||||
vm.$gzevent.$emit(
|
||||
window.$gz.eventbus.$emit(
|
||||
"notify-warning",
|
||||
"gzmenu:handleAppClick - unrecognized command [" +
|
||||
menuItem.key +
|
||||
@@ -189,25 +189,29 @@ export default {
|
||||
//
|
||||
wireUpEventHandlers(vm) {
|
||||
var self = this;
|
||||
vm.$gzevent.$on("menu-change", function handleMenuChange(ctx) {
|
||||
window.$gz.eventbus.$on("menu-change", function handleMenuChange(ctx) {
|
||||
self.handleMenuChange(vm, ctx);
|
||||
});
|
||||
|
||||
vm.$gzevent.$on("menu-replace-item", function handleReplaceMenuItem(
|
||||
window.$gz.eventbus.$on("menu-replace-item", function handleReplaceMenuItem(
|
||||
newItem
|
||||
) {
|
||||
self.handleReplaceMenuItem(vm, newItem);
|
||||
});
|
||||
|
||||
vm.$gzevent.$on("menu-disable-item", function handleDisableMenuItem(key) {
|
||||
window.$gz.eventbus.$on("menu-disable-item", function handleDisableMenuItem(
|
||||
key
|
||||
) {
|
||||
self.handleDisableMenuItem(vm, key, true);
|
||||
});
|
||||
|
||||
vm.$gzevent.$on("menu-enable-item", function handleDisableMenuItem(key) {
|
||||
window.$gz.eventbus.$on("menu-enable-item", function handleDisableMenuItem(
|
||||
key
|
||||
) {
|
||||
self.handleDisableMenuItem(vm, key, false);
|
||||
});
|
||||
|
||||
vm.$gzevent.$on("menu-click", function handleMenuClick(menuitem) {
|
||||
window.$gz.eventbus.$on("menu-click", function handleMenuClick(menuitem) {
|
||||
self.handleAppClick(vm, menuitem);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ export default {
|
||||
});
|
||||
},
|
||||
filterMe() {
|
||||
this.$gzevent.$emit(
|
||||
window.$gz.eventbus.$emit(
|
||||
"notify-info",
|
||||
"inventoryWidgetList::filterMe -> STUB (selected items count=" +
|
||||
this.selected.length +
|
||||
|
||||
@@ -61,9 +61,9 @@ window.$gz = {
|
||||
};
|
||||
window.$gzlocale = locale;
|
||||
window.$gzformcustomtemplate = gzformcustomtemplate;
|
||||
Object.defineProperty(Vue.prototype, "$gztype", { value: gztype });
|
||||
Object.defineProperty(Vue.prototype, "$gzrole", { value: roles });
|
||||
Object.defineProperty(Vue.prototype, "$gzevent", { value: gzeventbus });
|
||||
//Object.defineProperty(Vue.prototype, "$gztype", { value: gztype });
|
||||
//Object.defineProperty(Vue.prototype, "$gzrole", { value: roles });
|
||||
//Object.defineProperty(Vue.prototype, "$gzevent", { value: gzeventbus });
|
||||
Object.defineProperty(Vue.prototype, "$gzmenu", { value: gzmenu });
|
||||
Object.defineProperty(Vue.prototype, "$gzdialog", { value: gzdialog });
|
||||
Object.defineProperty(Vue.prototype, "$gzutil", { value: gzutil });
|
||||
|
||||
@@ -178,7 +178,7 @@ function clickHandler(menuItem) {
|
||||
if (!menuItem) {
|
||||
return;
|
||||
}
|
||||
var m = this.$gzmenu.parseMenuItem(menuItem);
|
||||
var m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
if (m.owner == "about" && !m.disabled) {
|
||||
switch (m.key) {
|
||||
case "copysupportinfo":
|
||||
@@ -195,7 +195,7 @@ function clickHandler(menuItem) {
|
||||
this.$gzutil.copyToClipboard(text + "\nCLIENT LOG\n" + logText);
|
||||
break;
|
||||
default:
|
||||
m.vm.$gzevent.$emit(
|
||||
window.$gz.eventbus.$emit(
|
||||
"notify-warning",
|
||||
"About.vue::context click: [" + m.key + "]"
|
||||
);
|
||||
@@ -236,7 +236,7 @@ export default {
|
||||
.then(function() {
|
||||
vm.formState.ready = true;
|
||||
|
||||
vm.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: false,
|
||||
icon: "fa-info-circle",
|
||||
title: vm.$gzlocale.get("HelpAboutAyaNova"),
|
||||
@@ -257,7 +257,7 @@ export default {
|
||||
}
|
||||
]
|
||||
});
|
||||
vm.$gzevent.$on("menu-click", clickHandler);
|
||||
window.$gz.eventbus.$on("menu-click", clickHandler);
|
||||
})
|
||||
.catch(err => {
|
||||
vm.formState.ready = true;
|
||||
@@ -274,9 +274,7 @@ export default {
|
||||
throw error;
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
// this.$gzevent.$off("menu-click", clickHandler);
|
||||
},
|
||||
beforeDestroy() {},
|
||||
mounted() {
|
||||
this.clientInfo = {};
|
||||
this.clientInfo = aboutInfo;
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
HelloWorld
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-home",
|
||||
title: this.$gzlocale.get("Home")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-file-invoice-dollar",
|
||||
title: this.$gzlocale.get("Accounting")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-user-tie",
|
||||
title: this.$gzlocale.get("Administration")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "sliders-h",
|
||||
title: this.$gzlocale.get("Customize")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-shipping-fast",
|
||||
title: this.$gzlocale.get("Dispatch")
|
||||
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
created() {
|
||||
this.rights = window.$gz.role.getRights(this, window.$gz.type.Widget);
|
||||
|
||||
this.$gzevent.$on("menu-click", clickHandler);
|
||||
window.$gz.eventbus.$on("menu-click", clickHandler);
|
||||
//id 0 means create a new record don't load one
|
||||
if (this.$route.params.id != 0) {
|
||||
this.getDataFromApi(this.$route.params.id);
|
||||
@@ -309,7 +309,7 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$gzevent.$off("menu-click", clickHandler);
|
||||
window.$gz.eventbus.$off("menu-click", clickHandler);
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
@@ -358,17 +358,23 @@ export default {
|
||||
//enable / disable save button
|
||||
var canSave = val.dirty && val.valid && !val.readOnly;
|
||||
if (canSave) {
|
||||
this.$gzevent.$emit("menu-enable-item", FORM_KEY + ":save");
|
||||
window.$gz.eventbus.$emit("menu-enable-item", FORM_KEY + ":save");
|
||||
} else {
|
||||
this.$gzevent.$emit("menu-disable-item", FORM_KEY + ":save");
|
||||
window.$gz.eventbus.$emit("menu-disable-item", FORM_KEY + ":save");
|
||||
}
|
||||
|
||||
//enable / disable duplicate button
|
||||
var canDuplicate = !val.dirty && val.valid && !val.readOnly;
|
||||
if (canDuplicate) {
|
||||
this.$gzevent.$emit("menu-enable-item", FORM_KEY + ":duplicate");
|
||||
window.$gz.eventbus.$emit(
|
||||
"menu-enable-item",
|
||||
FORM_KEY + ":duplicate"
|
||||
);
|
||||
} else {
|
||||
this.$gzevent.$emit("menu-disable-item", FORM_KEY + ":duplicate");
|
||||
window.$gz.eventbus.$emit(
|
||||
"menu-disable-item",
|
||||
FORM_KEY + ":duplicate"
|
||||
);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
@@ -563,7 +569,7 @@ function clickHandler(menuItem) {
|
||||
if (!menuItem) {
|
||||
return;
|
||||
}
|
||||
var m = this.$gzmenu.parseMenuItem(menuItem);
|
||||
var m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
if (m.owner == FORM_KEY && !m.disabled) {
|
||||
switch (m.key) {
|
||||
case "save":
|
||||
@@ -582,7 +588,7 @@ function clickHandler(menuItem) {
|
||||
.getReportChoice(m.vm, reportList, selectedItem)
|
||||
.then(res => {
|
||||
if (res) {
|
||||
m.vm.$gzevent.$emit(
|
||||
window.$gz.eventbus.$emit(
|
||||
"notify-success",
|
||||
FORM_KEY + "::report click, selected is: [" + res + "]"
|
||||
);
|
||||
@@ -591,7 +597,7 @@ function clickHandler(menuItem) {
|
||||
|
||||
break;
|
||||
default:
|
||||
m.vm.$gzevent.$emit(
|
||||
window.$gz.eventbus.$emit(
|
||||
"notify-warning",
|
||||
FORM_KEY + "::context click: [" + m.key + "]"
|
||||
);
|
||||
@@ -650,7 +656,7 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
|
||||
vm.$gzevent.$emit("menu-change", menuOptions);
|
||||
window.$gz.eventbus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
|
||||
var JUST_DELETED = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
});
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-dolly",
|
||||
title: this.$gzlocale.get("Inventory")
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/* Xeslint-disable */
|
||||
export default {
|
||||
created() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: false,
|
||||
icon: "fa-info-circle",
|
||||
title: this.$gzlocale.get("Log"),
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "",
|
||||
title: ""
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script>
|
||||
export default {
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-dragon",
|
||||
title: "404 - " + this.$gzlocale.get("ErrorAPI2010")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-cogs",
|
||||
title: this.$gzlocale.get("Operations")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
window.$gz.eventbus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-toolbox",
|
||||
title: this.$gzlocale.get("Service")
|
||||
|
||||
Reference in New Issue
Block a user