HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -22,23 +22,19 @@
|
||||
</gz-data-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const FORM_KEY = "review-list";
|
||||
export default {
|
||||
async created() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
vm.rights = window.$gz.role.getRights(window.$gz.type.Review);
|
||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||
|
||||
vm.objectId = window.$gz.util.stringToIntOrNull(vm.$route.params.objectId);
|
||||
vm.aType = window.$gz.util.stringToIntOrNull(vm.$route.params.aType);
|
||||
|
||||
//OPTIONAL FILTER
|
||||
if (vm.objectId && vm.objectId != 0 && vm.aType) {
|
||||
//OBJECTID,AYATYPE
|
||||
vm.clientCriteria = `${vm.objectId},${vm.aType}`;
|
||||
|
||||
vm.preFilterMode = {
|
||||
icon: window.$gz.util.iconForType(vm.aType),
|
||||
id: vm.objectId,
|
||||
@@ -47,7 +43,6 @@ export default {
|
||||
clearable: true
|
||||
};
|
||||
}
|
||||
|
||||
generateMenu(vm);
|
||||
},
|
||||
beforeDestroy() {
|
||||
@@ -65,18 +60,7 @@ export default {
|
||||
name: null
|
||||
};
|
||||
},
|
||||
// computed: {
|
||||
// iconForType() {
|
||||
// return window.$gz.util.iconForType(this.aType);
|
||||
// }
|
||||
// },
|
||||
methods: {
|
||||
// navToTarget: function() {
|
||||
// window.$gz.eventBus.$emit("openobject", {
|
||||
// type: this.aType,
|
||||
// id: this.objectId
|
||||
// });
|
||||
// },
|
||||
handleSelected(selected) {
|
||||
this.selectedItems = selected;
|
||||
},
|
||||
@@ -85,9 +69,6 @@ export default {
|
||||
this.preFilterMode = null;
|
||||
this.reload = !this.reload;
|
||||
}
|
||||
// iconForType() {
|
||||
// return window.$gz.util.iconForType(this.aType, 10);
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -98,7 +79,7 @@ async function clickHandler(menuItem) {
|
||||
if (!menuItem) {
|
||||
return;
|
||||
}
|
||||
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
const m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
if (m.owner == FORM_KEY && !m.disabled) {
|
||||
switch (m.key) {
|
||||
case "new":
|
||||
@@ -113,7 +94,7 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
break;
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open(
|
||||
const res = await m.vm.$refs.extensions.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Review)
|
||||
);
|
||||
if (res && res.refresh == true) {
|
||||
@@ -122,7 +103,7 @@ async function clickHandler(menuItem) {
|
||||
break;
|
||||
case "report":
|
||||
{
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
const res = await m.vm.$refs.reportSelector.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Review),
|
||||
m.id
|
||||
);
|
||||
@@ -130,7 +111,7 @@ async function clickHandler(menuItem) {
|
||||
return;
|
||||
}
|
||||
window.$gz.form.setLastReport(FORM_KEY, res);
|
||||
generateMenu(m.vm); //refresh the menu with the new report
|
||||
generateMenu(m.vm);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -146,7 +127,7 @@ async function clickHandler(menuItem) {
|
||||
//
|
||||
//
|
||||
function generateMenu(vm) {
|
||||
let menuOptions = {
|
||||
const menuOptions = {
|
||||
isMain: true,
|
||||
icon: "$ayiCalendarCheck",
|
||||
title: "ReviewList",
|
||||
@@ -169,8 +150,6 @@ function generateMenu(vm) {
|
||||
}
|
||||
}
|
||||
|
||||
//REPORTS
|
||||
//Report not Print, print is a further option
|
||||
menuOptions.menuItems.push({
|
||||
title: "Report",
|
||||
icon: "$ayiFileAlt",
|
||||
@@ -178,8 +157,7 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
|
||||
//get last report selected
|
||||
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
|
||||
const lastReport = window.$gz.form.getLastReport(FORM_KEY);
|
||||
if (lastReport != null) {
|
||||
menuOptions.menuItems.push({
|
||||
title: lastReport.name,
|
||||
|
||||
Reference in New Issue
Block a user