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