This commit is contained in:
2021-12-28 19:01:28 +00:00
parent b6e4878269
commit 9085b6e88d
6 changed files with 114 additions and 100 deletions

View File

@@ -71,6 +71,12 @@ export default new Router({
component: () =>
import(/* webpackChunkName: "ay-common" */ "./views/ay-open.vue")
},
{
path: "/viewreport/:oid/:rid",
name: "ay-report-view",
component: () =>
import(/* webpackChunkName: "ay-common" */ "./views/ay-report-view.vue")
},
{
path: "/about",
name: "ay-about",
@@ -1064,27 +1070,27 @@ export default new Router({
},
//############################## SPECIAL ROUTES ###############################
{
//REPORT VIEW FROM URL
path: "/viewreport",
beforeEnter: async (to, from, next) => {
//open report links have a query string /viewreport?oid=[objectid]&rid=[reportid]
const objectId = parseInt(to.query.oid);
const reportId = parseInt(to.query.rid);
// {
// //REPORT VIEW FROM URL
// path: "/viewreport",
// beforeEnter: async (to, from, next) => {
// //open report links have a query string /viewreport?oid=[objectid]&rid=[reportid]
// const objectId = parseInt(to.query.oid);
// const reportId = parseInt(to.query.rid);
const res = await window.$gz.api.renderReport(objectId, reportId, true);
if (res.error) {
//log the error and do a popup for it
const msg = `/viewReport, query ${JSON.stringify(
to.query
)}, server error: ${JSON.stringify(res.error)}`;
window.$gz.eventBus.$emit("notify-error", msg);
next("/applog");
}
// const res = await window.$gz.api.renderReport(objectId, reportId, true);
// if (res.error) {
// //log the error and do a popup for it
// const msg = `/viewReport, query ${JSON.stringify(
// to.query
// )}, server error: ${JSON.stringify(res.error)}`;
// window.$gz.eventBus.$emit("notify-error", msg);
// next("/applog");
// }
next(false);
}
},
// next(false);
// }
// },
{
path: "/ay-evaluate",