This commit is contained in:
2020-09-01 15:43:05 +00:00
parent d646306958
commit 1effb6ccb2
4 changed files with 64 additions and 9 deletions

View File

@@ -456,6 +456,20 @@ export default {
refresh() {
this.getDataFromApi();
},
getRowIds() {
//get selected row id's if there are selections else get all row id's
//called into from parent for things like reporting or bulk ops
if (this.selected.length > 0) {
//return row id's of selected items only
}
if (this.records.length > 0) {
//return row id's of all items
}
//no data, just return an empty array
return [];
// console.log("records:", this.records);
// console.log("selected:", this.selected);
},
handleSelectChange() {
//due to making own template for items need to handle singleselect which only affects if select all checkbox at top is visible when making own item template
if (this.singleSelect) {

View File

@@ -135,6 +135,9 @@ decision: how to handle opening report templates in the UI - should every report
working widget template
Immediately render last report code needs proper implementation for both widget and widgets
currently it's nonsense
print / preview coded to work with saved report and renders
build release for joyce to play with and give feedback

View File

@@ -630,7 +630,7 @@ async function clickHandler(menuItem) {
break;
case "report":
if (m.id != null) {
//last report selected
//last report selected is in m.id
m.vm.$router.push({
name: "ay-report",
params: { recordid: m.id, ayatype: window.$gz.type.Widget }
@@ -704,7 +704,7 @@ function generateMenu(vm) {
});
}
//STUB REPORTS
//REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: "Report",

View File

@@ -1,5 +1,6 @@
<template>
<div>
<gz-report-selector ref="reportSelector"></gz-report-selector>
<gz-extensions
:ayaType="ayType"
:selectedItems="selectedItems"
@@ -7,6 +8,7 @@
>
</gz-extensions>
<gz-data-table
ref="gzdatatable"
formKey="widget-list"
:dataListKey="dataListKey"
:dataListFilter="dataListFilter"
@@ -66,6 +68,38 @@ async function clickHandler(menuItem) {
case "extensions":
let res = await m.vm.$refs.extensions.open();
break;
case "report":
if (m.id != null) {
//last report selected is in m.id
m.vm.$router.push({
name: "ay-report",
params: { recordid: m.id, ayatype: window.$gz.type.Widget }
});
} else {
//general report selector chosen
m.vm.$refs.gzdatatable.getRowIds();
return;
let res = await m.vm.$refs.reportSelector.open(
window.$gz.type.Widget,
[m.vm.getSelection()]
);
//if null for no selection
//just bail out
if (res == null) {
return;
}
//persist last report selected
window.$gz.form.setLastReport(FORM_KEY, res);
//Now open the report viewer...
m.vm.$router.push({
name: "ay-report",
params: { recordid: res.id, ayatype: window.$gz.type.Widget }
});
}
break;
default:
window.$gz.eventBus.$emit(
@@ -101,7 +135,7 @@ function generateMenu(vm) {
});
}
//STUB REPORTS
//REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: "Report",
@@ -110,12 +144,16 @@ function generateMenu(vm) {
vm: vm
});
menuOptions.menuItems.push({
title: "stub: Last report used",
icon: "fa-file-alt",
key: FORM_KEY + ":report:STUBlastusedreportid",
vm: vm
});
//get last report selected
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
if (lastReport != null) {
menuOptions.menuItems.push({
title: lastReport.name,
icon: "fa-file-alt",
key: FORM_KEY + ":report:" + lastReport.id,
vm: vm
});
}
menuOptions.menuItems.push({
title: "Extensions",