import type { RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    redirect: '/home',
    component: Layout,
    children: [
      { path: '/:pathMatch(.*)*', redirect: '/home' },
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/HomeView/index.vue'),
        meta: {
          title: '首页'
        }
      }, {
        path: '/creditDynamics',
        name: 'creditDynamics',
        component: () => import('@/views/creditDynamics/index.vue'),
        meta: {
          title: '信用动态'
        }
      }, {
        path: '/creditWiseEnterprise',
        name: 'creditWiseEnterprise',
        component: () => import('@/views/creditWiseEnterprise/index.vue'),
        meta: {
          title: '信用慧企'
        }
      }, {
        path: '/creditEcaluationResults',
        name: 'creditEcaluationResults',
        component: () => import('@/views/creditEcaluationResults/index.vue'),
        meta: {
          title: '信用红榜'
        }
      }, {
        path: '/creditWarning',
        name: 'creditWarning',
        component: () => import('@/views/creditWarning/index.vue'),
        meta: {
          title: '信用警示'
        }
      }, {
        path: '/creditServices',
        name: 'creditServices',
        component: () => import('@/views/creditServices/index.vue'),
        meta: {
          title: '企业自主上报'
        }
      }, {
        path: '/about',
        name: 'about',
        component: () => import('@/views/about/index.vue'),
        meta: {
          title: '通知公告'
        }
      },
      {
        path: '/creditDynamicsDetail',
        name: 'creditDynamicsDetail',
        component: () => import('@/views/creditDynamics/creditDynamicsDetail/index.vue'),
        meta: {
          title: '信用动态详情'
        }
      },
      {
        path:'/search',
        name:'search',
        component:()=>import('@/views/search/index.vue'),
        meta:{
          title:'搜索'
        }
      },
      {
        path:'/newsDetail',
        name:'newsDetail',
        component:()=>import('@/views/newsDetail/index.vue'),
        meta:{
          title:'新闻详情'
        }
      },
      {
        path:'companyDetail',
        name:'companyDetail',
        component:()=>import('@/views/companyDetail/index.vue'),
        meta:{
          title:'企业详情'
        }
      },
      {
        path:'companyList',
        name:'companyList',
        component:()=>import('@/views/companyList/index.vue'),
        meta:{
          title:'企业列表'
        }
      }
    ]
  }
]
