This commit is contained in:
2019-06-12 19:56:14 +00:00
parent 03d4b11394
commit dce45378da
3 changed files with 15 additions and 7 deletions

View File

@@ -116,12 +116,13 @@ export default {
}, /////////////////////////////////////
// Show a report list
//
async getReportChoice(vm, reports) {
async getReportChoice(vm, reports, preselected) {
const result = await vm.$dialog.showAndWait(reportChooser, {
reports: reports,
title: vm.$gzlocale.get("Report"),
oktext: vm.$gzlocale.get("Print"),
canceltext: vm.$gzlocale.get("Cancel")
canceltext: vm.$gzlocale.get("Cancel"),
selectedvalue: preselected
});
return result;
}

View File

@@ -11,7 +11,7 @@
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* eslint-disable */
/* Xeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
@@ -21,6 +21,11 @@ export default {
// setTimeout(resolve, 3000)
// })
// },
created() {
if (this.selectedvalue) {
this.selected = this.selectedvalue;
}
},
data() {
return {
selected: {}
@@ -30,7 +35,8 @@ export default {
title: String,
oktext: String,
canceltext: String,
reports: Array
reports: Array,
selectedvalue: Number
},
computed: {
actions() {
@@ -53,8 +59,7 @@ export default {
}
},
methods: {
handleClick(res) {
// debugger;
handleClick() {
this.$emit("submit", this.selected);
return false;
}

View File

@@ -184,8 +184,10 @@ function clickHandler(menuItem) {
m.vm.duplicate();
break;
case "report":
var reportList = m.vm.$gzreport.availableReports("WIDGET");
var selectedItem = reportList[0].value;
m.vm.$gzdialog
.getReportChoice(m.vm, m.vm.$gzreport.availableReports("WIDGET"))
.getReportChoice(m.vm, reportList, selectedItem)
.then(result => {
m.vm.$gzevent.$emit(
"notify-success",