| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Layout from '@/layout'
- import SiteRouter from './SiteRouter'
- import ChargeRouter from './ChargeRouter'
- import UserRouter from './UserRouter'
- import ProviderRouter from './ProviderRouter'
- import Transactions from './Transactions'
- import ChargingProfile from './ChargingProfile'
- import OCPPRouter from './OCPPRouter'
- import driver from './driver'
- import fleetCompanyRoute from './fleetCompany'
- import CreditLimit from './CreditLimit'
- import FinancialRouter from './FinancialRouter'
- import PosRouter from './PosRouter'
- import RfidRouter from './RfidRouter'
- Vue.use(VueRouter)
- const constantRoutes = [
- {
- path: '/',
- redirect: '/dashboard'
- },
- {
- path: '/redirect',
- component: Layout,
- hidden: true,
- children: [
- {
- path: '/redirect/:path*',
- component: () => import('@/views/redirect/index'),
- }
- ]
- },
- {
- path: '/login',
- component: () => import('@/views/login/index'),
- meta: {
- title: 'Login'
- },
- hidden: true
- },
- {
- path: '/administrator',
- component: Layout,
- meta: {
- title: 'Administrator',
- subTitle: 'Settings',
- icon: 'administrator',
- activeIcon: 'administrator-active',
- affix: true
- },
- children: [
- {
- path: '/administrator',
- component: () => import('@/views/Administrator'),
- name: 'administrator',
- meta: {
- title: 'Administrator',
- subTitle: 'Settings',
- icon: 'administrator',
- breadcrumb: false,
- }
- }
- ],
- },
- {
- path: '/dashboard',
- component: Layout,
- meta: {
- title: 'Dashboard',
- icon: 'dashboard',
- activeIcon: 'dashboard-active',
- affix: true
- },
- children: [
- {
- path: '/dashboard',
- component: () => import('@/views/dashboard/Dashboard'),
- name: 'dashboard',
- meta: {
- title: 'Dashboard',
- icon: 'dashboard',
- breadcrumb: false
- }
- },
- {
- path: '/maps',
- component: () => import('@/views/dashboard/Maps'),
- name: 'maps',
- meta: {
- title: 'Maps',
- icon: 'dashboard',
- },
- hidden: true
- }
- ],
- },
- SiteRouter,
- ChargeRouter,
- Transactions,
- {
- path: '/error-table',
- component: Layout,
- meta: {
- title: 'Error Table',
- icon: 'error-table',
- activeIcon: 'error-table-active',
- affix: true
- },
- children: [
- {
- path: '/error-table',
- component: () => import('@/views/transaction/error_table'),
- name: 'error-table',
- meta: {
- title: 'Error Table',
- icon: 'error-table',
- breadcrumb: false
- }
- }
- ]
- },
- ChargingProfile,
- FinancialRouter,
- UserRouter,
- //driver,
- {
- path: '/feedback-management',
- component: Layout,
- meta: {
- title: 'Feedback Management',
- icon: 'feedback-management',
- activeIcon: 'feedback-management-active',
- affix: true
- },
- children: [
- {
- path: '/feedback-management',
- component: () => import('@/views/feedback/FeedbackManagement'),
- name: 'feedback-management',
- meta: {
- title: 'Feedback Management',
- breadcrumb: false
- }
- },
- {
- path: '/feedback-management/view/:id',
- component: () => import('@/views/feedback/Detail'),
- name: 'feedback-view',
- meta: {
- title: 'View Feedback',
- activeMenu: '/feedback-management'
- }
- }
- ],
- },
- OCPPRouter,
- {
- path: '/reports',
- component: Layout,
- children: [
- {
- path: '/reports/index',
- component: () => import('@/views/Reports'),
- name: 'reports',
- meta: {
- title: 'Reports',
- icon: 'reports',
- activeIcon: 'reports-active',
- }
- }
- ],
- },
- {
- path: '/notification',
- component: Layout,
- meta: {
- title: 'Notification Management',
- icon: 'notification',
- activeIcon: 'notification-active',
- affix: true
- },
- children: [
- {
- path: '/notification',
- component: () => import('@/views/notification/index'),
- name: 'notification',
- meta: {
- title: 'Notification Management',
- icon: 'notification',
- activeIcon: 'notification-active',
- breadcrumb: false
- }
- },
- {
- path: '/notification/add',
- component: () => import('@/views/notification/add'),
- name: 'notification-add',
- meta: {
- title: 'Add Notification',
- activeMenu: '/notification',
- icon: 'notification',
- activeIcon: 'notification-active'
- }
- },
- {
- path: '/notification/:id',
- component: () => import('@/views/notification/add'),
- name: 'notification-add',
- meta: {
- title: 'View Notification',
- activeMenu: '/notification'
- }
- }
- ],
- },
- ProviderRouter,
- fleetCompanyRoute,
- CreditLimit,
- PosRouter,
- RfidRouter
- /*OCPI*/
- ]
- const asyncRoutes = []
- export {
- constantRoutes,
- asyncRoutes,
- }
- const createRouter = () => new VueRouter({
- // mode: 'history', // require service support
- scrollBehavior: () => ({
- y: 0
- }),
- routes: constantRoutes
- })
- const router = createRouter()
- // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
- export function resetRouter() {
- const newRouter = createRouter()
- router.matcher = newRouter.matcher // reset router
- }
- export default router
|