import Layout from '@/layout'
import KeepAliveRouterView from '@/components/KeepAliveRouterView'
// import { h, resolveComponent } from 'vue'

const ActualTimeRoutes = {
  path: '/realTime',
  component: Layout,
  name: 'RealTime',
  //using el svg icon, the elSvgIcon first when at the same time using elSvgIcon and icon
  meta: {
    title: '综合可视化',
    elSvgIcon: 'DataAnalysis',
    breadcrumb: false,
    roles: ['integrated_visualization_menu'],
  },
  children: [
    {
      path: '/realTime/departure',
      name: 'Departure',
      meta: {
        title: '国内出港',
        breadcrumb: false,
        roles: ['view_of_domestic_departure_termina_page'],
      },
      component: KeepAliveRouterView('Departure'),
      children: [
        {
          path: '/realTime/departure/airport',
          name: 'DepartureAirport',
          meta: { title: '国内出港航站视图' },
          component: KeepAliveRouterView('DepartureAirport'),
          children: [
            {
              path: '',
              name: 'DepartureAirportView',
              meta: { keepAlive: true },
              component: () =>
                import('@/views/realTime/departure/airport/index.vue'),
            },
            {
              path: '/realTime/departure/flight',
              name: 'DepartureFlight',
              meta: {
                title: '国内出港航班视图',
              },
              component: KeepAliveRouterView('DepartureFlight'),
              children: [
                {
                  path: '',
                  name: 'DepartureFlightView',
                  meta: { keepAlive: true },
                  component: () =>
                    import('@/views/realTime/departure/flight/index.vue'),
                },
                {
                  path: '/realTime/departure/waybill',
                  name: 'DepartureWaybill',
                  meta: {
                    title: '国内出港运单视图',
                  },
                  component: KeepAliveRouterView('DepartureWaybill'),
                  children: [
                    {
                      path: '',
                      name: 'DepartureWaybillView',
                      meta: { keepAlive: true },
                      component: () =>
                        import('@/views/realTime/departure/waybill/index.vue'),
                    },
                    {
                      path: '/realTime/departure/goods',
                      name: 'DepartureGoods',
                      meta: {
                        title: '国内出港货物视图',
                        keepAlive: true,
                      },
                      component: () =>
                        import('@/views/realTime/departure/goods/index.vue'),
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
    {
      path: '/realTime/arrival',
      name: 'Arrival',
      meta: {
        title: '国内进港',
        roles: ['view_of_domestic_inbound_termina_page'],
        breadcrumb: false,
      },
      component: KeepAliveRouterView('Arrival'),
      children: [
        {
          path: '/realTime/arrival/airport',
          name: 'ArrivalAirport',
          meta: { title: '国内进港航站视图' },
          component: KeepAliveRouterView('ArrivalAirport'),
          children: [
            {
              path: '',
              name: 'ArrivalAirportView',
              meta: { keepAlive: true },
              component: () =>
                import('@/views/realTime/arrival/airport/index.vue'),
            },
            {
              path: '/realTime/arrival/flight',
              name: 'ArrivalFlight',
              meta: {
                title: '国内进港航班视图',
              },
              component: KeepAliveRouterView('ArrivalFlight'),
              children: [
                {
                  path: '',
                  name: 'ArrivalFlightView',
                  meta: { keepAlive: true },
                  component: () =>
                    import('@/views/realTime/arrival/flight/index.vue'),
                },
                {
                  path: '/realTime/arrival/waybill',
                  name: 'ArrivalWaybill',
                  meta: {
                    title: '国内进港运单视图',
                  },
                  component: KeepAliveRouterView('ArrivalWaybill'),
                  children: [
                    {
                      path: '',
                      name: 'ArrivalWaybillView',
                      meta: { keepAlive: true },
                      component: () =>
                        import('@/views/realTime/arrival/waybill/index.vue'),
                    },
                    {
                      path: '/realTime/arrival/goods',
                      name: 'ArrivalGoods',
                      meta: {
                        title: '国内进港货物视图',
                        keepAlive: true,
                      },
                      component: () =>
                        import('@/views/realTime/arrival/goods/index.vue'),
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
    {
      path: '/realTime/internationalDeparture',
      name: 'InternationalDeparture',
      meta: {
        title: '国际出港',
        roles: ['view_of_international_departure_terminal_page'],
        breadcrumb: false,
      },
      component: KeepAliveRouterView('InternationalDeparture'),
      children: [
        {
          path: '/realTime/internationalDeparture/airport',
          name: 'InternationalDepartureAirport',
          meta: { title: '国际出港航站视图' },
          component: KeepAliveRouterView('InternationalDepartureAirport'),
          children: [
            {
              path: '',
              name: 'InternationalDepartureAirportView',
              meta: { keepAlive: true },
              component: () =>
                import(
                  '@/views/realTime/internationalDeparture/airport/index.vue'
                ),
            },
            {
              path: '/realTime/internationalDeparture/flight',
              name: 'InternationalDepartureFlight',
              meta: {
                title: '国际出港航班视图',
              },
              component: KeepAliveRouterView('InternationalDepartureFlight'),
              children: [
                {
                  path: '',
                  name: 'InternationalDepartureFlightView',
                  meta: { keepAlive: true },
                  component: () =>
                    import(
                      '@/views/realTime/internationalDeparture/flight/index.vue'
                    ),
                },
                {
                  path: '/realTime/internationalDeparture/waybill',
                  name: 'InternationalDepartureWaybill',
                  meta: {
                    title: '国际出港运单视图',
                  },
                  component: KeepAliveRouterView(
                    'InternationalDepartureWaybill'
                  ),
                  children: [
                    {
                      path: '',
                      name: 'InternationalDepartureWaybillView',
                      meta: { keepAlive: true },
                      component: () =>
                        import(
                          '@/views/realTime/internationalDeparture/waybill/index.vue'
                        ),
                    },
                    {
                      path: '/realTime/internationalDeparture/goods',
                      name: 'InternationalDepartureGoods',
                      meta: {
                        title: '国际出港货物视图',
                        keepAlive: true,
                      },
                      component: () =>
                        import(
                          '@/views/realTime/internationalDeparture/goods/index.vue'
                        ),
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
    {
      path: '/realTime/internationalArrival',
      name: 'InternationalArrival',
      meta: {
        title: '国际进港',
        roles: ['view_of_international_inbound_terminal_page'],
        breadcrumb: false,
      },
      component: KeepAliveRouterView('InternationalArrival'),
      children: [
        {
          path: '/realTime/internationalArrival/airport',
          name: 'InternationalArrivalAirport',
          meta: { title: '国际进港航站视图' },
          component: KeepAliveRouterView('InternationalArrivalAirport'),
          children: [
            {
              path: '',
              name: 'InternationalArrivalAirportView',
              meta: { keepAlive: true },
              component: () =>
                import(
                  '@/views/realTime/internationalArrival/airport/index.vue'
                ),
            },
            {
              path: '/realTime/internationalArrival/flight',
              name: 'InternationalArrivalFlight',
              meta: {
                title: '国际进港航班视图',
              },
              component: KeepAliveRouterView('InternationalArrivalFlight'),
              children: [
                {
                  path: '',
                  name: 'InternationalArrivalFlightView',
                  meta: { keepAlive: true },
                  component: () =>
                    import(
                      '@/views/realTime/internationalArrival/flight/index.vue'
                    ),
                },
                {
                  path: '/realTime/internationalArrival/waybill',
                  name: 'InternationalArrivalWaybill',
                  meta: {
                    title: '国际进港运单视图',
                  },
                  component: KeepAliveRouterView('InternationalArrivalWaybill'),
                  children: [
                    {
                      path: '',
                      name: 'InternationalArrivalWaybillView',
                      meta: { keepAlive: true },
                      component: () =>
                        import(
                          '@/views/realTime/internationalArrival/waybill/index.vue'
                        ),
                    },
                    {
                      path: '/realTime/internationalArrival/goods',
                      name: 'InternationalArrivalGoods',
                      meta: {
                        title: '国际进港货物视图',
                        keepAlive: true,
                      },
                      component: () =>
                        import(
                          '@/views/realTime/internationalArrival/goods/index.vue'
                        ),
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
    // {
    //   path: '/realTime/trackMap',
    //   name: 'TrackMap',
    //   meta: { title: '轨迹地图', roles: ['track_map_page'] },
    //   component: () => import('@/views/realTime/trackMap/index.vue'),
    // },
  ],
}

export default [ActualTimeRoutes]
