import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout/layout.vue'
import Login from '@/views/user/login/Login.vue'
import printEquipmentAccountLabel from '@/views/resource/printEquipmentAccountLabelList.vue'
import inspectionRouter from './inspectionRouter'
import machineRouter from './machineRouter'
import oaRouter from './oaRouter'
import contractRouter from './contractRouter'
import reportRouter from './reportRouter'
import devRouter from './devRouter'
import resourceRouter from './resourceRouter'
import carRouter from './carRouter'
import scmRouter from './scmRouter'
import userRouter from './userRouter'
import systemRouter from './systemRouter'
import communityRouter from './communityRouter'
import workRouter from './workRouter'
import feeRouter from './feeRouter'
import propertyRouter from './propertyRouter'

Vue.use(VueRouter)

// 多标签页：仅当路由配置了 meta.title 或 meta.titleKey 时才会在标签栏展示
//   meta: { title: '费用项设置' }           // 直接文案
//   meta: { titleKey: 'fee.titleConfig' }   // i18n 的 key
const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/views/index/index',
    children: [
      {
        path: '/views/index/index',
        name: '/views/index/index',
        component: () => import('@/views/index/index.vue'),
        meta: { title: '首页' }
      },

      {
        path: '/pages/frame/changeStaffPwd',
        meta: { title: '修改密码' },
        name: '/pages/frame/changeStaffPwd',
        component: () => import('@/views/user/login/updatePwd.vue')
      },

      {

        path: '/pages/frame/orgManage',
        meta: { title: '组织信息' },
        name: '/pages/frame/orgManage',
        component: () => import('@/views/org/orgList.vue')
      },

      {
        path: '/pages/frame/staff',
        meta: { title: '员工信息' },
        name: '/pages/frame/staff',
        component: () => import('@/views/staff/staffList.vue')
      },
      {
        path: '/views/staff/addStaff',
        name: '/views/staff/addStaff',
        component: () => import('@/views/staff/addStaff.vue')
      },
      {
        path: '/pages/frame/role',
        meta: { title: '角色权限' },
        name: '/pages/frame/role',
        component: () => import('@/views/role/roleList.vue')
      },


      {
        path: '/views/staff/staffDetail',
        name: '/views/staff/staffDetail',
        component: () => import('@/views/staff/staffDetailList.vue')
      },


      {
        path: '/pages/log/mqttLog',
        name: '/pages/log/mqttLog',
        component: () => import('@/views/log/mqttLogList.vue')
      },
      {
        path: '/pages/frame/systemInfoManage',
        meta: { title: '系统配置' },
        name: '/pages/frame/systemInfoManage',
        component: () => import('@/views/system/systemInfoManageList.vue')
      },
      {
        path: '/pages/frame/registerProtocol',
        meta: { title: '注册协议' },
        name: '/pages/frame/registerProtocol',
        component: () => import('@/views/system/registerProtocolList.vue')
      },

      {
        path: '/views/report/reportCustomComponentRelManage',
        name: '/views/report/reportCustomComponentRelManage',
        component: () => import('@/views/report/reportCustomComponentRelManageList.vue')
      },
      {
        path: '/views/report/componentConditionManage',
        name: '/views/report/componentConditionManage',
        component: () => import('@/views/report/componentConditionManageList.vue')
      },
      {
        path: '/views/report/reportCustomComponentFooterManage',
        name: '/views/report/reportCustomComponentFooterManage',
        component: () => import('@/views/report/reportCustomComponentFooterManageList.vue')
      },

      {
        path: '/pages/common/communityManage',
        meta: { title: '小区信息' },
        name: '/pages/common/communityManage',
        component: () => import('@/views/community/communityManageList.vue')
      },
      {
        path: '/pages/admin/propertyCompanyManage',
        meta: { title: '物业公司' },
        name: '/pages/admin/propertyCompanyManage',
        component: () => import('@/views/store/propertyCompanyManageList.vue')
      },
      {
        path: '/views/community/propertyCommunity',
        name: '/views/community/propertyCommunity',
        component: () => import('@/views/community/propertyCommunityList.vue')
      },
      {
        path: '/pages/community/cityArea',
        meta: { title: '地区' },
        name: '/pages/community/cityArea',
        component: () => import('@/views/community/cityAreaList.vue')
      },
      {
        path: '/pages/admin/merchantManage',
        meta: { title: '周边商家' },
        name: '/pages/admin/merchantManage',
        component: () => import('@/views/mall/merchantManageList.vue')
      },
      {
        path: '/pages/admin/shopManage',
        meta: { title: '店铺信息' },
        name: '/views/mall/shopManage',
        component: () => import('@/views/mall/shopManageList.vue')
      },
      {
        path: '/pages/admin/shopCommunity',
        meta: { title: '小区店铺' },
        name: '/pages/admin/shopCommunity',
        component: () => import('@/views/mall/shopCommunityList.vue')
      },
      {
        path: '/pages/staff/systemUser',
        meta: { title: '物业用户' },
        name: '/pages/staff/systemUser',
        component: () => import('@/views/staff/systemUserList.vue')
      },
      {
        path: '/views/staff/systemUserDetail',
        name: '/views/staff/systemUserDetail',
        component: () => import('@/views/staff/systemUserDetailList.vue')
      },
      {
        path: '/pages/staff/storeStaff',
        meta: { title: '物业员工' },
        name: '/pages/staff/storeStaff',
        component: () => import('@/views/staff/storeStaffList.vue')
      },
      {
        path: '/views/staff/adminStaffDetail',
        name: '/views/staff/adminStaffDetail',
        component: () => import('@/views/staff/adminStaffDetail.vue')
      },
      {
        path: '/pages/community/adminRoom',
        meta: { title: '小区房屋' },
        name: '/pages/community/adminRoom',
        component: () => import('@/views/community/adminRoomList.vue')
      },
      {
        path: '/pages/owner/adminOwner',
        meta: { title: '小区业主' },
        name: '/pages/owner/adminOwner',
        component: () => import('@/views/owner/adminOwnerList.vue')
      },

      {
        path: '/pages/owner/adminAuthOwner',
        meta: { title: '业主认证' },
        name: '/pages/owner/adminAuthOwner',
        component: () => import('@/views/owner/adminAuthOwnerList.vue')
      },
      {
        path: '/pages/owner/adminAccount',
        meta: { title: '业主账户' },
        name: '/pages/owner/adminAccount',
        component: () => import('@/views/account/adminAccountList.vue')
      },
      {
        path: '/views/account/adminAccountDetail',
        name: '/views/account/adminAccountDetail',
        component: () => import('@/views/account/adminAccountDetailList.vue')
      },
      {
        path: '/pages/fee/adminFeeConfig',
        meta: { title: '小区费用项' },
        name: '/pages/fee/adminFeeConfig',
        component: () => import('@/views/fee/adminFeeConfigList.vue')
      },

      {
        path: '/pages/fee/adminRoomFee',
        meta: { title: '房屋费用' },
        name: '/pages/fee/adminRoomFee',
        component: () => import('@/views/fee/adminRoomFeeList.vue')
      },
      {
        path: '/pages/work/adminRepair',
        meta: { title: '小区报修' },
        name: '/pages/work/adminRepair',
        component: () => import('@/views/work/adminRepairList.vue')
      },
      {
        path: '/views/work/adminRepairDetail',
        name: '/views/work/adminRepairDetail',
        component: () => import('@/views/work/adminRepairDetailList.vue')
      },

      {
        path: '/pages/complaint/adminComplaint',
        meta: { title: '小区投诉' },
        name: '/pages/complaint/adminComplaint',
        component: () => import('@/views/complaint/adminComplaintList.vue')
      },
      {
        path: '/views/complaint/adminComplaintDetail',
        name: '/views/complaint/adminComplaintDetail',
        component: () => import('@/views/complaint/adminComplaintDetailList.vue')
      },
      {
        path: '/pages/oa/adminWorkPool',
        meta: { title: '小区工作单' },
        name: '/pages/oa/adminWorkPool',
        component: () => import('@/views/work/adminWorkPoolList.vue')
      },
      {
        path: '/views/work/adminWorkDetail',
        name: '/views/work/adminWorkDetail',
        component: () => import('@/views/work/adminWorkDetailList.vue')
      },
      {
        path: '/pages/iot/aAccessControl',
        meta: { title: '小区门禁' },
        name: '/pages/iot/aAccessControl',
        component: () => import('@/views/iot/aAccessControlList.vue')
      },
      {
        path: '/pages/iot/adminBarrier',
        meta: { title: '道闸相机' },
        name: '/pages/iot/adminBarrier',
        component: () => import('@/views/iot/adminBarrierList.vue')
      },

      {
        path: '/pages/iot/adminMeter',
        meta: { title: '水电表' },
        name: '/pages/iot/adminMeter',
        component: () => import('@/views/iot/adminMeterList.vue')
      },
      {
        path: '/pages/iot/adminInout',
        meta: { title: '门禁出入' },
        name: '/pages/iot/adminInout',
        component: () => import('@/views/iot/adminInoutList.vue')
      },

      {
        path: '/pages/iot/adminChargeOrder',
        meta: { title: '充电订单' },
        name: '/pages/iot/adminChargeOrder',
        component: () => import('@/views/iot/adminChargeOrderList.vue')
      },
      {
        path: '/pages/iot/adminMeterRecharge',
        meta: { title: '水电充值' },
        name: '/pages/iot/adminMeterRecharge',
        component: () => import('@/views/iot/adminMeterRechargeList.vue')
      },
      {
        path: '/pages/report/operationalAnalysis',
        meta: { title: '运营分析' },
        name: '/pages/report/operationalAnalysis',
        component: () => import('@/views/report/operationalAnalysisList.vue')
      },
      {
        path: '/pages/report/communityFeeSummary',
        meta: { title: '小区费用汇总' },
        name: '/pages/report/communityFeeSummary',
        component: () => import('@/views/report/communityFeeSummaryList.vue')
      },
      {
        path: '/pages/fee/adminPayFeeDetail',
        meta: { title: '缴费记录' },
        name: '/pages/fee/adminPayFeeDetail',
        component: () => import('@/views/fee/adminPayFeeDetailList.vue')
      },
      {
        path: '/pages/fee/adminOweFeeDetail',
        meta: { title: '小区欠费' },
        name: '/pages/fee/adminOweFeeDetail',
        component: () => import('@/views/fee/adminOweFeeDetailList.vue')
      },
      {
        path: '/pages/admin/orderManage',
        meta: { title: '受理单' },
        name: '/pages/admin/orderManage',
        component: () => import('@/views/admin/orderManageList.vue')
      },
      {
        path: '/pages/frame/userLogin',
        meta: { title: '登录日志' },
        name: '/pages/frame/userLogin',
        component: () => import('@/views/user/userLoginList.vue')
      },
      {
        path: '/pages/admin/productSj',
        meta: { title: '上架商品' },
        name: '/pages/admin/productSj',
        component: () => import('@/views/mall/productSjList.vue')
      },
      {
        path: '/pages/admin/housekeepingSjServ',
        meta: { title: '上架服务' },
        name: '/pages/admin/housekeepingSjServ',
        component: () => import('@/views/mall/housekeepingSjServList.vue')
      },
      {
        path: '/pages/admin/storeOrderCartManage',
        meta: { title: '商城订单' },
        name: '/pages/admin/storeOrderCartManage',
        component: () => import('@/views/mall/storeOrderCartManageList.vue')
      },
      {
        path: '/pages/admin/storeOrderCartReturn',
        meta: { title: '退货订单' },
        name: '/pages/admin/storeOrderCartReturn',
        component: () => import('@/views/mall/storeOrderCartReturnList.vue')
      },
      {
        path: '/pages/admin/userIntegral',
        meta: { title: '用户积分' },
        name: '/pages/admin/userIntegral',
        component: () => import('@/views/mall/userIntegralList.vue')
      },
      {
        path: '/pages/admin/integralDetail',
        meta: { title: '积分交易' },
        name: '/pages/admin/integralDetail',
        component: () => import('@/views/mall/integralDetailList.vue')
      },
      {
        path: '/pages/admin/marketSmsManage',
        meta: { title: '营销配置' },
        name: '/pages/admin/marketSmsManage',
        component: () => import('@/views/market/marketSmsManageList.vue')
      },
      {
        path: '/pages/admin/marketWay',
        meta: { title: '营销方式' },
        name: '/pages/admin/marketWay',
        component: () => import('@/views/market/marketWayList.vue')
      },
      {
        path: '/views/market/marketGoodsItemManage',
        name: '/views/market/marketGoodsItemManage',
        component: () => import('@/views/market/marketGoodsItemManageList.vue')
      },
      {
        path: '/pages/admin/marketRule',
        meta: { title: '营销规则' },
        name: '/pages/admin/marketRule',
        component: () => import('@/views/market/marketRuleList.vue')
      },
      {
        path: '/pages/admin/marketBlacklistManage',
        meta: { title: '营销黑名单' },
        name: '/pages/admin/marketBlacklistManage',
        component: () => import('@/views/market/marketBlacklistManageList.vue')
      },
      {
        path: '/pages/admin/marketLog',
        meta: { title: '营销记录' },
        name: '/pages/admin/marketLog',
        component: () => import('@/views/market/marketLogList.vue')
      },
      {
        path: '/pages/property/advertManage',
        meta: { title: '发布广告' },
        name: '/pages/property/advertManage',
        component: () => import('@/views/admin/advertManageList.vue')
      },
      {
        path: '/pages/admin/convenienceMenusManage',
        name: '/pages/admin/convenienceMenusManage',
        component: () => import('@/views/mall/convenienceMenusManageList.vue')
      },
      {
        path: '/pages/admin/storeInfoManage',
        name: '/pages/admin/storeInfoManage',
        component: () => import('@/views/mall/storeInfoManageList.vue')
      },
      {
        path: '/pages/proxy/junkRequirementManage',
        name: '/pages/proxy/junkRequirementManage',
        component: () => import('@/views/mall/junkRequirementManageList.vue')
      },
      {
        path: '/pages/admin/couponPoolManage',
        meta: { title: '制作优惠券' },
        name: '/pages/admin/couponPoolManage',
        component: () => import('@/views/account/couponPoolManageList.vue')
      },
      {
        path: '/pages/admin/couponDetailManage',
        meta: { title: '购买记录' },
        name: '/pages/admin/couponDetailManage',
        component: () => import('@/views/account/couponDetailManageList.vue')
      },
      {
        path: '/pages/scm/supplierTypeManage',
        name: '/pages/scm/supplierTypeManage',
        component: () => import('@/views/scm/supplierTypeManageList.vue')
      },
      {
        path: '/pages/scm/supplierManage',
        name: '/pages/scm/supplierManage',
        component: () => import('@/views/scm/supplierManageList.vue')
      },
      {
        path: '/pages/scm/supplierCoupon',
        name: '/pages/scm/supplierCoupon',
        component: () => import('@/views/scm/supplierCouponList.vue')
      },
      {
        path: '/pages/scm/supplierCouponBuy',
        name: '/pages/scm/supplierCouponBuy',
        component: () => import('@/views/scm/supplierCouponBuyList.vue')
      },
      {
        path: '/pages/staff/aStaff',
        meta: { title: '运营员工' },
        name: '/pages/staff/aStaff',
        component: () => import('@/views/staff/aStaffList.vue')
      },
      {
        path: '/views/staff/aStaffDetail',
        name: '/views/staff/aStaffDetail',
        component: () => import('@/views/staff/aStaffDetailList.vue')
      },
      {
        path: '/pages/staff/aStaffCommunity',
        meta: { title: '员工小区' },
        name: '/pages/staff/aStaffCommunity',
        component: () => import('@/views/staff/aStaffCommunityList.vue')
      },
      {
        path: '/pages/community/communityWechat',
        meta: { title: '小区公众号' },
        name: '/pages/community/communityWechat',
        component: () => import('@/views/community/communityWechatList.vue')
      },
      {
        path: '/pages/community/communityMini',
        meta: { title: '小区小程序' },
        name: '/pages/community/communityMini',
        component: () => import('@/views/community/communityMiniList.vue')
      },
      {
        path: '/pages/fee/communityPayment',
        meta: { title: '小区支付' },
        name: '/pages/fee/communityPayment',
        component: () => import('@/views/fee/communityPaymentList.vue')
      },
      {
        path: '/pages/common/enterCommunity',
        meta: { title: '我的小区' },
        name: '/pages/common/enterCommunity',
        component: () => import('@/views/community/enterCommunityList.vue')
      },
      {
        path: '/pages/property/roomRenovationManage',
        meta: { title: '房屋装修' },
        name: '/pages/property/roomRenovationManage',
        component: () => import('@/views/community/roomRenovationManageList.vue')
      },
      {
        path: '/pages/property/feeConfigManage',
        meta: { title: '费用项设置' },
        name: '/pages/property/feeConfigManage',
        component: () => import('@/views/fee/feeConfigManageList.vue')
      },
      {
        path: '/views/fee/payFeeConfigDiscountManage',
        name: '/views/fee/payFeeConfigDiscountManage',
        component: () => import('@/views/fee/payFeeConfigDiscountManageList.vue')
      },
      {
        path: '/pages/property/room',
        meta: { title: '房屋管理' },
        name: '/pages/property/room',
        component: () => import('@/views/room/roomList.vue')
      },
      {
        path: '/views/room/addRoomView',
        name: '/views/room/addRoomView',
        component: () => import('@/views/room/addRoomViewList.vue')
      },
      {
        path: '/views/owner/roomBindOwner',
        name: '/views/owner/roomBindOwner',
        component: () => import('@/views/owner/roomBindOwnerList.vue')
      },
      {
        path: '/views/owner/deleteOwnerRoom',
        name: '/views/owner/deleteOwnerRoom',
        component: () => import('@/views/owner/deleteOwnerRoomList.vue')
      },
      {
        path: '/pages/property/shops',
        meta: { title: '商铺管理' },
        name: '/pages/property/shops',
        component: () => import('@/views/room/shopsList.vue')
      },
      {
        path: '/pages/property/listOwner',
        meta: { title: '业主信息' },
        name: '/pages/property/listOwner',
        component: () => import('@/views/owner/listOwner.vue')
      },
      {
        path: '/views/owner/ownerBindRoom',
        name: '/views/owner/ownerBindRoom',
        component: () => import('@/views/owner/ownerBindRoom.vue')
      },
      {
        path: '/pages/property/auditAuthOwner',
        meta: { title: '业主认证' },
        name: '/pages/property/auditAuthOwner',
        component: () => import('@/views/owner/auditAuthOwnerList.vue')
      },
      {
        path: '/pages/property/accountManage',
        meta: { title: '业主账户' },
        name: '/pages/property/accountManage',
        component: () => import('@/views/account/accountManageList.vue')
      },
      {
        path: '/views/account/accountDetailManage',
        name: '/views/account/accountDetailManage',
        component: () => import('@/views/account/accountDetailManageList.vue')
      },
      {
        path: '/pages/property/communitySpaceManage',
        meta: { title: '场地管理' },
        name: '/pages/property/communitySpaceManage',
        component: () => import('@/views/community/communitySpaceManageList.vue')
      },
      {
        path: '/pages/property/reportCommunitySpace',
        meta: { title: '场地预约' },
        name: '/pages/property/reportCommunitySpace',
        component: () => import('@/views/community/reportCommunitySpaceList.vue')
      },
      {
        path: '/pages/property/communitySpacePersonManage',
        meta: { title: '场地预约订单' },
        name: '/pages/property/communitySpacePersonManage',
        component: () => import('@/views/community/communitySpacePersonManageList.vue')
      },
      {
        path: '/pages/property/communitySpaceConfirm',
        meta: { title: '预约核销' },
        name: '/pages/property/communitySpaceConfirm',
        component: () => import('@/views/community/communitySpaceConfirmList.vue')
      },
      {
        path: '/pages/owner/ownerCommitteeManage',
        meta: { title: '业委会' },
        name: '/pages/owner/ownerCommitteeManage',
        component: () => import('@/views/owner/ownerCommitteeManageList.vue')
      },
      {
        path: '/views/owner/addOwnerCommittee',
        name: '/views/owner/addOwnerCommittee',
        component: () => import('@/views/owner/addOwnerCommitteeList.vue')
      },
      {
        path: '/views/owner/editOwnerCommittee',
        name: '/views/owner/editOwnerCommittee',
        component: () => import('@/views/owner/editOwnerCommitteeList.vue')
      },
      {
        path: '/views/owner/ownerCommitteeDetail',
        name: '/views/owner/ownerCommitteeDetail',
        component: () => import('@/views/owner/ownerCommitteeDetailList.vue')
      },
      {
        path: '/pages/fee/ownerInvoice',
        meta: { title: '发票抬头' },
        name: '/pages/fee/ownerInvoice',
        component: () => import('@/views/fee/ownerInvoiceList.vue')
      },
      {
        path: '/views/fee/addOwnerInvoice',
        name: '/views/fee/addOwnerInvoice',
        component: () => import('@/views/fee/addOwnerInvoiceList.vue')
      },
      {
        path: '/pages/fee/invoiceApply',
        meta: { title: '发票' },
        name: '/pages/fee/invoiceApply',
        component: () => import('@/views/fee/invoiceApplyList.vue')
      },
      {
        path: '/views/fee/ownerApplyInvoice',
        name: '/views/fee/ownerApplyInvoice',
        component: () => import('@/views/fee/ownerApplyInvoiceList.vue')
      },
      {
        path: '/views/fee/invoiceApplyDetail',
        name: '/views/fee/invoiceApplyDetail',
        component: () => import('@/views/fee/invoiceApplyDetailList.vue')
      },
      {
        path: '/views/fee/feeConfigDetail',
        name: '/views/fee/feeConfigDetail',
        component: () => import('@/views/fee/feeConfigDetailList.vue')
      },

      {
        path: '/pages/property/carCreateFee',
        meta: { title: '车辆收费' },
        name: '/pages/property/carCreateFee',
        component: () => import('@/views/fee/carCreateFeeList.vue')
      },
      {
        path: '/views/fee/listCarFee',
        name: '/views/fee/listCarFee',
        component: () => import('@/views/fee/listCarFeeList.vue')
      },
      {
        path: '/pages/work/repairSetting',
        meta: { title: '报修设置' },
        name: '/pages/work/repairSetting',
        component: () => import('@/views/work/repairSettingList.vue')
      },
      {
        path: '/views/work/repairTypeUser',
        name: '/views/work/repairTypeUser',
        component: () => import('@/views/work/repairTypeUserList.vue')
      },
      {
        path: '/pages/property/ownerRepairManage',
        meta: { title: '电话报修' },
        name: '/pages/property/ownerRepairManage',
        component: () => import('@/views/work/ownerRepairManageList.vue')
      },
      {
        path: '/pages/property/repairPoolManage',
        meta: { title: '工单池' },
        name: '/pages/property/repairPoolManage',
        component: () => import('@/views/work/repairPoolManageList.vue')
      },
      {
        path: '/views/work/repairDetail',
        name: '/views/work/repairDetail',
        component: () => import('@/views/work/repairDetailList.vue')
      },
      {
        path: '/pages/property/repairDispatchManage',
        meta: { title: '报修待办' },
        name: '/pages/property/repairDispatchManage',
        component: () => import('@/views/work/repairDispatchManageList.vue')
      },
      {
        path: '/pages/property/myRepairDispatchManage',
        meta: { title: '报修已办' },
        name: '/pages/property/myRepairDispatchManage',
        component: () => import('@/views/work/myRepairDispatchManageList.vue')
      },
      {
        path: '/pages/property/repairReturnVisit',
        meta: { title: '报修回访' },
        name: '/pages/property/repairReturnVisit',
        component: () => import('@/views/work/repairReturnVisitList.vue')
      },
      {
        path: '/pages/property/repairForceFinishManage',
        meta: { title: '强制回单' },
        name: '/pages/property/repairForceFinishManage',
        component: () => import('@/views/work/repairForceFinishManageList.vue')
      },
      {
        path: '/pages/property/locationManage',
        meta: { title: '设备位置' },
        name: '/pages/property/locationManage',
        component: () => import('@/views/community/locationManageList.vue')
      },

      ...inspectionRouter,
      ...machineRouter,
      ...oaRouter,
      ...contractRouter,
      ...reportRouter,
      ...devRouter,
      ...resourceRouter,
      ...carRouter,
      ...scmRouter,
      ...userRouter,
      ...systemRouter,
      ...communityRouter,
      ...workRouter,
      ...feeRouter,
      ...propertyRouter,
      // 其他子路由可以在这里添加
    ]
  },
  {
    path: '/views/user/login',
    name: 'views/user/login',
    component: Login,
    meta: {
      title: '登陆页面',
      icon: 'el-icon-s-home'
    }
  },
  {
    path: '/login',
    redirect: '/views/user/login'
  },
  {
    path: '/views/resource/printEquipmentAccountLabel',
    name: '/views/resource/printEquipmentAccountLabel',
    component: printEquipmentAccountLabel
  },
  {
    path: '/pages/question/printQuestionAnswer',
    name: '/pages/question/printQuestionAnswer',
    component: () => import('@/views/oa/printQuestionAnswerList.vue')
  },
  {
    path: '/pages/question/printQuestionAnswerDetail',
    name: '/pages/question/printQuestionAnswerDetail',
    component: () => import('@/views/oa/printQuestionAnswerDetailList.vue')
  },
  {
    path: '/views/oa/printOwnerVoting',
    name: '/views/oa/printOwnerVoting',
    component: () => import('@/views/oa/printOwnerVotingList.vue')
  },
  {
    path: '/views/contract/printContract',
    name: '/views/contract/printContract',
    component: () => import('@/views/contract/printContractList.vue')
  },
  {
    path: '/pages/property/printPayFee',
    name: '/pages/property/printPayFee',
    component: () => import('@/views/fee/printPayFeeList.vue')
  },
  {
    path: '/pages/property/printPayFeeBangTai',
    name: '/pages/property/printPayFeeBangTai',
    component: () => import('@/views/fee/printPayFeeBangTaiList.vue')
  },
  {
    path: '/pages/property/printPayFeeXiangyun',
    name: '/pages/property/printPayFeeXiangyun',
    component: () => import('@/views/fee/printPayFeeXiangyun.vue')
  },
  {
    path: '/pages/property/printPayFeeXinShiDai',
    name: '/pages/property/printPayFeeXinShiDai',
    component: () => import('@/views/fee/printPayFeeXinShiDai.vue')
  },
  {
    path: '/pages/property/printPayFeeTianlin',
    name: '/pages/property/printPayFeeTianlin',
    component: () => import('@/views/fee/printPayFeeTianlin.vue')
  },
  {
    path: '/pages/property/printSmallPayFee',
    name: '/pages/property/printSmallPayFee',
    component: () => import('@/views/fee/printSmallPayFeeList.vue')
  },
  {
    path: '/pages/property/printAccountReceipt',
    name: '/pages/property/printAccountReceipt',
    component: () => import('@/views/account/printAccountReceiptList.vue')
  },
  {
    path: '/pages/property/printSmallAccountReceipt',
    name: '/pages/property/printSmallAccountReceipt',
    component: () => import('@/views/account/printSmallAccountReceiptList.vue')
  },
  {
    path: '/pages/property/printRepairDetail',
    name: '/pages/property/printRepairDetail',
    component: () => import('@/views/work/printRepairDetailList.vue')
  },
  {
    path: '/pages/property/printCommonReportTable',
    name: '/pages/property/printCommonReportTable',
    component: () => import('@/views/report/printCommonReportTableList.vue')
  },
  {
    path: '/pages/property/printAllocationStorehouse',
    name: '/pages/property/printAllocationStorehouse',
    component: () => import('@/views/resource/printAllocationStorehouseList.vue')
  },
  {
    path: '/pages/property/printAssetInventoryInStock',
    name: '/pages/property/printAssetInventoryInStock',
    component: () => import('@/views/resource/printAssetInventoryInStockList.vue')
  },
  {
    path: '/views/fee/printOweFee',
    name: '/views/fee/printOweFee',
    component: () => import('@/views/fee/printOweFeeList.vue')
  },
  {
    path: '/pages/property/printPurchaseApply',
    name: '/views/resource/printPurchaseApply',
    component: () => import('@/views/resource/printPurchaseApply.vue')
  },
  {
    path: '/pages/property/printPurchaseOutApply',
    name: '/views/resource/printPurchaseOutApply',
    component: () => import('@/views/resource/printPurchaseOutApply.vue')
},
]

const router = new VueRouter({
  routes
})

// 路由守卫
router.beforeEach((to, from, next) => {
  // 排除静态资源路径
  if (to.path.startsWith('/img/') || to.path.startsWith('/static/') || to.path.startsWith('/js/') || to.path.startsWith('/css/')) {
    return next(); // 直接放行
  }
  if (to.path.startsWith('/formjs/') || to.path.startsWith('/bpmnjs/')
    || to.path.startsWith('/components/frame/')
    || to.path.startsWith('/bigScreen/')) {
    return next(); // 直接放行
  }
  if (to.path.endsWith('.xlsx')) {
    return next(); // 直接放行
  }
  const token = localStorage.getItem('token')
  if (to.path !== '/views/user/login' && !token) {
    next('/views/user/login')
  } else {
    let _title = to.meta.title;
    if (!_title) {
      _title = '物业管理系统'
    } else {
      _title = _title + ' - 物业管理系统'
    }
    document.title = _title
    next()
  }
})

export default router
