import { RouteConfig } from 'vue-router'

/**
 * 客户管理路由
 * 客户管理 /client-management
 * 客户信息 /client-info
 * 搜索 /client-search
 */

export const clientRoutes: Array<RouteConfig> = [
  {
    path: '/client',
    component: () => import('@/layout/home.vue'),
    redirect: '/client/client-management',
    children: [
      {
        path: 'add-client',
        name: 'Add-client',
        component: () => import('@/views/client/add-client.vue'),
        meta: {
          title: '添加客户'
        }
      },
      {
        path: 'select-tag',
        name: 'Select-tag',
        component: () => import('@/views/client/select-tag.vue'),
        meta: {
          title: '选择标签'
        }
      },
      {
        path: 'add-follow',
        name: 'Add-follow',
        component: () => import('@/views/client/add-follow.vue'),
        meta: {
          title: '添加跟进记录'
        }
      },
      {
        path: 'client-management',
        component: () => import('@/views/client/client-management.vue')
      },
      {
        path: 'client-info',
        component: () => import('@/views/client/client-info.vue'),
        meta: {
          title: '客户信息'
        }
      },
      {
        path: 'edit-client',
        component: () => import('@/views/client/edit-client.vue'),
        meta: {
          title: '编辑客户信息'
        }
      },
      {
        path: 'search-client',
        component: () => import('@/views/client/search.vue')
      },
      {
        path: 'search-result',
        component: () => import('@/views/client/search-result.vue')
      },
      {
        path: 'tag',
        component: () => import('@/views/client/tag-management.vue'),
        meta: {
          title: '标签管理'
        }
      },
      {
        path: 'add-tag',
        component: () => import('@/views/client/add-tag.vue'),
        meta: {
          title: '添加标签'
        }
      },
      {
        path: 'edit-tag/:id',
        component: () => import('@/views/client/edit-tag.vue'),
        meta: {
          title: '编辑标签'
        }
      },
      {
        path: 'filter',
        component: () => import('@/views/client/filter-client.vue'),
        meta: {
          title: '筛选'
        }
      },
      {
        path: 'follows',
        component: () => import('@/views/client/follows.vue'),
        meta: {
          title: '跟进成员'
        }
      }
    ]
  }
]
