/*
 * @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',
  name: '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
          },
          redirect: '/departure',
          // redirect: "/departure/baggageView",
          children: [
            {
              path: '/departure',
              name: 'DepartureTerminalView',
              component: () => import('@/views/baggageManagement/components/departure'),
              meta: { title: '航站视图', keepAlive: true }
            },
            {
              path: '/departure/flightView',
              name: 'DepartureTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/departure/flightView',
                  name: 'DepartureFlightView',
                  component: () => import('@/views/baggageManagement/components/departure/flight'),
                  meta: { keepAlive: true }
                },
                {
                  path: '/departure/baggageView',
                  name: 'DepartureBaggageView',
                  component: () => import('@/views/baggageManagement/components/departure/baggage'),
                  meta: { title: '行李视图', keepAlive: false }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

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 },
          redirect: '/arrival',
          children: [
            {
              path: '/arrival',
              name: 'ArrivalTerminalView',
              component: () => import('@/views/baggageManagement/components/arrival'),
              meta: { keepAlive: true }
            },
            {
              path: '/arrival/flightView',
              name: 'ArrivalFlightTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/arrival/flightView',
                  name: 'ArrivalFlightView',
                  component: () => import('@/views/baggageManagement/components/arrival/flight'),
                  meta: { keepAlive: true }
                },
                {
                  path: '/arrival/baggageView',
                  name: 'ArrivalBaggageView',
                  component: () => import('@/views/baggageManagement/components/arrival/baggage'),
                  meta: { title: '行李视图', keepAlive: false }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

const transferRoutes = {
  path: '/transfer',
  component: Layout,
  meta: { roles: ['is_showTransit'],keepAlive: true },
  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 },
          redirect: '/transfer/arrival',
          children: [
            {
              path: '/transfer/arrival',
              name: 'TransferArrivalTerminalView',
              component: () => import('@/views/baggageManagement/components/transferArrival'),
              meta: { keepAlive: true }
            },
            {
              path: '/transfer/arrival/flightView',
              name: 'TransferArrivalTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/transfer/arrival/flightView',
                  name: 'TransferArrivalFlightView',
                  component: () => import('@/views/baggageManagement/components/transferArrival/flight'),
                  meta: { keepAlive: true }
                },
                {
                  path: '/transfer/arrival/baggageView',
                  name: 'TransferArrivalBaggageView',
                  component: () => import('@/views/baggageManagement/components/transferArrival/baggage'),
                  meta: { title: '行李视图', keepAlive: false }
                }
              ]
            }
          ]
        },
        {
          path: '/transfer/departure',
          name: 'TransferDepartureOne',
          component: () => import('@/views/baggageManagement'),
          meta: { title: '中转离港', roles: ['transit_departure_page'], keepAlive: true },
          redirect: '/transfer/departure',
          children: [
            {
              path: '/transfer/departure',
              name: 'TransferDepartureTerminalView',
              component: () => import('@/views/baggageManagement/components/transferDeparture'),
              meta: { keepAlive: true }
            },
            {
              path: '/transfer/departure/flightView',
              name: 'TransferDepartureTwo',
              component: () => import('@/views/baggageManagement'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/transfer/departure/flightView',
                  name: 'TransferDepartureFlightView',
                  component: () => import('@/views/baggageManagement/components/transferDeparture/flight'),
                  meta: { keepAlive: true }
                },
                {
                  path: '/transfer/departure/baggageView',
                  name: 'TransferDepartureBaggageView',
                  component: () => import('@/views/baggageManagement/components/transferDeparture/baggage'),
                  meta: { title: '行李视图', keepAlive: false }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

// 高级查询
const advanceRoutes = {
  path: '/',
  redirect: '/advance',
  component: Layout,
  children: [
    {
      path: '/advance',
      component: () => import('@/views/advancedQuery/index.vue'),
      meta: {
        title: '高级查询',
        icon: 'dataParser',
        imgstyle: 'ic_list_nav_search_default.png',
        imgstyleup: 'ic_list_nav_search_check.png'
      },
      children: [
        {
          path: '/',
          name: 'advanceHome',
          component: {
            render(c) {
              return c('router-view')
            }
          },
          redirect: '/',
          meta: { title: '高级查询', isPage: 'advance_page', keepAlive: true },
          children: [
            {
              path: '/',
              component: () => import('@/views/advancedQuery/views/advancedHome.vue'),
              meta: {
                title: '高级查询',
                keepAlive: true
              }
            },
            {
              path: 'flightView',
              name: 'advancedFlight',
              component: () => import('@/views/advancedQuery/views/advancedFlight.vue'),
              meta: { title: '航班视图', keepAlive: true }
            },
            {
              path: 'baggageView',
              name: 'advancedBag',
              component: () => import('@/views/advancedQuery/views/advancedBag.vue'),
              meta: { title: '行李视图', keepAlive: false }
            }
          ]
        }
      ]
    }
  ]
}

export default [departureRoutes, arrivalRoutes, transferRoutes, advanceRoutes]
