This commit is contained in:
2019-05-02 22:45:51 +00:00
parent f935f3a66b
commit c90c915e1f
6 changed files with 65 additions and 27 deletions

View File

@@ -53,9 +53,8 @@ export default {
});
});
},
////////////////////////////
//
/////////////////////////////////////
// Are you sure you want to delete?
//
confirmDelete(vm) {
//https://github.com/yariksav/vuetify-dialog#readme
@@ -75,6 +74,26 @@ export default {
}
]
});
}, /////////////////////////////////////
// Are you sure you want to delete?
//
confirmLeaveUnsaved(vm) {
return vm.$dialog.warning({
text: vm.$gzlocale.get("AreYouSureUnsavedChanges"),
title: vm.$gzlocale.get("Leave"),
icon: "fa-exclamation-triangle",
actions: [
{
text: vm.$gzlocale.get("Cancel"),
key: false
},
{
text: vm.$gzlocale.get("Leave"),
color: "red",
key: true
}
]
});
}
//new functions above here
};

View File

@@ -1,5 +1,5 @@
/* Xeslint-disable */
import { processLogout } from "./authutil";
//import { processLogout } from "./authutil";
/////////////////////////////////
// Menu utils and handlers
@@ -123,8 +123,20 @@ export default {
window.open(helpurl, "_blank");
break;
case "logout":
processLogout();
vm.$router.push({ name: "login" });
// if (vm.formState && vm.formState.dirty) {
// vm.$gzdialog.confirmLeaveUnsaved(vm).then(dialogResult => {
// if (dialogResult == true) {
// processLogout();
// vm.$router.push({ name: "login" });
// } else {
// return;
// }
// });
// } else {
// processLogout();
// vm.$router.push({ name: "login" });
// }
break;
case "nav":
vm.$router.push({ name: item.data });

View File

@@ -92,7 +92,9 @@ export default {
"ErrorServerUnresponsive",
"ErrorUserNotAuthenticated",
"ErrorUserNotAuthorized",
"DeletePrompt"
"DeletePrompt",
"AreYouSureUnsavedChanges",
"Leave"
],
decimalValidate(required) {
return { required: required, decimal: [2, this.formats.decimalSeparator] };