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

// 主要
import main from '@/components/main.vue'
// 系统配置管理
import appManagement from '@/views/metaData/components/appManagement/appManagement.vue'
import fieldManagement from '@/views/metaData/components/fieldManagement/fieldManagement.vue'
import keyManagement from '@/views/metaData/components/keyManagement/keyManagement.vue'
import keyManagementER from '@/views/metaData/components/keyManagementER/keyManagementER.vue'
import libraryTable from '@/views/metaData/components/libraryTable/libraryTable.vue'
import librarayDetail from '@/views/metaData/components/libraryTable/detail.vue'
import fieldManagementDetail from '@/views/metaData/components/fieldManagement/detail.vue'
import keyManagementDetail from '@/views/metaData/components/keyManagement/detail.vue'
import appManagementDetail from '@/views/metaData/components/appManagement/detail.vue'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'main',
    component: main,
    redirect: {
      name: 'metaData'
    },
    children: [{
      path: 'appManagement',
      name: 'appManagement',
      component: appManagement
    },
    {
      path: 'fieldManagement',
      name: 'fieldManagement',
      component: fieldManagement
    },
    {
      path: 'keyManagement',
      name: 'keyManagement',
      component: keyManagement
    },
    {
      path: 'keyManagementER',
      name: 'keyManagementER',
      component: keyManagementER
    },
    {
      path: 'libraryTable',
      name: 'libraryTable',
      component: libraryTable
    },
    {
      path: 'libraryTable/detial',
      name: 'librarayDetail',
      meta: {
        code: 'add'
      },
      component: librarayDetail
    },
    {
      path: 'fieldManagement/detial',
      name: 'fieldManagementDetail',
      meta: {
        code: 'add'
      },
      component: fieldManagementDetail
    },
    {
      path: 'keyManagement/detial',
      name: 'keyManagementDetail',
      meta: {
        code: 'add'
      },
      component: keyManagementDetail
    },
    {
      path: 'appManagement/detial',
      name: 'appManagementDetail',
      meta: {
        code: 'add'
      },
      component: appManagementDetail
    }
    ]
  }]
})
