salix-front/src/router/modules/route.js

341 lines
10 KiB
JavaScript

import { RouterView } from 'vue-router';
const routeCard = {
name: 'RouteCard',
path: ':id',
component: () => import('src/pages/Route/Card/RouteCard.vue'),
redirect: { name: 'RouteSummary' },
meta: {
menu: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
},
children: [
{
name: 'RouteBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Card/RouteForm.vue'),
},
{
name: 'RouteSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'open_in_new',
},
component: () => import('pages/Route/Card/RouteSummary.vue'),
},
{
path: 'tickets',
name: 'RouteTickets',
meta: {
title: 'tickets',
icon: 'vn:ticket',
},
component: () => import('src/pages/Route/RouteTickets.vue'),
},
{
path: 'log',
name: 'RouteLog',
meta: {
title: 'log',
icon: 'vn:History',
},
component: () => import('src/pages/Route/RouteLog.vue'),
},
],
};
const agencyCard = {
path: ':id',
name: 'AgencyCard',
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
redirect: { name: 'AgencySummary' },
meta: {
menu: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
},
children: [
{
name: 'AgencySummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'view_list',
},
component: () => import('src/pages/Route/Agency/Card/AgencySummary.vue'),
},
{
name: 'AgencyBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Agency/Card/AgencyBasicData.vue'),
},
{
path: 'workCenter',
name: 'AgencyWorkCenterCard',
redirect: { name: 'AgencyWorkCenters' },
children: [
{
path: '',
name: 'AgencyWorkCenters',
meta: {
icon: 'apartment',
title: 'workCenters',
},
component: () =>
import('src/pages/Route/Agency/Card/AgencyWorkcenter.vue'),
},
],
},
{
path: 'modes',
name: 'AgencyModesCard',
redirect: { name: 'AgencyModes' },
children: [
{
path: '',
name: 'AgencyModes',
meta: {
icon: 'format_list_bulleted',
title: 'modes',
},
component: () =>
import('src/pages/Route/Agency/Card/AgencyModes.vue'),
},
],
},
{
name: 'AgencyLog',
path: 'log',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
},
],
};
const roadmapCard = {
path: ':id',
name: 'RoadmapCard',
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
redirect: { name: 'RoadmapSummary' },
meta: {
menu: ['RoadmapBasicData', 'RoadmapStops'],
},
children: [
{
name: 'RoadmapSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'open_in_new',
},
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
},
{
name: 'RoadmapBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
},
{
name: 'RoadmapStops',
path: 'stops',
meta: {
title: 'stops',
icon: 'vn:lines',
},
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
},
],
};
const vehicleCard = {
path: ':id',
name: 'VehicleCard',
component: () => import('src/pages/Route/Vehicle/Card/VehicleCard.vue'),
redirect: { name: 'VehicleSummary' },
meta: {
menu: ['VehicleBasicData'],
},
children: [
{
name: 'VehicleSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'view_list',
},
component: () => import('src/pages/Route/Vehicle/Card/VehicleSummary.vue'),
},
{
name: 'VehicleBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('src/pages/Route/Vehicle/Card/VehicleBasicData.vue'),
},
],
};
export default {
name: 'Route',
path: '/route',
meta: {
title: 'routes',
icon: 'vn:delivery',
moduleName: 'Route',
menu: [
'RouteList',
'RouteExtendedList',
'RouteAutonomous',
'RouteRoadmap',
'CmrList',
'AgencyList',
'VehicleList',
],
},
component: RouterView,
redirect: { name: 'RouteMain' },
children: [
{
name: 'RouteMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'RouteIndexMain' },
children: [
{
path: '',
name: 'RouteIndexMain',
redirect: { name: 'RouteList' },
children: [
{
name: 'RouteList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Route/RouteList.vue'),
},
routeCard,
],
},
{
path: 'extended-list',
name: 'RouteExtendedList',
meta: {
title: 'RouteExtendedList',
icon: 'format_list_bulleted',
},
component: () => import('src/pages/Route/RouteExtendedList.vue'),
},
{
path: 'create',
name: 'RouteCreate',
meta: {
title: 'routeCreate',
icon: 'add',
},
component: () => import('src/pages/Route/Card/RouteForm.vue'),
},
{
path: 'agency-term',
name: 'RouteAutonomous',
meta: {
title: 'autonomous',
icon: 'vn:agency-term',
},
component: () => import('src/pages/Route/RouteAutonomous.vue'),
},
{
path: 'roadmap',
name: 'RouteRoadmap',
redirect: { name: 'RoadmapList' },
meta: {
title: 'RouteRoadmap',
icon: 'vn:troncales',
},
children: [
{
name: 'RoadmapList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Route/RouteRoadmap.vue'),
},
roadmapCard,
],
},
{
path: 'cmr',
name: 'CmrList',
meta: {
title: 'cmrsList',
icon: 'fact_check',
},
component: () => import('src/pages/Route/Cmr/CmrList.vue'),
},
{
path: 'agency',
name: 'RouteAgency',
redirect: { name: 'AgencyList' },
meta: {
title: 'agency',
icon: 'garage_home',
},
children: [
{
name: 'AgencyList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
component: () =>
import('src/pages/Route/Agency/AgencyList.vue'),
},
agencyCard,
],
},
{
path: 'vehicle',
name: 'RouteVehicle',
redirect: { name: 'VehicleList' },
meta: {
title: 'vehicle',
icon: 'directions_car',
},
children: [
{
path: 'list',
name: 'VehicleList',
meta: {
title: 'vehicleList',
icon: 'directions_car',
},
component: () =>
import('src/pages/Route/Vehicle/VehicleList.vue'),
},
vehicleCard,
],
},
],
},
],
};