This commit is contained in:
@@ -456,7 +456,7 @@ export default {
|
||||
refresh() {
|
||||
this.getDataFromApi();
|
||||
},
|
||||
getReportDataOptions(AyaType) {
|
||||
getReportDataOptions(ayaType) {
|
||||
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
|
||||
//i.e. for reporting, bulk operations etc
|
||||
@@ -471,13 +471,13 @@ export default {
|
||||
return z.id;
|
||||
});
|
||||
}
|
||||
/* public AyaType ObjectType { get; set; }
|
||||
/* 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 {
|
||||
ObjectType:ayaType
|
||||
ObjectType: ayaType,
|
||||
selectedRowIds: selectedRowIds,
|
||||
dataListKey: vm.dataListKey,
|
||||
listView: untokenizeListView(vm.listView)
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
export default {
|
||||
data: () => ({
|
||||
rights: window.$gz.role.getRights(window.$gz.type.Report),
|
||||
ayaType: null,
|
||||
reportDataOptions: {},
|
||||
isVisible: false,
|
||||
resolve: null,
|
||||
@@ -75,16 +74,19 @@ export default {
|
||||
selectedReport: null
|
||||
}),
|
||||
methods: {
|
||||
async open(ayaType, reportDataOptions) {
|
||||
async open(reportDataOptions) {
|
||||
let vm = this;
|
||||
if (ayaType == null || reportDataOptions == null) {
|
||||
throw "report-selector:Open missing type and or reportDataOptions";
|
||||
if (reportDataOptions == null) {
|
||||
throw "report-selector:Open missing reportDataOptions";
|
||||
}
|
||||
if (reportDataOptions.ObjectType == null) {
|
||||
throw "report-selector:Open - ObjectType is missing or empty";
|
||||
}
|
||||
this.ayaType = ayaType;
|
||||
|
||||
//source data object
|
||||
//either need to rehydrate or send as is if not selectedRowIds
|
||||
// {
|
||||
// ObjectType: ayaType,
|
||||
// selectedRowIds: selectedRowIds,
|
||||
// dataListKey: vm.dataListKey,
|
||||
// listView: untokenizeListView(vm.listView)
|
||||
@@ -96,7 +98,9 @@ export default {
|
||||
|
||||
//get report list from server
|
||||
|
||||
let res = await window.$gz.api.get(`report/list/${ayaType}`);
|
||||
let res = await window.$gz.api.get(
|
||||
`report/list/${reportDataOptions.ObjectType}`
|
||||
);
|
||||
//console.log("report-selectr report list from server is: ", res);
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
@@ -125,7 +129,6 @@ export default {
|
||||
name: "ay-report-edit",
|
||||
params: {
|
||||
recordid: 0,
|
||||
ayaType: this.ayaType,
|
||||
reportDataOptions: this.reportDataOptions
|
||||
}
|
||||
});
|
||||
|
||||
@@ -766,23 +766,25 @@ async function fetchTranslatedText(vm) {
|
||||
////////////////////
|
||||
//
|
||||
async function fetchReportData(vm) {
|
||||
let reportDataOptions = vm.$route.params.reportDataOptions;
|
||||
vm.obj.objectType = vm.$route.params.ayaType;
|
||||
if (!reportDataOptions) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter reportDataOptions is missing or empty, unable to init report designer";
|
||||
}
|
||||
if (vm.obj.objectType == null) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter ayaType is missing or empty, unable to init report designer";
|
||||
}
|
||||
/* 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
|
||||
*/
|
||||
let res = await window.$gz.api.upsert("report/object-report-data", {
|
||||
ObjectType: vm.obj.objectType,
|
||||
ObjectIdArray: reportDataOptions
|
||||
});
|
||||
|
||||
let reportDataOptions = vm.$route.params.reportDataOptions;
|
||||
if (!reportDataOptions) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter reportDataOptions is missing or empty, unable to init report designer";
|
||||
}
|
||||
if (reportDataOptions.ObjectType == null) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter ObjectType is missing or empty, unable to init report designer";
|
||||
}
|
||||
vm.obj.objectType = reportDataOptions.ObjectType;
|
||||
|
||||
let res = await window.$gz.api.upsert(
|
||||
"report/object-report-data",
|
||||
reportDataOptions
|
||||
);
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
throw res;
|
||||
|
||||
@@ -76,11 +76,10 @@ async function clickHandler(menuItem) {
|
||||
params: { recordid: m.id, ayatype: window.$gz.type.Widget }
|
||||
});
|
||||
} else {
|
||||
//general report selector chosen
|
||||
//general report selector chosen
|
||||
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
window.$gz.type.Widget,
|
||||
m.vm.$refs.gzdatatable.getReportDataOptions()
|
||||
m.vm.$refs.gzdatatable.getReportDataOptions(window.$gz.type.Widget)
|
||||
);
|
||||
|
||||
//if null for no selection
|
||||
|
||||
Reference in New Issue
Block a user