import Layout from '@/layout'

const uploadRoutes = {
  path: '/upload',
  name: 'Upload',
  component: Layout,
  children: [
    {
      path: '/upload',
      meta: {
        title: '速运行李上传',
        imgstyle: 'ic_list_nav_upload_default.png',
        imgstyleup: 'ic_list_nav_upload_check.png',
      },
      component: {
        render(c) {
          return c('router-view')
        },
      },
      children: [
        {
          path: '/upload',
          name: 'UploadView',
          component: () => import('@/views/upload/index.vue'),
        },
      ],
    },
  ],
}

const statisticsChartsRoutes = {
  path: '/statisticsCharts',
  name: 'StatisticsCharts',
  component: Layout,
  meta: {
    title: '统计图表',
  },
  children: [
    {
      path: '/statisticsCharts',
      redirect: 'airlineCompany',
      component: () => import('@/views/statisticsCharts'),
      meta: {
        title: '统计图表',
        imgstyle: 'ic_list_nav_arrive_default.png',
        imgstyleup: 'ic_list_nav_arrive_check.png',
      },
      children: [
        {
          path: 'airlineCompany',
          redirect: 'airlineCompany/flight',
          name: 'AirlineCompanyStatistics',
          hidden: true,
          component: {
            render(h) {
              return h('router-view')
            },
          },
          children: [
            {
              path: 'flight',
              name: 'FlightStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/flightStatisticsCharts'
                ),
              meta: {
                title: '航班量统计',
                roles: ['flight_volume_statistics'],
              },
            },
            {
              path: 'baggage',
              name: 'BaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/baggageStatisticsCharts'
                ),
              meta: { title: '行李量统计', roles: ['baggage_statistics'] },
            },
            {
              path: 'specialBaggage',
              name: 'SpecialBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/specialBaggageStatisticsCharts'
                ),
              meta: { title: '特殊行李量统计' },
            },
            {
              path: 'baggagePassenger',
              name: 'BaggagePassengerStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/baggagePassengerStatisticsCharts'
                ),
              meta: { title: '行李旅客量统计' },
            },
            {
              path: 'baggageAverage',
              name: 'BaggageAverageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/baggageAverageStatisticsCharts'
                ),
              meta: { title: '平均行李量统计' },
            },
            {
              path: 'abnormalBaggage',
              name: 'AbnormalBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/abnormalBaggageStatisticsCharts'
                ),
              meta: { title: '异常行李量统计' },
            },
            {
              path: 'complaintBaggage',
              name: 'ComplaintBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/complaintBaggageStatisticsCharts'
                ),
              meta: { title: '投诉行李量统计' },
            },
            {
              path: 'compensationBaggage',
              name: 'CompensationBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/compensationBaggageStatisticsCharts'
                ),
              meta: { title: '赔偿行李量统计' },
            },
            {
              path: 'compensation',
              name: 'CompensationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/airlineCompany/compensationStatisticsCharts'
                ),
              meta: { title: '赔偿金额统计' },
            },
          ],
        },
        {
          path: 'passengerClassification',
          redirect: 'passengerClassification/baggagePassenger',
          name: 'PassengerStatistics',
          hidden: true,
          component: {
            render(h) {
              return h('router-view')
            },
          },
          children: [
            {
              path: 'baggagePassenger',
              name: 'PassengerStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/baggagePassengerStatisticsCharts'
                ),
              meta: { title: '行李旅客量统计' },
            },
            {
              path: 'baggage',
              name: 'PassengerBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/baggageStatisticsCharts'
                ),
              meta: { title: '行李量统计' },
            },
            {
              path: 'specialBaggage',
              name: 'PassengerSpecialBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/specialBaggageStatisticsCharts'
                ),
              meta: { title: '特殊行李量统计' },
            },
            {
              path: 'abnormalBaggage',
              name: 'PassengerAbnormalBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/abnormalBaggageStatisticsCharts'
                ),
              meta: { title: '异常行李量统计' },
            },
            {
              path: 'complaintBaggage',
              name: 'PassengerComplaintBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/complaintBaggageStatisticsCharts'
                ),
              meta: { title: '投诉行李量统计' },
            },
            {
              path: 'compensationBaggage',
              name: 'PassengerCompensationBaggageStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/compensationBaggageStatisticsCharts'
                ),
              meta: { title: '赔偿行李量统计' },
            },
            {
              path: 'compensation',
              name: 'PassengerCompensationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/passengerClassification/compensationStatisticsCharts'
                ),
              meta: { title: '赔偿金额统计' },
            },
          ],
        },
        {
          path: 'flightClassification',
          redirect: 'flightClassification/flight',
          name: 'FlightClassificationStatistics',
          hidden: true,
          component: {
            render(h) {
              return h('router-view')
            },
          },
          children: [
            {
              path: 'flight',
              name: 'FlightClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/flightClassification/flightClassificationStatisticsCharts'
                ),
              meta: { title: '航班量统计' },
            },
            {
              path: 'baggage',
              name: 'FlightBaggageClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/flightClassification/baggageClassificationStatisticsCharts'
                ),
              meta: { title: '行李量统计' },
            },
            {
              path: 'passenger',
              name: 'FlightPassengerClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/flightClassification/passengerClassificationStatisticsCharts'
                ),
              meta: { title: '行李旅客量统计' },
            },
          ],
        },
        {
          path: 'node',
          name: 'NodeStatisticsCharts',
          hidden: true,
          component: () =>
            import('@/views/statisticsCharts/views/nodeStatisticsCharts'),
          meta: {
            title: '扫描节点与位置分析',
            roles: ['scanning_node_and_location_analysis'],
          },
        },
        {
          path: 'report',
          redirect: 'report/reportStatistics',
          name: 'Report',
          hidden: true,
          component: {
            render(h) {
              return h('router-view')
            },
          },
          children: [
            {
              path: 'reportStatistics',
              name: 'ReportStatistics',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/report/reportStatistics'
                ),
              meta: {
                title: '运送效率报表统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'transitTables',
              name: 'TransitTables',
              hidden: true,
              component: () =>
                import('@/views/statisticsCharts/views/report/transitTables'),
              meta: {
                title: '中转四个流向统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'transferDirectionTable',
              name: 'TransferDirectionTable',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/report/transferDirectionTable'
                ),
              meta: {
                title: '中转流向明细统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'transferBaggageTable',
              name: 'TransferBaggageTable',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/report/transferBaggageTable'
                ),
              meta: {
                title: '中转行李因素分析统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'baggageProportionTable',
              name: 'BaggageProportionTable',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/report/baggageProportionTable'
                ),
              meta: {
                title: '中转行李比例明细统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'scanningStatistics',
              name: 'ScanningStatistics',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/report/scanningStatistics'
                ),
              meta: {
                title: '航站BRS扫描统计',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'scanDataTable',
              name: 'scanDataTable',
              hidden: true,
              component: () =>
                import('@/views/statisticsCharts/views/report/scanDataTable'),
              meta: {
                title: 'Mannual Load扫描数据统计表',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
            {
              path: 'rfldTable',
              name: 'rfldTable',
              hidden: true,
              component: () =>
                import('@/views/statisticsCharts/views/report/rfldTable'),
              meta: {
                title: '航易行RFID扫描数据统计表',
                roles: ['scanning_node_and_location_analysis'],
              },
            },
          ],
        },
        {
          path: 'specialClassification',
          redirect: 'specialClassification/special',
          name: 'SpecialStatistics',
          hidden: true,
          component: {
            render(h) {
              return h('router-view')
            },
          },
          children: [
            {
              path: 'special',
              name: 'SpecialBaggageClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/special/specialBaggageClassificationStatisticsCharts'
                ),
              meta: { title: '特殊行李分类统计' },
            },
            {
              path: 'abnormal',
              name: 'AbnormalBaggageClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/special/abnormalBaggageClassificationStatisticsCharts'
                ),
              meta: { title: '异常行李分类统计' },
            },
            {
              path: 'compensationBaggage',
              name: 'CompensationBaggageClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/special/compensationBaggageClassificationStatisticsCharts'
                ),
              meta: { title: '赔偿行李分类统计' },
            },
            {
              path: 'compensation',
              name: 'CompensationClassificationStatisticsCharts',
              hidden: true,
              component: () =>
                import(
                  '@/views/statisticsCharts/views/special/compensationClassificationStatisticsCharts'
                ),
              meta: { title: '赔偿金额分类统计' },
            },
          ],
        },
        {
          path: 'statisticalAnalysis',
          name: 'statisticalAnalysisContent',
          meta: { title: '统计分析' },
          component: () => import('@/views/statisticalAnalysis/components'),
        },
      ],
    },
  ],
}

