2018-06-27 14:36:42 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import Router from 'vue-router';
|
|
|
|
import coreRoutes from 'frappejs/ui/routes';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2018-06-27 14:36:42 +00:00
|
|
|
import Report from 'frappejs/ui/pages/Report';
|
|
|
|
import reportViewConfig from '../../reports/view';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2018-06-27 14:36:42 +00:00
|
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
const routes = [].concat(coreRoutes, [
|
|
|
|
{
|
|
|
|
path: '/report/:reportName',
|
|
|
|
name: 'Report',
|
|
|
|
component: Report,
|
|
|
|
props: (route) => {
|
|
|
|
const { reportName } = route.params;
|
|
|
|
return {
|
|
|
|
reportName,
|
2018-07-14 14:30:42 +00:00
|
|
|
reportConfig: reportViewConfig[reportName] || null,
|
|
|
|
filters: route.query
|
2018-06-27 14:36:42 +00:00
|
|
|
};
|
2018-06-01 12:35:51 +00:00
|
|
|
}
|
2018-06-27 14:36:42 +00:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
export default new Router({ routes });
|