This commit is contained in:
2020-09-01 17:59:01 +00:00
parent 4b3bd3aa07
commit 97bc981b16
4 changed files with 25 additions and 19 deletions

View File

@@ -456,7 +456,7 @@ export default {
refresh() { refresh() {
this.getDataFromApi(); this.getDataFromApi();
}, },
getDataTableSourceOptions() { getReportDataOptions(AyaType) {
let vm = this; let vm = this;
//called when parent form needs the selected id's or the list view options needed to rehydrate the entire list of id's in the same order and filter //called when parent form needs the selected id's or the list view options needed to rehydrate the entire list of id's in the same order and filter
//i.e. for reporting, bulk operations etc //i.e. for reporting, bulk operations etc
@@ -471,7 +471,13 @@ export default {
return z.id; return z.id;
}); });
} }
/* public AyaType ObjectType { get; set; }
public long[] SelectedRowIds { get; set; }
public string DataListKey { get; set; }
public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
*/
return { return {
ObjectType:ayaType
selectedRowIds: selectedRowIds, selectedRowIds: selectedRowIds,
dataListKey: vm.dataListKey, dataListKey: vm.dataListKey,
listView: untokenizeListView(vm.listView) listView: untokenizeListView(vm.listView)

View File

@@ -63,7 +63,7 @@ export default {
data: () => ({ data: () => ({
rights: window.$gz.role.getRights(window.$gz.type.Report), rights: window.$gz.role.getRights(window.$gz.type.Report),
ayaType: null, ayaType: null,
sourceData: {}, reportDataOptions: {},
isVisible: false, isVisible: false,
resolve: null, resolve: null,
reject: null, reject: null,
@@ -75,10 +75,10 @@ export default {
selectedReport: null selectedReport: null
}), }),
methods: { methods: {
async open(ayaType, sourceData) { async open(ayaType, reportDataOptions) {
let vm = this; let vm = this;
if (ayaType == null || sourceData == null) { if (ayaType == null || reportDataOptions == null) {
throw "report-selector:Open missing type and or sourceData"; throw "report-selector:Open missing type and or reportDataOptions";
} }
this.ayaType = ayaType; this.ayaType = ayaType;
@@ -90,7 +90,7 @@ export default {
// listView: untokenizeListView(vm.listView) // listView: untokenizeListView(vm.listView)
// } // }
this.sourceData = sourceData; this.reportDataOptions = reportDataOptions;
//rights //rights
@@ -126,7 +126,7 @@ export default {
params: { params: {
recordid: 0, recordid: 0,
ayaType: this.ayaType, ayaType: this.ayaType,
sourceData: this.sourceData reportDataOptions: this.reportDataOptions
} }
}); });
} }

View File

@@ -157,8 +157,8 @@ export default {
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
//route params MUST have source data //route params MUST have source data
if (!vm.$route.params.sourceData) { if (!vm.$route.params.reportDataOptions) {
throw "ay-report-edit::created - missing sourceData route parameter"; throw "ay-report-edit::created - missing reportDataOptions route parameter";
} }
//id 0 means create a new record don't load one //id 0 means create a new record don't load one
@@ -766,22 +766,22 @@ async function fetchTranslatedText(vm) {
//////////////////// ////////////////////
// //
async function fetchReportData(vm) { async function fetchReportData(vm) {
let sourceData = vm.$route.params.sourceData; let reportDataOptions = vm.$route.params.reportDataOptions;
vm.obj.objectType = vm.$route.params.ayaType; vm.obj.objectType = vm.$route.params.ayaType;
if (!sourceData) { if (!reportDataOptions) {
throw "ay-report-edit:fetchReportData - route parameter sourceData is missing or empty, unable to init report designer"; throw "ay-report-edit:fetchReportData - route parameter reportDataOptions is missing or empty, unable to init report designer";
} }
if (vm.obj.objectType == null) { if (vm.obj.objectType == null) {
throw "ay-report-edit:fetchReportData - route parameter ayaType is missing or empty, unable to init report designer"; throw "ay-report-edit:fetchReportData - route parameter ayaType is missing or empty, unable to init report designer";
} }
/* public class ObjectReportDataParameter /* public AyaType ObjectType { get; set; }
{ public long[] SelectedRowIds { get; set; }
public AyaType ObjectType { get; set; } public string DataListKey { get; set; }
public long[] ObjectIdArray { get; set; } public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
} */ */
let res = await window.$gz.api.upsert("report/object-report-data", { let res = await window.$gz.api.upsert("report/object-report-data", {
ObjectType: vm.obj.objectType, ObjectType: vm.obj.objectType,
ObjectIdArray: sourceData ObjectIdArray: reportDataOptions
}); });
//We never expect there to be no data here //We never expect there to be no data here
if (!res.hasOwnProperty("data")) { if (!res.hasOwnProperty("data")) {

View File

@@ -80,7 +80,7 @@ async function clickHandler(menuItem) {
let res = await m.vm.$refs.reportSelector.open( let res = await m.vm.$refs.reportSelector.open(
window.$gz.type.Widget, window.$gz.type.Widget,
m.vm.$refs.gzdatatable.getDataTableSourceOptions() m.vm.$refs.gzdatatable.getReportDataOptions()
); );
//if null for no selection //if null for no selection