const departureRoutes = {
  path: '/departure',
  name: 'Departure',
  component: Layout,
  children: [
    {
      path: '/departure',
      component: () => import('@/views/baggageManagementTemp'),
      meta: {
        title: '离港管理',
        imgstyle: 'ic_list_nav_leave_default.png',
        imgstyleup: 'ic_list_nav_leave_check.png',
      },
      children: [
        {
          path: '/departure',
          name: 'DepartureNav',
          component: () => import('@/views/baggageManagementTemp'),
          meta: {
            title: '离港视图',
            // title: "行李视图",
            roles: ['departure_page'],
            keepAlive: true,
          },
          children: [
            {
              path: '/departure',
              name: 'DepartureTerminalView',
              component: () =>
                import('@/views/baggageManagementTemp/components/departure'),
              meta: { keepAlive: true },
            },
            {
              path: '/departure/flightView',
              name: 'DepartureFlightNav',
              component: () => import('@/views/baggageManagementTemp'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/departure/flightView',
                  name: 'DepartureFlightView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/departure/flight'
                    ),
                  meta: { keepAlive: true },
                },
                {
                  path: '/departure/baggageView',
                  name: 'DepartureBaggageView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/departure/baggage'
                    ),
                  meta: { title: '行李视图', keepAlive: true },
                },
                {
                  path: '/departure/containerView',
                  name: 'DepartureContainerNav',
                  component: () => import('@/views/baggageManagementTemp'),
                  meta: { title: '容器视图', keepAlive: true },
                  children: [
                    {
                      path: '/departure/containerView',
                      name: 'DepartureContainerView',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/departure/container'
                        ),
                      meta: { keepAlive: true },
                    },
                    {
                      path: '/departure/containerHistory',
                      name: 'DepartureContainerHistory',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/departure/containerHistory'
                        ),
                      meta: { title: '历史记录', keepAlive: true },
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
  ],
}

const arrivalRoutes = {
  path: '/arrival',
  name: 'Arrival',
  component: Layout,
  children: [
    {
      path: '/arrival',
      component: () => import('@/views/baggageManagementTemp'),
      meta: {
        title: '进港管理',
        imgstyle: 'ic_list_nav_arrive_default.png',
        imgstyleup: 'ic_list_nav_arrive_check.png',
      },
      children: [
        {
          path: '/arrival',
          name: 'ArrivalNav',
          component: () => import('@/views/baggageManagementTemp'),
          meta: {
            title: '进港视图',
            roles: ['inbound_search_page'],
            keepAlive: true,
          },
          children: [
            {
              path: '/arrival',
              name: 'ArrivalTerminalView',
              component: () =>
                import('@/views/baggageManagementTemp/components/arrival'),
              meta: { keepAlive: true },
            },
            {
              path: '/arrival/flightView',
              name: 'ArrivalFlightNav',
              component: () => import('@/views/baggageManagementTemp'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/arrival/flightView',
                  name: 'ArrivalFlightView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/arrival/flight'
                    ),
                  meta: { keepAlive: true },
                },
                {
                  path: '/arrival/baggageView',
                  name: 'ArrivalBaggageView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/arrival/baggage'
                    ),
                  meta: { title: '行李视图', keepAlive: true },
                },
                {
                  path: '/arrival/containerView',
                  name: 'ArrivalContainerNav',
                  component: () => import('@/views/baggageManagementTemp'),
                  meta: { title: '容器视图', keepAlive: true },
                  children: [
                    {
                      path: '/arrival/containerView',
                      name: 'ArrivalContainerView',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/arrival/container'
                        ),
                      meta: { keepAlive: true },
                    },
                    {
                      path: '/arrival/containerHistory',
                      name: 'ArrivalContainerHistory',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/arrival/containerHistory'
                        ),
                      meta: { title: '容器历史', keepAlive: true },
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
  ],
}

const transferRoutes = {
  path: '/transfer',
  name: 'Transfer',
  component: Layout,
  children: [
    {
      path: '/transfer',
      component: () => import('@/views/baggageManagementTemp'),
      meta: {
        title: '中转管理',
        imgstyle: 'ic_list_nav_transit_default.png',
        imgstyleup: 'ic_list_nav_transit_check.png',
      },
      redirect: '/transfer/arrival',
      children: [
        {
          path: '/transfer/arrival',
          name: 'TransferArrivalNav',
          component: () => import('@/views/baggageManagementTemp'),
          meta: {
            title: '中转进港',
            roles: ['transit_inbound_page'],
            keepAlive: true,
          },
          children: [
            {
              path: '/transfer/arrival',
              name: 'TransferArrivalTerminalView',
              component: () =>
                import(
                  '@/views/baggageManagementTemp/components/transferArrival'
                ),
              meta: { keepAlive: true },
            },
            {
              path: '/transfer/arrival/flightView',
              name: 'TransferArrivalFlightNav',
              component: () => import('@/views/baggageManagementTemp'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/transfer/arrival/flightView',
                  name: 'TransferArrivalFlightView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/transferArrival/flight'
                    ),
                  meta: { keepAlive: true },
                },
                {
                  path: '/transfer/arrival/baggageView',
                  name: 'TransferArrivalBaggageView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/transferArrival/baggage'
                    ),
                  meta: { title: '行李视图', keepAlive: true },
                },
                {
                  path: '/transfer/arrival/containerView',
                  name: 'TransferArrivalContainerNav',
                  component: () => import('@/views/baggageManagementTemp'),
                  meta: { title: '容器视图', keepAlive: true },
                  children: [
                    {
                      path: '/transfer/arrival/containerView',
                      name: 'TransferArrivalContainerView',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/arrival/container'
                        ),
                      meta: { keepAlive: true },
                    },
                    {
                      path: '/transfer/arrival/containerHistory',
                      name: 'TransferArrivalContainerHistory',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/transferArrival/containerHistory'
                        ),
                      meta: { title: '容器历史', keepAlive: true },
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          path: '/transfer/departure',
          name: 'TransferDepartureNav',
          component: () => import('@/views/baggageManagementTemp'),
          meta: {
            title: '中转离港',
            roles: ['transit_departure_page'],
            keepAlive: true,
          },
          children: [
            {
              path: '/transfer/departure',
              name: 'TransferDepartureTerminalView',
              component: () =>
                import(
                  '@/views/baggageManagementTemp/components/transferDeparture'
                ),
              meta: { keepAlive: true },
            },
            {
              path: '/transfer/departure/flightView',
              name: 'TransferDepartureFlightNav',
              component: () => import('@/views/baggageManagementTemp'),
              meta: { title: '航班视图', keepAlive: true },
              children: [
                {
                  path: '/transfer/departure/flightView',
                  name: 'TransferDepartureFlightView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/transferDeparture/flight'
                    ),
                  meta: { keepAlive: true },
                },
                {
                  path: '/transfer/departure/baggageView',
                  name: 'TransferDepartureBaggageView',
                  component: () =>
                    import(
                      '@/views/baggageManagementTemp/components/transferDeparture/baggage'
                    ),
                  meta: { title: '行李视图', keepAlive: true },
                },
                {
                  path: '/transfer/departure/containerView',
                  name: 'TransferDepartureContainerNav',
                  component: () => import('@/views/baggageManagementTemp'),
                  meta: { title: '容器视图', keepAlive: true },
                  children: [
                    {
                      path: '/transfer/departure/containerView',
                      name: 'TransferDepartureContainerView',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/transferDeparture/container'
                        ),
                      meta: { keepAlive: true },
                    },
                    {
                      path: '/transfer/departure/containerHistory',
                      name: 'TransferDepartureContainerHistory',
                      component: () =>
                        import(
                          '@/views/baggageManagementTemp/components/transferDeparture/containerHistory'
                        ),
                      meta: { title: '容器历史', keepAlive: true },
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
  ],
}

// 高级查询
const advanceRoutes = {
  path: '/advance',
  name: 'Advance',
  component: Layout,
  children: [
    {
      path: '/advance',
      component: () => import('@/views/advancedQuery'),
      meta: {
        title: '高级查询',
        imgstyle: 'ic_list_nav_search_default.png',
        imgstyleup: 'ic_list_nav_search_check.png',
      },
      children: [
        {
          path: '/advance',
          name: 'AdvancedQuery',
          component: () => import('@/views/advancedQuery'),
          meta: { keepAlive: true },
          children: [
            {
              path: '/advance',
              name: 'AdvancedHome',
              component: () =>
                import('@/views/advancedQuery/views/advancedHome.vue'),
              meta: { keepAlive: true },
            },
            {
              path: 'advanceNew',
              name: 'AdvancedNew',
              component: () =>
                import('@/views/advancedQuery/views/advancedNew.vue'),
              meta: { 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: true },
            },
            {
              path: 'containerView',
              name: 'AdvancedContainerNav',
              component: () => import('@/views/advancedQuery'),
              meta: { title: '容器视图', keepAlive: true },
              children: [
                {
                  path: '/advance/containerView',
                  name: 'AdvancedContainerView',
                  component: () =>
                    import('@/views/advancedQuery/views/advancedContainer.vue'),
                  meta: { keepAlive: true },
                },
                {
                  path: '/advance/containerHistory',
                  name: 'AdvancedContainerHistory',
                  component: () =>
                    import(
                      '@/views/advancedQuery/views/advancedContainerHistory.vue'
                    ),
                  meta: { title: '容器历史', keepAlive: true },
                },
              ],
            },
          ],
        },
      ],
    },
  ],
}

export default [
  uploadRoutes,
  statisticsChartsRoutes,
  transferRoutes,
  arrivalRoutes,
  departureRoutes,
  advanceRoutes,
]
