This commit is contained in:
2020-04-07 00:27:02 +00:00
parent 0e6e30b382
commit c179c4d40b
2 changed files with 25 additions and 24 deletions

View File

@@ -90,12 +90,12 @@ export default {
});
},
ok() {
this.resolve(this.selectedReport);
this.isVisible = false;
this.resolve(this.selectedReport);
},
cancel() {
this.resolve(null);
this.isVisible = false;
this.resolve(null);
}
}
};

View File

@@ -1,10 +1,8 @@
<template>
<v-container>
<gz-report-selector ref="reportSelector"></gz-report-selector>
<v-row v-if="formState.ready">
<v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-report-selector ref="reportSelector"></gz-report-selector>
</v-col>
<v-form ref="form">
<v-row>
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
@@ -575,27 +573,27 @@ function clickHandler(menuItem) {
m.vm.duplicate();
break;
case "report":
//debugger;
//todo: code the rest of this block
//update generateMenu to put in last report choice from vuex
//update enable / disable menu item code to make reports disabled when dirty like save and duplicate
//finally, make a fake report viewer view to go to with choices set
m.vm.$refs.reportSelector.open().then(res => {
console.log("Report selector result:", res);
//if null for no selection
//just bail out
if (res == null) {
return;
}
alert("STUB: view report " + res.name);
//if not null then persist this choice in formstate in vuex
//res.id = report id
//res.name = report name
//DON"T NEED to regenerate menu because we're leaving this form anyway and it will generate on return
//Now open the report viewer...
});
//TODO: FOLLOWING TWO LINES STILL VALID BUT NEED TO MAKE A REPORT CHOOSER COMPONENT
// let reportList = window.$gz.report.availableReports("WIDGET");
// let selectedItem = reportList[0].value;
//alert("STUB: REPORT LIST DIALOG");
// window.$gz.dialog
// .getReportChoice(m.vm, reportList, selectedItem)
// .then(res => {
// if (res) {
// window.$gz.eventBus.$emit(
// "notify-success",
// FORM_KEY + "::report click, selected is: [" + res + "]"
// );
// }
// });
break;
default:
window.$gz.eventBus.$emit(
@@ -652,6 +650,9 @@ function generateMenu(vm) {
vm: vm
});
//todo: get the last used report from the vuex form state and
//insert it here if it exists.
//was going to do multiple but that's a lot of fuckery and space eating
menuOptions.menuItems.push({
title: "stub: Last report used",
icon: "fa-file-alt",