This commit is contained in:
@@ -656,7 +656,7 @@ export default {
|
||||
// RENDER REPORT DIRECTLY
|
||||
//
|
||||
//
|
||||
async renderReport(objectid, reportid) {
|
||||
async renderReport(objectid, reportid, redirectNotPopup) {
|
||||
let reportDataOptions = {
|
||||
ReportId: reportid,
|
||||
SelectedRowIds: [objectid],
|
||||
@@ -668,10 +668,15 @@ export default {
|
||||
throw new Error(res.error);
|
||||
} else {
|
||||
let reportUrl = window.$gz.api.reportDownloadUrl(res.data);
|
||||
if (window.open(reportUrl, "Report") == null) {
|
||||
throw new Error(
|
||||
"Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
|
||||
);
|
||||
if (redirectNotPopup) {
|
||||
//used for direct report open from direct report view url
|
||||
window.location.replace(reportUrl);
|
||||
} else {
|
||||
if (window.open(reportUrl, "Report") == null) {
|
||||
throw new Error(
|
||||
"Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,9 +522,23 @@ export default new Router({
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "ay-common" */ "./views/ay-history.vue")
|
||||
},
|
||||
//SPECIAL ROUTES
|
||||
{
|
||||
//REPORT VIEW FROM URL
|
||||
path: "/viewreport",
|
||||
beforeEnter: (to, from, next) => {
|
||||
(async function() {
|
||||
//open report links have a query string /viewreport?oid=[objectid]&rid=[reportid]
|
||||
let objectId = parseInt(to.query.oid);
|
||||
let reportId = parseInt(to.query.rid);
|
||||
await window.$gz.api.renderReport(objectId, reportId, true);
|
||||
})();
|
||||
|
||||
next(false);
|
||||
}
|
||||
},
|
||||
|
||||
//TEST TEST TEST TEST TEST
|
||||
|
||||
{
|
||||
//NEW TEST GZ DATA TABLE
|
||||
path: "/widgets",
|
||||
|
||||
Reference in New Issue
Block a user