/*
 * @Author: zk
 * @Date: 2022-01-17 10:40:48
 * @LastEditTime: 2022-05-18 09:38:55
 * @LastEditors: your name
 * @Description: 离港路由
 */
import Layout from '@/layout'

const departureRoutes = {
  path: '/departure',
  component: Layout,
  meta: { roles: ['departure_menu'] },
  children: [
    {
      path: '/departure',
      component: () => import('@/views/baggageManagement'),
      meta: {
        title: '离港管理',
        imgstyle: 'ic_list_nav_leave_default.png',
        imgstyleup: 'ic_list_nav_leave_check.png'
      },
      children: [
        {
          path: '/departure',
          name: 'DepartureOne',
          component: () => import('@/views/baggageManagement'),
          meta: {
            title: '离港视图',
            // title: "行李视图",
            roles: ['departure_page'],
            keepAlive: true,
            deepth: 1
          },
          redirect: '/departure',
          // redirect: "/departure/baggageView",
          children: [
            // {
            //   path: "/departure/baggageView",
            //   name: "DepartureBaggageView",
            //   component: () =>
            //     import(
            //       "@/views/baggageManagement/components/departure/baggage"
            //     ),
            //   meta: { keepAlive: true, deepth: 2 },
            // },
            {
              path: '/departure',
              name: 'DepartureTerminalView',
              component: () => import('@/views/baggageManagement/components/departure'),
              meta: { keepAlive: true, deepth: 2 }
            },
            {
              path: '/departure/flightView',
              name: 'DepartureTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true, deepth: 2 },
              children: [
                {
                  path: '/departure/flightView',
                  name: 'DepartureFlightView',
                  component: () => import('@/views/baggageManagement/components/departure/flight'),
                  meta: { keepAlive: true, deepth: 3 }
                },
                {
                  path: '/departure/baggageView',
                  name: 'DepartureBaggageView',
                  component: () => import('@/views/baggageManagement/components/departure/baggage'),
                  meta: { title: '行李视图', keepAlive: true, deepth: 4 }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

const arrivalRoutes = {
  path: '/arrival',
  component: Layout,
  meta: { roles: ['inbound_management'] },
  children: [
    {
      path: '/arrival',
      component: () => import('@/views/baggageManagement'),
      meta: {
        title: '进港管理',
        imgstyle: 'ic_list_nav_arrive_default.png',
        imgstyleup: 'ic_list_nav_arrive_check.png'
      },
      children: [
        {
          path: '/arrival',
          name: 'ArrivalOne',
          component: () => import('@/views/baggageManagement'),
          meta: { title: '进港视图', roles: ['departure_page'], keepAlive: true, deepth: 1 },
          redirect: '/arrival',
          children: [
            {
              path: '/arrival',
              name: 'ArrivalTerminalView',
              component: () => import('@/views/baggageManagement/components/arrival'),
              meta: { keepAlive: true, deepth: 2 }
            },
            {
              path: '/arrival/flightView',
              name: 'ArrivalFlightTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true, deepth: 2 },
              children: [
                {
                  path: '/arrival/flightView',
                  name: 'ArrivalFlightView',
                  component: () => import('@/views/baggageManagement/components/arrival/flight'),
                  meta: { keepAlive: true, deepth: 3 }
                },
                {
                  path: '/arrival/baggageView',
                  name: 'ArrivalBaggageView',
                  component: () => import('@/views/baggageManagement/components/arrival/baggage'),
                  meta: { title: '行李视图', deepth: 4 }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

const transferRoutes = {
  path: '/transfer',
  component: Layout,
  meta: { roles: ['is_showTransit'] },
  children: [
    {
      path: '/transfer',
      component: () => import('@/views/baggageManagement'),
      meta: {
        title: '中转管理',
        imgstyle: 'ic_list_nav_transit_default.png',
        imgstyleup: 'ic_list_nav_transit_check.png'
      },
      redirect: '/transfer/arrival',
      children: [
        {
          path: '/transfer/arrival',
          name: 'TransferArrivalOne',
          component: () => import('@/views/baggageManagement'),
          meta: { title: '中转进港', roles: ['transit_inbound_page'], keepAlive: true, deepth: 1 },
          redirect: '/transfer/arrival',
          children: [
            {
              path: '/transfer/arrival',
              name: 'TransferArrivalTerminalView',
              component: () => import('@/views/baggageManagement/components/transferArrival'),
              meta: { keepAlive: true, deepth: 2 }
            },
            {
              path: '/transfer/arrival/flightView',
              name: 'TransferArrivalTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true, deepth: 2 },
              children: [
                {
                  path: '/transfer/arrival/flightView',
                  name: 'TransferArrivalFlightView',
                  component: () => import('@/views/baggageManagement/components/transferArrival/flight'),
                  meta: { keepAlive: true, deepth: 3 }
                },
                {
                  path: '/transfer/arrival/baggageView',
                  name: 'TransferArrivalBaggageView',
                  component: () => import('@/views/baggageManagement/components/transferArrival/baggage'),
                  meta: { title: '行李视图', keepAlive: true, deepth: 4 }
                }
              ]
            }
          ]
        },
        {
          path: '/transfer/departure',
          name: 'TransferDepartureOne',
          component: () => import('@/views/baggageManagement'),
          meta: { title: '中转离港', roles: ['transit_departure_page'], keepAlive: true, deepth: 1 },
          redirect: '/transfer/departure',
          children: [
            {
              path: '/transfer/departure',
              name: 'TransferDepartureTerminalView',
              component: () => import('@/views/baggageManagement/components/transferDeparture'),
              meta: { keepAlive: true, deepth: 2 }
            },
            {
              path: '/transfer/departure/flightView',
              name: 'TransferDepartureTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true, deepth: 2 },
              children: [
                {
                  path: '/transfer/departure/flightView',
                  name: 'TransferDepartureFlightView',
                  component: () => import('@/views/baggageManagement/components/transferDeparture/flight'),
                  meta: { keepAlive: true, deepth: 3 }
                },
                {
                  path: '/transfer/departure/baggageView',
                  name: 'TransferDepartureBaggageView',
                  component: () => import('@/views/baggageManagement/components/transferDeparture/baggage'),
                  meta: { title: '行李视图', keepAlive: true, deepth: 4 }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

export default [departureRoutes, arrivalRoutes, transferRoutes]
