import Layout from '@/layout'

const HomeRoutes = {
  path: '/BasicsData',
  component: Layout,
  name: 'BasicsData',
  redirect: '/BasicsData/airlineCompany',
  //using el svg icon, the elSvgIcon first when at the same time using elSvgIcon and icon
  meta: {
    title: '基础数据',
    elSvgIcon: 'Operation',
    roles: ['basic_data_menu'],
  },
  children: [
    {
      path: '/BasicsData/airlineCompany',
      name: 'AirlineCompany',
      meta: {
        title: '航司信息维护',
        roles: ['airline_information_maintenance_page'],
      },
      component: () => import('@/views/BasicsData/airlineCompany/index.vue'),
    },
    {
      path: '/BasicsData/airportCompany',
      name: 'AirportCompany',
      meta: {
        title: '机场公司维护',
        roles: ['airport_company_maintenance_page'],
      },
      component: () => import('@/views/BasicsData/airportCompany/index.vue'),
    },
    {
      path: '/BasicsData/airportInfo',
      name: 'AirportInfo',
      meta: {
        title: '机场信息维护',
        roles: ['airport_information_maintenance_page'],
      },
      redirect: '/BasicsData/airportInfo',
      component: {
        render: () => h(resolveComponent('router-view')),
      },
      children: [
        {
          path: '/BasicsData/airportInfo',
          hidden: true,
          component: () => import('@/views/BasicsData/airportInfo/index.vue'),
        },
        {
          path: '/BasicsData/airportInfoChild',
          name: 'AirportInfoChild',
          hidden: true,
          meta: {
            title: '区域设置',
            keepAlive: true,
            roles: ['terminal_setting_page'],
          },
          redirect: '/BasicsData/airportInfoChild',
          component: {
            render: () => h(resolveComponent('router-view')),
          },
          children: [
            {
              path: '/BasicsData/airportInfoChild',
              hidden: true,
              component: () =>
                import(
                  '@/views/BasicsData/airportInfo/airportInfoChild/index.vue'
                ),
            },
            {
              path: '/BasicsData/positionSetting',
              name: 'PositionSetting',
              hidden: true,
              meta: { title: '位置设置', roles: ['position_setting_page'] },
              component: () =>
                import(
                  '@/views/BasicsData/airportInfo/positionSetting/index.vue'
                ),
            },
          ],
        },
      ],
    },
    {
      path: '/BasicsData/deployNode',
      name: 'DeployNode',
      meta: {
        title: '节点信息维护',
        roles: ['node_information_maintenance_page'],
      },
      component: () => import('@/views/BasicsData/deployNode/index.vue'),
    },
    {
      path: '/BasicsData/modelMaintenance',
      name: 'ModelMaintenance',
      redirect: '/BasicsData/modelMaintenance',
      meta: { title: '机型维护', roles: ['model_maintenance_page'] },
      component: {
        render: () => h(resolveComponent('router-view')),
      },
      children: [
        {
          path: '/BasicsData/modelMaintenance',
          name: 'ModelMaintenance',
          hidden: true,
          component: () =>
            import('@/views/BasicsData/modelMaintenance/index.vue'),
        },
        {
          path: '/BasicsData/modelMaintenance/shippingSpace',
          name: 'ShippingSpace',
          hidden: true,
          meta: { title: '舱位管理', roles: ['cabin_editor_page'] },
          component: () => import('@/views/BasicsData/shippingSpace/index.vue'),
        },
      ],
    },
    {
      path: '/BasicsData/containerMaintenance',
      name: 'ContainerMaintenance',
      meta: { title: '容器维护', roles: ['container_maintenance_page'] },
      component: () =>
        import('@/views/BasicsData/containerMaintenance/index.vue'),
    },
    {
      path: '/BasicsData/cargoInformation',
      name: 'CargoInformation',
      meta: {
        title: '货代信息维护',
        roles: ['freight_forwarding_information_maintenance_page'],
      },
      component: () => import('@/views/BasicsData/cargoInformation/index.vue'),
    },
    {
      path: '/BasicsData/specialCargoMaintenance',
      name: 'SpecialCargoMaintenance',
      meta: {
        title: '特殊货物类型维护',
        roles: ['special_cargo_type_maintenance_page'],
      },
      component: () =>
        import('@/views/BasicsData/specialCargoMaintenance/index.vue'),
    },
    {
      path: '/BasicsData/equipmentMaintenance',
      name: 'EquipmentMaintenance',
      meta: { title: '设备维护', roles: ['equipment_maintenance_page'] },
      component: () =>
        import('@/views/BasicsData/equipmentMaintenance/index.vue'),
    },
  ],
}

export default [HomeRoutes]
