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

const salesMeta = { module: ModuleKey.SALES }

const layoutChildren: RouteRecordRaw[] = [
    {
        path: '/index',
        component: () => import('@/modules/sales/views/index.vue'),
        name: 'SalesIndex',
        meta: { ...salesMeta, title: '销售首页', icon: 'dashboard', affix: true },
    },

    // clue
    {
        path: '/clue/clue',
        component: () => import('@/modules/sales/views/clue/clue/index.vue'),
        name: 'SalesClueAll',
        meta: { ...salesMeta, title: '全部线索' },
    },
    {
        path: '/clue/mine',
        component: () => import('@/modules/sales/views/clue/mine/index.vue'),
        name: 'SalesClueMine',
        meta: { ...salesMeta, title: '我的线索' },
    },
    {
        path: '/clue/subordinate',
        component: () => import('@/modules/sales/views/clue/subordinate/index.vue'),
        name: 'SalesClueSubordinate',
        meta: { ...salesMeta, title: '下属线索' },
    },
    {
        path: '/clue/public',
        component: () => import('@/modules/sales/views/clue/public/index.vue'),
        name: 'SalesCluePublic',
        meta: { ...salesMeta, title: '公共线索' },
    },
    {
        path: '/clue/transferCustom',
        component: () => import('@/modules/sales/views/clue/transferCustom/index.vue'),
        name: 'SalesClueTransferCustom',
        meta: { ...salesMeta, title: '转移客户' },
    },
    {
        path: '/clue/add',
        component: () => import('@/modules/sales/views/clue/add.vue'),
        name: 'SalesClueAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增线索', noCache: false },
    },
    {
        path: '/clue/detail',
        component: () => import('@/modules/sales/views/clue/detail.vue'),
        name: 'SalesClueDetail',
        hidden: true,
        meta: { ...salesMeta, title: '线索详情' },
    },

    // customer
    {
        path: '/customer/customerForm',
        component: () => import('@/modules/sales/views/customer/customerForm/index.vue'),
        name: 'SalesCustomerAll',
        meta: { ...salesMeta, title: '全部客户' },
    },
    {
        path: '/customer/publicCustomer',
        component: () => import('@/modules/sales/views/customer/publicCustomer/index.vue'),
        name: 'SalesCustomerPublic',
        meta: { ...salesMeta, title: '公海客户' },
    },
    {
        path: '/customer/orderCustomer',
        component: () => import('@/modules/sales/views/customer/orderCustomer/index.vue'),
        name: 'SalesCustomerOrder',
        meta: { ...salesMeta, title: '订单客户' },
    },
    {
        path: '/customer/rubbishCustomer',
        component: () => import('@/modules/sales/views/customer/rubbishCustomer/index.vue'),
        name: 'SalesCustomerRubbish',
        meta: { ...salesMeta, title: '垃圾客户' },
    },
    {
        path: '/customer/followUp',
        component: () => import('@/modules/sales/views/customer/followUp/index.vue'),
        name: 'SalesCustomerFollowUp',
        meta: { ...salesMeta, title: '客户跟进记录' },
    },
    {
        path: '/customer/importantCustomer',
        component: () => import('@/modules/sales/views/customer/importantCustomer/index.vue'),
        name: 'SalesCustomerImportant',
        meta: { ...salesMeta, title: '重点客户' },
    },
    {
        path: '/customer/sendRecord',
        component: () => import('@/modules/sales/views/customer/sendRecord/index.vue'),
        name: 'SalesCustomerSendRecord',
        meta: { ...salesMeta, title: '寄样记录' },
    },
    {
        path: '/customer/liaison',
        component: () => import('@/modules/sales/views/customer/liaison/index.vue'),
        name: 'SalesCustomerLiaison',
        meta: { ...salesMeta, title: '联系人' },
    },
    {
        path: '/customer/addCustomer',
        component: () => import('@/modules/sales/views/customer/addCustomer/index.vue'),
        name: 'SalesCustomerAdd',
        hidden: true,
        meta: { ...salesMeta, title: '创建客户', noCache: false },
    },
    {
        path: '/customer/customerDetail',
        component: () => import('@/modules/sales/views/customer/customerDetail/index.vue'),
        name: 'SalesCustomerDetail',
        hidden: true,
        meta: { ...salesMeta, title: '客户详情' },
    },
    {
        path: '/customer/followPanel',
        component: () => import('@/modules/sales/views/customer/followPanel/index.vue'),
        name: 'SalesCustomerFollowPanel',
        hidden: true,
        meta: { ...salesMeta, title: '跟进面板' },
    },
    {
        path: '/customer/followPanel/detail',
        component: () => import('@/modules/sales/views/customer/followPanel/detail.vue'),
        name: 'SalesCustomerFollowPanelDetail',
        hidden: true,
        meta: { ...salesMeta, title: '跟进详情' },
    },
    {
        path: '/customer/liaison/add',
        component: () => import('@/modules/sales/views/customer/liaison/add.vue'),
        name: 'SalesCustomerLiaisonAdd',
        hidden: true,
        meta: { ...salesMeta, title: '添加联系人', noCache: false },
    },
    {
        path: '/customer/liaison/detail',
        component: () => import('@/modules/sales/views/customer/liaison/detail.vue'),
        name: 'SalesCustomerLiaisonDetail',
        hidden: true,
        meta: { ...salesMeta, title: '联系人详情' },
    },

    // business opportunity
    {
        path: '/business_opportunity/allBusiness',
        component: () => import('@/modules/sales/views/business/allBusiness/index.vue'),
        name: 'SalesBusinessAll',
        meta: { ...salesMeta, title: '全部商机' },
    },
    {
        path: '/business_opportunity/mineBusiness',
        component: () => import('@/modules/sales/views/business/mineBusiness/index.vue'),
        name: 'SalesBusinessMine',
        meta: { ...salesMeta, title: '我的商机' },
    },
    {
        path: '/business_opportunity/subordinateBusiness',
        component: () => import('@/modules/sales/views/business/subordinateBusiness/index.vue'),
        name: 'SalesBusinessSubordinate',
        meta: { ...salesMeta, title: '下属商机' },
    },
    {
        path: '/business_opportunity/subCollaborationBusiness',
        component: () => import('@/modules/sales/views/business/subCollaborationBusiness/index.vue'),
        name: 'SalesBusinessSubCollaboration',
        meta: { ...salesMeta, title: '下属协作商机' },
    },
    {
        path: '/business_opportunity/myCollaborateBusiness',
        component: () => import('@/modules/sales/views/business/myCollaborateBusiness/index.vue'),
        name: 'SalesBusinessMyCollaborate',
        meta: { ...salesMeta, title: '我的协作商机' },
    },
    {
        path: '/business_opportunity/successBusiness',
        component: () => import('@/modules/sales/views/business/successBusiness/index.vue'),
        name: 'SalesBusinessSuccess',
        meta: { ...salesMeta, title: '成交商机' },
    },
    {
        path: '/business_opportunity/lossBusiness',
        component: () => import('@/modules/sales/views/business/lossBusiness/index.vue'),
        name: 'SalesBusinessLoss',
        meta: { ...salesMeta, title: '流失商机' },
    },
    {
        path: '/business_opportunity/wxzdBusiness',
        component: () => import('@/modules/sales/views/business/wxzdBusiness/index.vue'),
        name: 'SalesBusinessWxzd',
        meta: { ...salesMeta, title: '无效置顶商机' },
    },
    {
        path: '/business_opportunity/addbus',
        component: () => import('@/modules/sales/views/business/component/add.vue'),
        name: 'SalesBusinessAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增商机', noCache: false },
    },
    {
        path: '/business_opportunity/detail',
        component: () => import('@/modules/sales/views/business/component/detail.vue'),
        name: 'SalesBusinessDetail',
        hidden: true,
        meta: { ...salesMeta, title: '商机详情' },
    },

    // order form
    {
        path: '/orderForm/orderForm',
        component: () => import('@/modules/sales/views/orderForm/orderForm/index.vue'),
        name: 'SalesOrderFormAll',
        meta: { ...salesMeta, title: '全部订单' },
    },
    {
        path: '/orderForm/mine',
        component: () => import('@/modules/sales/views/orderForm/mine/index.vue'),
        name: 'SalesOrderFormMine',
        meta: { ...salesMeta, title: '我的订单' },
    },
    {
        path: '/orderForm/subordinate',
        component: () => import('@/modules/sales/views/orderForm/subordinate/index.vue'),
        name: 'SalesOrderFormSubordinate',
        meta: { ...salesMeta, title: '下属订单' },
    },
    {
        path: '/orderForm/cooperation',
        component: () => import('@/modules/sales/views/orderForm/cooperation/index.vue'),
        name: 'SalesOrderFormCooperation',
        meta: { ...salesMeta, title: '我的协作订单' },
    },
    {
        path: '/orderForm/subordinateCooperation',
        component: () => import('@/modules/sales/views/orderForm/subordinateCooperation/index.vue'),
        name: 'SalesOrderFormSubordinateCooperation',
        meta: { ...salesMeta, title: '下属协作订单' },
    },
    {
        path: '/order/add',
        component: () => import('@/modules/sales/views/orderForm/add.vue'),
        name: 'SalesOrderFormAdd',
        hidden: true,
        meta: { ...salesMeta, title: '添加订单', noCache: false },
    },
    {
        path: '/order/detail',
        component: () => import('@/modules/sales/views/orderForm/detail.vue'),
        name: 'SalesOrderFormDetail',
        hidden: true,
        meta: { ...salesMeta, title: '订单详情' },
    },
    {
        path: '/orderForm/detail',
        component: () => import('@/modules/sales/views/orderForm/detail.vue'),
        name: 'SalesOrderFormDetailAlias',
        hidden: true,
        meta: { ...salesMeta, title: '订单详情' },
    },

    // work order
    {
        path: '/order/order',
        component: () => import('@/modules/sales/views/order/order/index.vue'),
        name: 'SalesWorkOrderAll',
        meta: { ...salesMeta, title: '全部工单' },
    },
    {
        path: '/order/launch',
        component: () => import('@/modules/sales/views/order/launch/index.vue'),
        name: 'SalesWorkOrderLaunch',
        meta: { ...salesMeta, title: '我发起的工单' },
    },
    {
        path: '/order/handle',
        component: () => import('@/modules/sales/views/order/handle/index.vue'),
        name: 'SalesWorkOrderHandle',
        meta: { ...salesMeta, title: '我处理的工单' },
    },
    {
        path: '/work_order/detail',
        component: () => import('@/modules/sales/views/order/detail.vue'),
        name: 'SalesWorkOrderDetail',
        hidden: true,
        meta: { ...salesMeta, title: '工单详情' },
    },

    // finance
    {
        path: '/finance/billRecord',
        component: () => import('@/modules/sales/views/finance/billRecord/index.vue'),
        name: 'SalesFinanceBillRecord',
        meta: { ...salesMeta, title: '账单记录' },
    },
    {
        path: '/finance/costRecord',
        component: () => import('@/modules/sales/views/finance/costRecord/index.vue'),
        name: 'SalesFinanceCostRecord',
        meta: { ...salesMeta, title: '费用记录' },
    },
    {
        path: '/finance/invoiceRecord',
        component: () => import('@/modules/sales/views/finance/invoiceRecord/index.vue'),
        name: 'SalesFinanceInvoiceRecord',
        meta: { ...salesMeta, title: '开票记录' },
    },
    {
        path: '/finance/orderReceiveRecord',
        component: () => import('@/modules/sales/views/finance/orderReceiveRecord/index.vue'),
        name: 'SalesFinanceOrderReceiveRecord',
        meta: { ...salesMeta, title: '订单收款记录' },
    },
    {
        path: '/finance/receivePlanDetail',
        component: () => import('@/modules/sales/views/finance/receivePlanDetail/index.vue'),
        name: 'SalesFinanceReceivePlanDetail',
        meta: { ...salesMeta, title: '回款计划明细' },
    },
    {
        path: '/finance/refundRecord',
        component: () => import('@/modules/sales/views/finance/refundRecord/index.vue'),
        name: 'SalesFinanceRefundRecord',
        meta: { ...salesMeta, title: '退款记录' },
    },
    {
        path: '/financial/refundRecord',
        component: () => import('@/modules/sales/views/finance/refundRecord/index.vue'),
        name: 'SalesFinanceRefundRecordAlias',
        hidden: true,
        meta: { ...salesMeta, title: '退款记录' },
    },
    {
        path: '/finance/receivePlanDetail/addForm',
        component: () => import('@/modules/sales/views/finance/receivePlanDetail/addForm.vue'),
        name: 'SalesFinanceReceivePlanDetailAdd',
        hidden: true,
        meta: { ...salesMeta, title: '回款计划表单', noCache: false },
    },
    {
        path: '/finance/refundRecord/addRefund',
        component: () => import('@/modules/sales/views/finance/refundRecord/addRefund.vue'),
        name: 'SalesFinanceRefundAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增退款', noCache: false },
    },
    {
        path: '/refundRecord/detail',
        component: () => import('@/modules/sales/views/finance/refundRecord/detailRefund.vue'),
        name: 'SalesFinanceRefundDetail',
        hidden: true,
        meta: { ...salesMeta, title: '退款详情' },
    },

    // task
    {
        path: '/task/task',
        component: () => import('@/modules/sales/views/task/task/index.vue'),
        name: 'SalesTaskAll',
        meta: { ...salesMeta, title: '全部任务' },
    },
    {
        path: '/task/responsible',
        component: () => import('@/modules/sales/views/task/responsible/index.vue'),
        name: 'SalesTaskResponsible',
        meta: { ...salesMeta, title: '我负责的任务' },
    },
    {
        path: '/task/subordinate',
        component: () => import('@/modules/sales/views/task/subordinate/index.vue'),
        name: 'SalesTaskSubordinate',
        meta: { ...salesMeta, title: '下属任务' },
    },
    {
        path: '/task/launch',
        component: () => import('@/modules/sales/views/task/launch/index.vue'),
        name: 'SalesTaskLaunch',
        meta: { ...salesMeta, title: '我发起的任务' },
    },

    // target
    {
        path: '/target/company',
        component: () => import('@/modules/sales/views/target/company/index.vue'),
        name: 'SalesTargetCompany',
        meta: { ...salesMeta, title: '公司目标' },
    },
    {
        path: '/target/dept',
        component: () => import('@/modules/sales/views/target/dept/index.vue'),
        name: 'SalesTargetDept',
        meta: { ...salesMeta, title: '部门目标' },
    },
    {
        path: '/target/group',
        component: () => import('@/modules/sales/views/target/group/index.vue'),
        name: 'SalesTargetGroup',
        meta: { ...salesMeta, title: '集团目标' },
    },
    {
        path: '/target/person',
        component: () => import('@/modules/sales/views/target/person/index.vue'),
        name: 'SalesTargetPerson',
        meta: { ...salesMeta, title: '个人目标' },
    },
    {
        path: '/target/targetScheme',
        component: () => import('@/modules/sales/views/target/targetScheme/index.vue'),
        name: 'SalesTargetScheme',
        meta: { ...salesMeta, title: '目标方案' },
    },
    {
        path: '/target/targetProgress',
        component: () => import('@/modules/sales/views/target/targetProgress/index.vue'),
        name: 'SalesTargetProgress',
        meta: { ...salesMeta, title: '目标进度' },
    },
    {
        path: '/target/targetRanking',
        component: () => import('@/modules/sales/views/target/targetRanking/index.vue'),
        name: 'SalesTargetRanking',
        meta: { ...salesMeta, title: '目标排行' },
    },
    {
        path: '/target/targetScheme/add',
        component: () => import('@/modules/sales/views/target/targetScheme/add.vue'),
        name: 'SalesTargetSchemeAdd',
        hidden: true,
        meta: { ...salesMeta, title: '目标方案创建', noCache: false },
    },
    {
        path: '/target/add',
        component: () => import('@/modules/sales/views/target/add.vue'),
        name: 'SalesTargetAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增目标', noCache: false },
    },

    // statistics
    {
        path: '/statistics/sale_ansys/busAddCount',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/busAddCount/index.vue'),
        name: 'SalesStatisticsBusAddCount',
        meta: { ...salesMeta, title: '新增统计' },
    },
    {
        path: '/statistics/sale_ansys/flowUpCount',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/flowUpCount/index.vue'),
        name: 'SalesStatisticsFlowUpCount',
        meta: { ...salesMeta, title: '跟进统计' },
    },
    {
        path: '/statistics/sale_ansys/newBusinessCount',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/newBusinessCount/index.vue'),
        name: 'SalesStatisticsNewBusinessCount',
        meta: { ...salesMeta, title: '新商机统计' },
    },
    {
        path: '/statistics/sale_ansys/allBusinessCount',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/allBusinessCount/index.vue'),
        name: 'SalesStatisticsAllBusinessCount',
        meta: { ...salesMeta, title: '商机总量统计' },
    },
    {
        path: '/statistics/sale_ansys/salesProcess',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/salesProcess/index.vue'),
        name: 'SalesStatisticsSalesProcess',
        meta: { ...salesMeta, title: '销售过程分析' },
    },
    {
        path: '/statistics/sale_ansys/salesFunnel',
        component: () => import('@/modules/sales/views/statistics/salesAnalysis/salesFunnel/index.vue'),
        name: 'SalesStatisticsSalesFunnel',
        meta: { ...salesMeta, title: '销售漏斗分析' },
    },
    {
        path: '/statistics/dataSummary/companySummary',
        component: () => import('@/modules/sales/views/statistics/dataSummary/companySummary.vue'),
        name: 'SalesStatisticsCompanySummary',
        meta: { ...salesMeta, title: '公司简报' },
    },
    {
        path: '/statistics/dataSummary/deptSummary',
        component: () => import('@/modules/sales/views/statistics/dataSummary/deptSummary.vue'),
        name: 'SalesStatisticsDeptSummary',
        meta: { ...salesMeta, title: '部门简报' },
    },
    {
        path: '/statistics/dataSummary/groupSummary',
        component: () => import('@/modules/sales/views/statistics/dataSummary/groupSummary.vue'),
        name: 'SalesStatisticsGroupSummary',
        meta: { ...salesMeta, title: '集团简报' },
    },
    {
        path: '/statistics/dataSummary/userSummary',
        component: () => import('@/modules/sales/views/statistics/dataSummary/userSummary.vue'),
        name: 'SalesStatisticsUserSummary',
        meta: { ...salesMeta, title: '个人简报' },
    },
    {
        path: '/statistics/dataAnalysis/customerAttributeAnalysis',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/customerAttributeAnalysis/index.vue'),
        name: 'SalesStatisticsCustomerAttributeAnalysis',
        meta: { ...salesMeta, title: '客户属性分析' },
    },
    {
        path: '/statistics/dataAnalysis/customerRegionDistribution',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/customerRegionDistribution/index.vue'),
        name: 'SalesStatisticsCustomerRegionDistribution',
        meta: { ...salesMeta, title: '客户区域分布' },
    },
    {
        path: '/statistics/dataAnalysis/customerDealRateAnalysis',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/customerDealRateAnalysis/index.vue'),
        name: 'SalesStatisticsCustomerDealRateAnalysis',
        meta: { ...salesMeta, title: '客户成交率分析' },
    },
    {
        path: '/statistics/dataAnalysis/top10CustomerDeals',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/top10CustomerDeals/index.vue'),
        name: 'SalesStatisticsTop10CustomerDeals',
        meta: { ...salesMeta, title: 'Top10客户成交' },
    },
    {
        path: '/statistics/dataAnalysis/custoverview',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/customerAttributeAnalysis/overview.vue'),
        name: 'SalesStatisticsCustomerOverview',
        hidden: true,
        meta: { ...salesMeta, title: '客户属性概览' },
    },
    {
        path: '/statistics/custoverview',
        component: () => import('@/modules/sales/views/statistics/dataAnalysis/customerAttributeAnalysis/overview.vue'),
        name: 'SalesStatisticsCustomerOverviewAlias',
        hidden: true,
        meta: { ...salesMeta, title: '客户属性概览' },
    },
    {
        path: '/statistics/performance/financialDataAnalysis',
        component: () => import('@/modules/sales/views/statistics/performance/financialDataAnalysis.vue'),
        name: 'SalesStatisticsFinancialDataAnalysis',
        meta: { ...salesMeta, title: '财务数据分析' },
    },
    {
        path: '/statistics/performance/paymentPlanSummary',
        component: () => import('@/modules/sales/views/statistics/performance/paymentPlanSummary.vue'),
        name: 'SalesStatisticsPaymentPlanSummary',
        meta: { ...salesMeta, title: '回款计划汇总' },
    },
    {
        path: '/statistics/performance/performanceTargetCompletion',
        component: () => import('@/modules/sales/views/statistics/performance/performanceTargetCompletion.vue'),
        name: 'SalesStatisticsPerformanceTargetCompletion',
        meta: { ...salesMeta, title: '业绩目标完成率' },
    },
    {
        path: '/statistics/performance/productSalesSummary',
        component: () => import('@/modules/sales/views/statistics/performance/productSalesSummary/index.vue'),
        name: 'SalesStatisticsProductSalesSummary',
        meta: { ...salesMeta, title: '产品销售汇总' },
    },
    {
        path: '/statistics/performance/dealOpportunitySummary',
        component: () => import('@/modules/sales/views/statistics/performance/dealOpportunitySummary/index.vue'),
        name: 'SalesStatisticsDealOpportunitySummary',
        meta: { ...salesMeta, title: '成交商机汇总' },
    },
    {
        path: '/statistics/salesRankingStatistics/newBusinessRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/newBusinessRanking/index.vue'),
        name: 'SalesStatisticsNewBusinessRanking',
        meta: { ...salesMeta, title: '新商机排行' },
    },
    {
        path: '/statistics/salesRankingStatistics/dealDataRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/dealDataRanking/index.vue'),
        name: 'SalesStatisticsDealDataRanking',
        meta: { ...salesMeta, title: '成交数据排行' },
    },
    {
        path: '/statistics/salesRankingStatistics/conversionRateRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/conversionRateRanking/index.vue'),
        name: 'SalesStatisticsConversionRateRanking',
        meta: { ...salesMeta, title: '转化率排行' },
    },
    {
        path: '/statistics/salesRankingStatistics/followUpVisitRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/followUpVisitRanking/index.vue'),
        name: 'SalesStatisticsFollowUpVisitRanking',
        meta: { ...salesMeta, title: '跟进拜访排行' },
    },
    {
        path: '/statistics/salesRankingStatistics/performanceCompletionRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/performanceCompletionRanking.vue'),
        name: 'SalesStatisticsPerformanceCompletionRanking',
        meta: { ...salesMeta, title: '业绩完成排行' },
    },
    {
        path: '/statistics/salesRankingStatistics/paymentDataRanking',
        component: () => import('@/modules/sales/views/statistics/salesRankingStatistics/paymentDataRanking.vue'),
        name: 'SalesStatisticsPaymentDataRanking',
        meta: { ...salesMeta, title: '回款数据排行' },
    },

    // bulletin
    {
        path: '/bulletin/index',
        component: () => import('@/modules/sales/views/bulletin/index.vue'),
        name: 'SalesBulletinIndex',
        meta: { ...salesMeta, title: '公告中心' },
    },
    {
        path: '/bulletin/add',
        component: () => import('@/modules/sales/views/bulletin/add.vue'),
        name: 'SalesBulletinAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增公告', noCache: false },
    },
    {
        path: '/bulletin/detail',
        component: () => import('@/modules/sales/views/bulletin/detail.vue'),
        name: 'SalesBulletinDetail',
        hidden: true,
        meta: { ...salesMeta, title: '公告详情' },
    },
    {
        path: '/bulletin/detail2',
        component: () => import('@/modules/sales/views/bulletin/detail2.vue'),
        name: 'SalesBulletinDetailTwo',
        hidden: true,
        meta: { ...salesMeta, title: '公告详情' },
    },
    {
        path: '/bulletin/comment',
        component: () => import('@/modules/sales/views/bulletin/comment.vue'),
        name: 'SalesBulletinComment',
        hidden: true,
        meta: { ...salesMeta, title: '公告评论' },
    },

    // system
    {
        path: '/system/user',
        component: () => import('@/modules/sales/views/system/user/index.vue'),
        name: 'SalesSystemUser',
        meta: { ...salesMeta, title: '用户管理' },
    },
    {
        path: '/system/dept',
        component: () => import('@/modules/sales/views/system/dept/index.vue'),
        name: 'SalesSystemDept',
        meta: { ...salesMeta, title: '部门管理' },
    },
    {
        path: '/system/task',
        component: () => import('@/modules/sales/views/system/task/index.vue'),
        name: 'SalesSystemTask',
        meta: { ...salesMeta, title: '任务配置' },
    },
    {
        path: '/system/ruleConfig',
        component: () => import('@/modules/sales/views/system/ruleConfig/index.vue'),
        name: 'SalesSystemRuleConfig',
        meta: { ...salesMeta, title: '规则配置' },
    },
    {
        path: '/system/currencySetting',
        component: () => import('@/modules/sales/views/system/currencySetting/index.vue'),
        name: 'SalesSystemCurrencySetting',
        meta: { ...salesMeta, title: '币种设置' },
    },
    {
        path: '/system/cueWordTemplate',
        component: () => import('@/modules/sales/views/system/cueWordTemplate/index.vue'),
        name: 'SalesSystemCueWordTemplate',
        meta: { ...salesMeta, title: '话术模板' },
    },
    {
        path: '/system/bulletin',
        component: () => import('@/modules/sales/views/system/bulletin/index.vue'),
        name: 'SalesSystemBulletin',
        meta: { ...salesMeta, title: '系统公告' },
    },
    {
        path: '/system/post',
        component: () => import('@/modules/sales/views/system/post/index.vue'),
        name: 'SalesSystemPost',
        meta: { ...salesMeta, title: '岗位管理' },
    },
    {
        path: '/system/menu',
        component: () => import('@/modules/sales/views/system/menu/index.vue'),
        name: 'SalesSystemMenu',
        meta: { ...salesMeta, title: '菜单管理' },
    },
    {
        path: '/system/messageTemplate',
        component: () => import('@/modules/sales/views/system/messageTemplate/index.vue'),
        name: 'SalesSystemMessageTemplate',
        meta: { ...salesMeta, title: '消息模板' },
    },
    {
        path: '/system/dict',
        component: () => import('@/modules/sales/views/system/dict/index.vue'),
        name: 'SalesSystemDict',
        meta: { ...salesMeta, title: '数据字典' },
    },
    {
        path: '/system/role',
        component: () => import('@/modules/sales/views/system/role/index.vue'),
        name: 'SalesSystemRole',
        meta: { ...salesMeta, title: '角色管理' },
    },
    {
        path: '/system/cueWordTemplate/add',
        component: () => import('@/modules/sales/views/system/cueWordTemplate/add.vue'),
        name: 'SalesSystemCueWordTemplateAdd',
        hidden: true,
        meta: { ...salesMeta, title: '新增话术模板', noCache: false },
    },
    {
        path: '/system/messageTemplate/detail',
        component: () => import('@/modules/sales/views/system/messageTemplate/detail.vue'),
        name: 'SalesSystemMessageTemplateDetail',
        hidden: true,
        meta: { ...salesMeta, title: '消息模板详情' },
    },
]

