2018-06-27 14:36:42 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import Router from 'vue-router';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2018-10-10 18:51:03 +00:00
|
|
|
import ListView from '../pages/ListView';
|
2018-10-23 12:43:36 +00:00
|
|
|
import FormView from '../pages/FormView/FormView';
|
2018-10-15 12:05:01 +00:00
|
|
|
import PrintView from '../pages/PrintView';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2019-02-17 17:46:50 +00:00
|
|
|
import Report from 'frappejs/ui/pages/Report';
|
2018-06-27 14:36:42 +00:00
|
|
|
import reportViewConfig from '../../reports/view';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2018-10-10 10:32:56 +00:00
|
|
|
import DataImport from '../pages/DataImport';
|
|
|
|
|
2018-10-22 21:29:07 +00:00
|
|
|
import Settings from '../pages/Settings/Settings';
|
|
|
|
|
2019-02-17 17:46:50 +00:00
|
|
|
import ReportList from '../pages/Report';
|
2018-10-23 12:43:36 +00:00
|
|
|
|
2018-10-23 17:28:26 +00:00
|
|
|
import Tree from 'frappejs/ui/components/Tree';
|
|
|
|
|
2018-06-27 14:36:42 +00:00
|
|
|
Vue.use(Router);
|
|
|
|
|
2018-10-10 18:51:03 +00:00
|
|
|
const routes = [
|
2018-06-27 14:36:42 +00:00
|
|
|
{
|
2018-10-22 20:32:37 +00:00
|
|
|
path: '/list/:listName',
|
2018-10-10 18:51:03 +00:00
|
|
|
name: 'ListView',
|
|
|
|
component: ListView,
|
|
|
|
props: true
|
2018-06-27 14:36:42 +00:00
|
|
|
},
|
|
|
|
{
|
2018-10-10 18:51:03 +00:00
|
|
|
path: '/edit/:doctype/:name',
|
|
|
|
name: 'FormView',
|
|
|
|
component: FormView,
|
|
|
|
props: true
|
2018-10-15 12:05:01 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/print/:doctype/:name',
|
|
|
|
name: 'PrintView',
|
|
|
|
component: PrintView,
|
|
|
|
props: true
|
2018-10-22 18:10:22 +00:00
|
|
|
},
|
2018-06-27 14:36:42 +00:00
|
|
|
{
|
|
|
|
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-10-10 10:32:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/data-import',
|
|
|
|
name: 'Data Import',
|
|
|
|
component: DataImport
|
2018-10-22 21:29:07 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/settings',
|
|
|
|
name: 'Settings',
|
|
|
|
component: Settings
|
2018-10-23 12:43:36 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/reportList',
|
|
|
|
name: 'Report',
|
|
|
|
component: ReportList
|
2018-10-23 17:28:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/tree/:doctype',
|
|
|
|
name: 'Tree',
|
|
|
|
component: Tree,
|
|
|
|
props: true
|
|
|
|
},
|
2018-10-10 18:51:03 +00:00
|
|
|
];
|
2018-06-27 14:36:42 +00:00
|
|
|
|
|
|
|
export default new Router({ routes });
|