import Vue from 'vue'
import Router from 'vue-router'
import {
    ByhService,
    Controlswitch,
    ByhServiceDetail,
    Login,
    Index,
    // Default,
    BankCardMaintenance,
    UserManagement,
    LendBankCardList,
    DutyBizGroupsListDialog,
    CustomerDistribution,
    DistributionBatchDialog,
    ByhPlanRemindDetails,
    ByhPlanRemindDetailNew,
    ByhLoanBackedDetails,
    ByhLoanSnapList,
    ServiceProblem,
    ClientManagerment,
    DerateCreate,
    CreateLrdDerate,
    CreateRefund

} from './routes'

Vue.use(Router)
export default new Router({
    mode: 'hash',
    // mode: 'history',
    routes: [
        { path: '/', redirect: '/login' },
        { path: '/login', name: 'Login', meta: { title: '登录', filter: false }, component: Login },
        {
            path: '/index',
            name: 'Index',
            component: Index,
            meta: { title: '首页' },
            children: [{
                    path: '/system/bankCardMaintenance',
                    name: 'BankCardMaintenance',
                    component: BankCardMaintenance,
                    meta: { title: '银行卡维护', filter: true }
                },
                {
                    path: '/system/UserManagement',
                    name: 'UserManagement',
                    component: UserManagement,
                    meta: { title: '用户管理', filter: true }
                },
                {
                    path: '/system/CustomerDistribution',
                    name: 'CustomerDistribution',
                    component: CustomerDistribution,
                    meta: { title: '批次分配', filter: true }
                },
                {
                    path: '/system/DistributionBatchDialog',
                    name: 'DistributionBatchDialog',
                    component: DistributionBatchDialog,
                    meta: { title: '分配批次', filter: true }
                },
                {
                    path: '/system/LendBankCardList',
                    name: 'LendBankCardList',
                    component: LendBankCardList,
                    meta: { title: '出借人管理', filter: true }
                },
                {
                    path: '/system/DutyBizGroupsListDialog',
                    name: 'DutyBizGroupsListDialog',
                    component: DutyBizGroupsListDialog,
                    meta: { title: '业务组列表', filter: true }
                },
                {
                    path: '/byh/ByhPlanRemindDetails',
                    name: 'ByhPlanRemindDetails',
                    component: ByhPlanRemindDetails,
                    meta: { title: '还款计划详情', filter: true }
                },
                {
                    path: '/byh/ByhPlanRemindDetailNew',
                    name: 'ByhPlanRemindDetailNew',
                    component: ByhPlanRemindDetailNew,
                    meta: { title: '还款详情', filter: true }
                },
                {
                    path: '/byh/ByhLoanBackedDetails',
                    name: 'ByhLoanBackedDetails',
                    component: ByhLoanBackedDetails,
                    meta: { title: '还款详情', filter: true }
                },
                {
                    path: '/byh/ByhService',
                    name: 'ByhService',
                    component: ByhService,
                    meta: { title: '客服管理', filter: true }
                },
                {
                    path: '/byh/Controlswitch',
                    name: 'Controlswitch',
                    component: Controlswitch,
                    meta: { title: '亲家管理', filter: true }
                },
                {
                    path: '/byh/ByhServiceDetail',
                    name: 'ByhServiceDetail',
                    component: ByhServiceDetail,
                    meta: { title: '客服详情', filter: true }
                },
                {
                    path: '/byh/ServiceProblem',
                    name: 'ServiceProblem',
                    component: ServiceProblem,
                    meta: { title: '意见反馈', filter: true }
                },

                {
                    path: '/byh/ByhLoanSnapList',
                    name: 'ByhLoanSnapList',
                    component: ByhLoanSnapList,
                    meta: {
                        title: '临时放款列表',
                        filter: true
                    }
                },
                {
                    path: '/byh/ClientManagerment',
                    name: 'ClientManagerment',
                    component: ClientManagerment,
                    meta: {
                        title: '客户管理',
                        filter: true
                    }
                },

                {
                    path: '/byh/DerateCreate',
                    name: 'DerateCreate',
                    component: DerateCreate,
                    meta: { title: '减免单管理', filter: true }
                },
                 {
                     path: '/byh/CreateLrdDerate',
                     name: 'CreateLrdDerate',
                     component: CreateLrdDerate,
                     meta: {
                         title: '创建百灵美选减免单',
                         filter: true
                     }
                 },
                {
                    path: '/byh/RiskLevelList',
                    name: 'RiskLevelList',
                    component: resolve => require(['../components/byh/RiskLevelList.vue'], resolve),
                    meta: { title: '风险客户', filter: true }
                },
                {
                    path: '/byh/CreateRefund',
                    name: 'CreateRefund',
                    component: resolve => require(['../components/byh/CreateRefund.vue'], resolve),
                    meta: { title: '创建退款单', filter: true }
                },
            ]
        }
    ]
})