import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: require('@/page/login').default
    },
    {
      path: '/',
      name: 'Layout',
      component: require('@/page/layout').default,
      children: [
        {
          path: '/home',
          name: 'Home',
          component: require('@/page/home').default,
          meta: {text: '首页'}
        },
        {
          path: '/order',
          name: 'Order',
          component: require('@/page/order').default,
          meta: {text: '订单管理'}
        },
        {
          path: '/feedback',
          name: 'feedback',
          component: require('@/page/feedback').default,
          meta: {text: '反馈消息'}
        },
        {
          path: '/device',
          name: 'device',
          component: require('@/page/device').default,
          meta: {text: '设备管理'}
        },
        {
          path: '/client',
          name: 'client',
          component: require('@/page/client').default,
          meta: {text: '客户管理'}
        },
        {
          path: '/invoice',
          name: 'invoice',
          component: require('@/page/invoice').default,
          meta: {text: '发票管理'}
        },
        {
          path: '/scene',
          name: 'scene',
          component: require('@/page/scene').default,
          meta: {text: '场景管理'}
        },
        {
          path: '/laser',
          name: 'laser',
          component: require('@/page/laser').default,
          meta: {text: '激光场景'}
        },
        {
          path: '/user',
          name: 'User',
          component: require('@/page/user').default,
          meta: {text: '设备查询'},
          children: [
            {
              path: '/',
              name: 'user-list',
              component: require('@/page/user/query-list').default
            },
            {
              path: ':id-:rid',
              name: 'user-detail',
              meta: { text: '用户明细' },
              component: require('@/page/user/query-detail').default
            }
          ]
        },
        {
          path: '/distributor',
          name: 'Distributor',
          component: require('@/page/distributor').default,
          meta: { text: '经销商申请' },
          children: [
            {
              path: '/',
              name: 'distributor-list',
              component: require('@/page/distributor/query-list').default
            }
          ]
        },
        {
          path: '/leaving',
          name: 'leaving',
          component: require('@/page/leaving').default,
          meta: { text: '留言管理' }
        },
        {
          path: '/edition',
          name: 'edition',
          component: require('@/page/edition').default,
          meta: { text: '八目相机' }
        },
        {
          path: '/turntableCamera',
          name: 'turntableCamera',
          component: require('@/page/turntableCamera').default,
          meta: { text: '转台相机' }
        },
        {
          path: '/laserCamera',
          name: 'laserCamera',
          component: require('@/page/laserCamera').default,
          meta: { text: '激光相机'}
        },
        {
          path: '/',
          name: 'Temp-scene',
          component: require('@/page/layout/temp').default,
          meta: { text: '更多设置' },
          children: [
            {
              path: 'scene',
              name: 'scene',
              component: require('@/page/scene').default
            }
          ]
        },
        {
          path: '/statistics',
          name: 'Statistics',
          component: require('@/page/statistics').default,
          meta: { text: '数据统计' }
        },
        {
          path: '/userList',
          name: 'userList',
          component: require('@/page/userList/userList').default,
          meta: { text: '用户列表' }
        },  {
          path: '/oplog',
          name: 'oplog',
          component: require('@/page/oplog/oplog').default,
          meta: { text: '操作日志' }
        },
        {
          path: '/spaceTarget',
          name: 'spaceTarget',
          component: require('@/page/spaceTarget').default,
          meta: {
            text: 'Space target'
          }
        },
        {
          path: '*',
          redirect: '/home'
        }
      ]
    }
  ]
})
