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
|
|
|
|
2019-10-13 12:03:01 +00:00
|
|
|
import ListView from '@/pages/ListView/ListView';
|
|
|
|
import Dashboard from '@/pages/Dashboard';
|
|
|
|
import FormView from '@/pages/FormView/FormView';
|
|
|
|
import PrintView from '@/pages/PrintView';
|
|
|
|
import QuickEditForm from '@/pages/QuickEditForm';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2019-10-13 21:56:20 +00:00
|
|
|
import Report from '@/pages/Report.vue';
|
2018-06-01 12:35:51 +00:00
|
|
|
|
2019-10-13 12:03:01 +00:00
|
|
|
import DataImport from '@/pages/DataImport';
|
2018-10-10 10:32:56 +00:00
|
|
|
|
2019-10-13 12:03:01 +00:00
|
|
|
import ReportList from '@/pages/ReportList';
|
|
|
|
import ChartOfAccounts from '@/pages/ChartOfAccounts';
|
2018-10-23 12:43:36 +00:00
|
|
|
|
2019-10-11 09:55:50 +00:00
|
|
|
import InvoiceForm from '@/pages/InvoiceForm';
|
2019-11-19 19:10:01 +00:00
|
|
|
import JournalEntryForm from '@/pages/JournalEntryForm';
|
2019-10-11 09:55:50 +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 = [
|
2019-07-25 09:50:48 +00:00
|
|
|
{
|
|
|
|
path: '/',
|
2019-08-01 11:52:58 +00:00
|
|
|
component: Dashboard
|
2019-07-25 09:50:48 +00:00
|
|
|
},
|
2019-11-19 19:10:01 +00:00
|
|
|
{
|
|
|
|
path: '/edit/JournalEntry/:name',
|
|
|
|
name: 'JournalEntryForm',
|
|
|
|
components: {
|
|
|
|
default: JournalEntryForm,
|
|
|
|
edit: QuickEditForm
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
default: true,
|
|
|
|
edit: route => route.query
|
|
|
|
}
|
|
|
|
},
|
2018-06-27 14:36:42 +00:00
|
|
|
{
|
2019-10-13 21:56:20 +00:00
|
|
|
path: '/edit/:doctype/:name',
|
2019-10-11 09:55:50 +00:00
|
|
|
name: 'InvoiceForm',
|
|
|
|
components: {
|
|
|
|
default: InvoiceForm,
|
|
|
|
edit: QuickEditForm
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
default: true,
|
|
|
|
edit: route => route.query
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/list/:doctype',
|
2018-10-10 18:51:03 +00:00
|
|
|
name: 'ListView',
|
2019-10-11 09:55:50 +00:00
|
|
|
components: {
|
|
|
|
default: ListView,
|
|
|
|
edit: QuickEditForm
|
2019-10-04 20:18:10 +00:00
|
|
|
},
|
2019-10-11 09:55:50 +00:00
|
|
|
props: {
|
|
|
|
default: route => {
|
|
|
|
const { doctype } = route.params;
|
|
|
|
return {
|
|
|
|
doctype,
|
|
|
|
filters: route.query.filters
|
|
|
|
};
|
|
|
|
},
|
|
|
|
edit: route => route.query
|
|
|
|
}
|
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,
|
2019-10-13 21:56:20 +00:00
|
|
|
props: true
|
2018-10-10 10:32:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/data-import',
|
|
|
|
name: 'Data Import',
|
|
|
|
component: DataImport
|
2018-10-22 21:29:07 +00:00
|
|
|
},
|
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
|
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
|
|
|
path: '/chartOfAccounts',
|
|
|
|
name: 'Chart Of Accounts',
|
2019-10-13 21:18:18 +00:00
|
|
|
components: {
|
|
|
|
default: ChartOfAccounts,
|
|
|
|
edit: QuickEditForm
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
default: true,
|
|
|
|
edit: route => route.query
|
|
|
|
}
|
2019-07-18 10:45:44 +00:00
|
|
|
}
|
2018-10-10 18:51:03 +00:00
|
|
|
];
|
2018-06-27 14:36:42 +00:00
|
|
|
|
2019-10-03 13:46:12 +00:00
|
|
|
let router = new Router({ routes });
|
|
|
|
|
2019-10-26 14:46:04 +00:00
|
|
|
if (process.env.NODE_ENV === 'development') {
|
2019-11-19 19:10:01 +00:00
|
|
|
window.router = router;
|
2019-10-26 14:46:04 +00:00
|
|
|
}
|
|
|
|
|
2019-10-03 13:46:12 +00:00
|
|
|
export default router;
|