const salesRoutes: RouteRecordRaw[] = [
    {
        path: '',
        component: Layout,
        meta: { ...salesMeta },
        children: layoutChildren,
    },
    {
        path: '/user',
        component: Layout,
        hidden: true,
        redirect: 'noredirect',
        meta: { ...salesMeta },
        children: [
            {
                path: '/system/updatePwd',
                component: () => import('@/modules/sales/views/index.vue'),
                name: 'SalesUpdatePwd',
                meta: { ...salesMeta, title: '修改密码', icon: 'dashboard' },
            },
            {
                path: '/user/profile',
                component: () => import('@/modules/sales/views/system/user/profile/index.vue'),
                name: 'SalesProfile',
                meta: { ...salesMeta, title: '个人中心', icon: 'user' },
            },
        ],
    },
    {
        path: '/email',
        component: () => import('@/modules/sales/views/email/index.vue'),
        name: 'SalesEmail',
        hidden: true,
        meta: { ...salesMeta, title: '邮件' },
    },
    {
        path: '/email/send',
        component: () => import('@/modules/sales/views/email/send.vue'),
        name: 'SalesEmailSend',
        hidden: true,
        meta: { ...salesMeta, title: '写邮件' },
    },
    {
        path: '/email/settings',
        component: () => import('@/modules/sales/views/email/settings.vue'),
        name: 'SalesEmailSettings',
        hidden: true,
        meta: { ...salesMeta, title: '邮件设置' },
    },
    {
        path: '/email/preview',
        component: () => import('@/modules/sales/views/email/preview.vue'),
        name: 'SalesEmailPreview',
        hidden: true,
        meta: { ...salesMeta, title: '邮件预览' },
    },
]

export default salesRoutes
