// eslint-disable-next-line
import {
  UserLayout,
  BasicLayout,
  RouteView,
  PageView,
  BlankLayout
} from '@/layouts'

export const asyncRouterMap = [{
  path: '/',
  name: 'index',
  component: BasicLayout,
  meta: {
    title: '运营后台'
  },
  redirect: '/home',
  children: [{
    path: '/home',
    name: 'home',
    redirect: '/home',
    component: PageView,
    meta: {
      title: '首页',
      icon: 'home'
    },
    hideChildrenInMenu: true,
    children: [{
      path: '/home',
      name: 'home',
      component: () => import(/* webpackChunkName: "home" */ '@/views/Home'),
      meta: {
        title: '首页',
        icon: 'home',
        hiddenHeaderContent: true
      }
    }]
  },
  {
    path: '/changePwd',
    name: 'changePwd',
    hidden: true,
    component: () => import(/* webpackChunkName: "changePwd" */ '@/views/user/ChangePwd'),
    meta: {
      title: '修改密码',
      icon: 'home'
    }
  },
  {
    path: '/map',
    name: 'map',
    redirect: '/map',
    component: PageView,
    meta: {
      title: '网点地图',
      icon: 'global',
      permission: 'M_map'
    },
    hideChildrenInMenu: true,
    children: [{
      path: '/map',
      name: 'map',
      redirect: '/map/NodeMap',
      component: RouteView,
      meta: {
        title: '网点地图',
        icon: 'global',
        permission: 'M_map'
      },
      hideChildrenInMenu: true,
      children: [{
        path: '/map/NodeMap',
        name: 'NodeMap',
        component: () => import(/* webpackChunkName: "map" */ '@/views/map/NodeMap.vue'),
        meta: {
          title: '网点地图',
          icon: 'global',
          hidden: true
        }
      }]
    }]
  },
  {
    path: '/dataView',
    name: 'dataView',
    redirect: '/dataView',
    component: PageView,
    meta: {
      title: '大数据看板',
      icon: 'fund'
      // permission: 'M_dataView'
    },
    hideChildrenInMenu: true,
    children: [{
      path: '/dataView',
      name: 'dataView',
      redirect: '/dataView/board',
      component: RouteView,
      meta: {
        title: '大数据看板',
        icon: 'fund',
        permission: 'M_map'
      },
      hideChildrenInMenu: true,
      children: [{
        path: '/dataView/board',
        name: 'dataViewBoard',
        component: () => import(/* webpackChunkName: "map" */ '@/views/dataView/borard.vue'),
        meta: {
          title: '大数据看板',
          icon: 'fund',
          hidden: true,
          hiddenHeaderContent: true
        }
      }]
    }]
  },
  {
    path: '/shop',
    redirect: '/shop/goods',
    component: PageView,
    meta: {
      title: '商品',
      icon: 'shop',
      permission: 'M_shop'
    },
    children: [{
      path: '/shop/goods',
      redirect: '/shop/goods/list',
      name: 'goodsList',
      component: RouteView,
      meta: {
        title: '商品管理',
        icon: 'shopping',
        permission: 'M_goodsManage_list'
      },
      hideChildrenInMenu: true,
      children: [{
        path: '/shop/goods/list',
        name: 'goodsListList',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsList.vue'),
        meta: {
          title: '商品列表',
          icon: 'shopping',
          hidden: true,
          permission: 'M_goodsManage_list'
        }
      },
      {
        path: '/shop/goods/add',
        name: 'goodsListAdd',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsEdit.vue'),
        meta: {
          title: '新增商品',
          icon: 'shopping',
          hidden: true,
          permission: 'B_goodsManage_add'
        }
      },
      {
        path: '/shop/goods/edit/:id',
        name: 'goodsListEdit',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsEdit.vue'),
        meta: {
          title: '编辑商品',
          icon: 'shopping',
          hidden: true,
          permission: 'B_goodsManage_edit'
        }
      }
      ]
    },
    {
      path: '/shop/goodsShelves',
      name: 'goodsShelves',
      component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsShelves.vue'),
      meta: {
        title: '商品排序',
        icon: 'flag',
        permission: 'M_goodsShelves_0'
      }
    },
    {
      path: '/shopSetting/goodsClass',
      name: 'goodsClass',
      component: () => import(/* webpackChunkName: "shop" */ '@/views/shopSetting/goodsClass.vue'),
      meta: {
        title: '商品分类管理',
        icon: 'folder',
        permission: 'M_goodsClass_list'
      }
    }
    ]
  },
  {
    path: '/order',
    redirect: '/order/orderManage',
    component: PageView,
    meta: {
      title: '订单',
      icon: 'profile',
      permission: 'M_orderManage_list'
    },
    children: [{
      path: '/order/orderManage',
      redirect: '/order/orderManage/list',
      name: 'orderManage',
      component: RouteView,
      meta: {
        title: '订单管理',
        icon: 'profile',
        permission: 'M_orderManage_list'
      },
      hideChildrenInMenu: true,
      children: [{
        path: '/order/orderManage/list',
        name: 'orderManageList',
        component: () => import(/* webpackChunkName: "order" */ '@/views/shop/shopOrder.vue'),
        meta: {
          title: '订单列表',
          icon: 'shopping',
          hidden: true,
          permission: 'M_orderManage_list'
        }
      },
      {
        path: '/order/orderManage/detail/:id',
        name: 'orderManageDetail',
        component: () => import(/* webpackChunkName: "order" */ '@/views/shop/orderDetail.vue'),
        meta: {
          title: '订单详情',
          icon: 'profile',
          hidden: true,
          permission: 'B_orderManage_detail'
        }
      }
      ]
    }]
  },
  // 用户
  {
    path: '/userInfo',
    redirect: '/userInfo/userManage',
    component: PageView,
    meta: {
      title: '用户',
      icon: 'user',
      permission: 'M_user'
    },
    children: [{
      path: '/userInfo/userManage',
      redirect: '/userInfo/userManageList/list',
      name: 'userManageS',
      component: RouteView,
      meta: {
        title: '用户管理',
        icon: 'user',
        permission: 'M_user_userManage_list'
      },
      hideChildrenInMenu: true,
      children: [{
        path: '/userInfo/userManageList/list',
        name: 'userManageList',
        component: () => import(/* webpackChunkName: "userManageList" */ '@/views/userInfo/userManageList.vue'),
        meta: {
          title: '用户列表',
          icon: 'team',
          hidden: true,
          permission: 'M_user_userManage_list'
        }
      },
      {
        path: '/userInfo/userManageList_user/detail/:id',
        name: 'userManageDetail',
        component: () => import(/* webpackChunkName: "userManageDetail" */ '@/views/userInfo/userDetails.vue'),
        meta: {
          title: '用户详情',
          icon: 'profile',
          hidden: true,
          permission: 'B_user_userManage_userDetails'
        }
      },
      {
        path: '/userInfo/userManageList_Ld/detail',
        name: 'ledouDetail',
        component: () => import(/* webpackChunkName: "LdDetails" */ '@/views/userInfo/LdDetails.vue'),
        meta: {
          title: '乐豆明细',
          icon: 'profile',
          hidden: true,
          permission: 'B_user_userManage_LdDetails'
        }
      }
      ]
    },
    {
      path: '/userInfo/allLdDetail',
      name: 'allLdDetail',
      component: () => import(/* webpackChunkName: "releaseRecord" */ '@/views/userInfo/allLdDetail.vue'),
      meta: {
        title: '乐豆明细',
        icon: 'profile',
        permission: 'M_allLdDetail'
      }
    },
    {
      path: '/userInfo/releaseRecord/list',
      name: 'releaseRecordList',
      component: () => import(/* webpackChunkName: "releaseRecord" */ '@/views/releaseRecord/releaseRecordList.vue'),
      meta: {
        title: '投放记录',
        icon: 'container',
        permission: 'M_user_releaseRecord'
      }
    }
    ]
  },
  // 清运管理
  {
    path: '/cleanManage',
    redirect: '/cleanManage/statisticalReport',
    component: PageView,
    meta: {
      title: '清运管理',
      icon: 'car',
      permission: 'M_cleanManage'
    },
    children: [{
      path: '/cleanManage/statisticalReport',
      name: 'statisticalReport',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/cleanManage/statisticalReport.vue'),
      meta: {
        title: '统计报表',
        icon: 'bar-chart',
        permission: 'M_statisticalReport'
      }
    },
    {
      path: '/cleanManage/driverManage',
      name: 'driverManage',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/cleanManage/driverManage.vue'),
      meta: {
        title: '司机管理',
        icon: 'contacts',
        permission: 'M_driverManage_list'
      }
    },
    {
      path: '/cleanManage/cleanDetail',
      name: 'cleanDetail',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/cleanManage/cleanDetail.vue'),
      meta: {
        title: '清运明细',
        icon: 'unordered-list',
        permission: 'M_cleanDetail_list'
      }
    },
    {
      path: '/cleanManage/netWorkCleanRecord',
      name: 'netWorkCleanRecord',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/cleanManage/netWorkCleanRecord.vue'),
      meta: {
        title: '网点清运记录',
        icon: 'line-chart',
        permission: 'M_netWorkCleanRecord_list'
      }
    },
    {
      path: '/cleanManage/notCleanNetwork',
      name: 'notCleanNetwork',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/cleanManage/notCleanNetwork.vue'),
      meta: {
        title: '待清运清单',
        icon: 'cluster',
        permission: 'M_notCleanNetwork_list'
      }
    }
    ]
  },
  // 报表
  {
    path: '/reportForm',
    redirect: '/reportForm/rubbishDeliverySearchTime',
    component: PageView,
    meta: {
      title: '报表',
      icon: 'line-chart',
      permission: 'M_reportForm'
    },
    children: [{
      path: '/reportForm/rubbishDeliverySearchTime',
      name: 'rubbishDeliverySearchTime',
      component: () => import(/* webpackChunkName: "reportForm" */
        '@/views/reportForm/rubbishDeliverySearchTime.vue'),
      meta: {
        title: '垃圾投递分时查询表',
        icon: 'file-done',
        permission: 'M_rubbishSearchTime_list'
      }
    },
    {
      path: '/reportForm/rubbishDeliveryTotal',
      name: 'rubbishDeliveryTotal',
      component: () => import(/* webpackChunkName: "reportForm" */ '@/views/reportForm/rubbishDeliveryTotal.vue'),
      meta: {
        title: '垃圾投递汇总表',
        icon: 'snippets',
        permission: 'M_rubbishTotal_list'
      }
    },
    {
      path: '/reportForm/unRecyclableRubbishTotal',
      name: 'unRecyclableRubbishTotal',
      component: () => import(/* webpackChunkName: "reportForm" */ '@/views/reportForm/unRecyclableRubbishTotal.vue'),
      meta: {
        title: '非可回收垃圾汇总表',
        icon: 'bar-chart'
        // permission: 'M_rubbishTotal_list'
      }
    },
    {
      path: '/reportForm/unRecyclableRubbishDetails',
      name: 'unRecyclableRubbishDetails',
      component: () => import(/* webpackChunkName: "reportForm" */ '@/views/reportForm/unRecyclableRubbishDetails.vue'),
      meta: {
        title: '非可回收垃圾明细',
        icon: 'fund'
        // permission: 'M_rubbishTotal_list'
      }
    }
    ]
  },
  {
    path: '/market',
    redirect: '/market/winingRecord',
    component: PageView,
    meta: {
      title: '营销',
      icon: 'gift',
      permission: 'M_market'
    },
    children: [{
      path: '/market/winingRecord',
      name: 'winingRecord',
      component: () => import(/* webpackChunkName: "market" */ '@/views/market/winingRecord.vue'),
      meta: {
        title: '中奖记录',
        icon: 'file-done',
        permission: 'M_winingRecord'
      }
    },
    {
      path: '/market/lotterySettings',
      name: 'lotterySettings',
      component: () => import(/* webpackChunkName: "market" */ '@/views/market/lotterySettings.vue'),
      meta: {
        title: '大转盘设置',
        icon: 'edit',
        permission: 'M_lottery_list'
      }
    },
    // {
    //   path: '/market/luckDrawRecord',
    //   name: 'luckDrawRecord',
    //   component: () => import(/* webpackChunkName: "market" */ '@/views/market/luckDrawRecord.vue'),
    //   meta: {
    //     title: '抽奖记录',
    //     icon: 'profile'
    //     // permission: 'M_lottery_list'
    //   }
    // },
    {
      path: '/market/giftCard',
      name: 'giftCardManage',
      component: () => import(/* webpackChunkName: "market" */ '@/views/market/giftCard/giftCard.vue'),
      meta: {
        title: '礼品卡管理',
        icon: 'credit-card',
        permission: 'M_giftCard_list'
      }
    }
    ]
  },
  {
    path: '/shopSetting',
    redirect: '/shopSetting/bannerSetting',
    component: PageView,
    meta: {
      title: '商城设置',
      icon: 'appstore',
      permission: 'M_AdBanner_list'
    },
    children: [{
      path: '/shopSetting/bannerSetting',
      name: 'bannerSetting',
      component: () => import(/* webpackChunkName: "shopSetting" */ '@/views/shop/bannerSetting.vue'),
      meta: {
        title: '推广位设置',
        icon: 'picture',
        permission: 'M_AdBanner_list'
      }
    }]
  },
  {
    path: '/equipmentManage',
    redirect: '/equipmentManage/network',
    component: PageView,
    meta: {
      title: '网点/设备',
      icon: 'apartment',
      permission: 'M_networkEquipment'
    },
    children: [{
      path: '/equipmentManage/network',
      name: 'network',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/network/network.vue'),
      meta: {
        title: '网点管理',
        icon: 'cluster',
        permission: 'M_network_list'
      }
    },
    {
      path: '/equipmentManage/collector',
      name: 'collector',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/collector/collector.vue'),
      meta: {
        title: '采集员管理',
        icon: 'team'
        // permission: 'M_network_list'
      }
    },
    {
      path: '/equipmentManage/labelSetting',
      name: 'labelSetting',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/labelSetting/labelSetting.vue'),
      meta: {
        title: '网点标签管理',
        icon: 'link',
        permission: 'M_labelSetting_list'
      }
    },
    {
      path: '/equipmentManage/equipment',
      name: 'equipment',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/equipment/equipment.vue'),
      meta: {
        title: '回收箱体管理',
        icon: 'usb',
        permission: 'M_equipment_list'
      }
    },
    {
      path: '/equipmentManage/electronicScale',
      name: 'electronicScale',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/electronicScale/electronicScale.vue'),
      meta: {
        title: '电子秤管理',
        icon: 'dashboard',
        permission: 'M_electronicScale_list'
      }
    },
    {
      path: '/equipmentManage/boxSetting',
      name: 'boxSetting',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/boxSetting/boxSetting.vue'),
      meta: {
        title: '箱体类型设置',
        icon: 'block',
        permission: 'M_boxSetting_list'
      }
    },
    {
      path: '/equipmentManage/exchangeSetting',
      name: 'exchangeSetting',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/exchangeSetting/ExchangeSetting.vue'),
      meta: {
        title: '兑换规则设置',
        icon: 'build',
        permission: 'M_exchangeSetting_list'
      }
    },
    {
      path: '/equipmentManage/openTimeSetting',
      name: 'openTimeSetting',
      component: () => import(/* webpackChunkName: "equipmentManage" */
        '@/views/equipmentManage/openTimeSetting/OpenTimeSetting.vue'),
      meta: {
        title: '投放时间设置',
        icon: 'dashboard',
        permission: 'M_openTimeSetting_list'
      }
    }
    ]
  },
  {
    path: '/businessManage',
    redirect: '/businessManage/partnerManage',
    component: PageView,
    meta: {
      title: '乐享亭',
      icon: 'bank',
      permission: 'M_businessManage'
    },
    children: [{
      path: '/businessManage/partnerManage',
      name: 'partnerManage',
      component: () => import(/* webpackChunkName: "businessManage" */
        '@/views/businessManage/partnerManage/partnerManage.vue'),
      meta: {
        title: '商户管理',
        icon: 'solution',
        permission: 'M_partnerManage_list'
      }
    },
    {
      path: '/businessManage/userManage',
      name: 'userManage',
      component: () => import(/* webpackChunkName: "businessManage" */
        '@/views/businessManage/userManage/userManage.vue'),
      meta: {
        title: '用户管理',
        icon: 'folder',
        permission: 'M_userManage_list'
      }
    },
    {
		  path: '/businessManage/ledouCollectRecord',
		  name: 'ledouCollectRecord',
		  component: () => import(/* webpackChunkName: "businessManage" */
		    '@/views/businessManage/ledouCollectRecord/ledouCollectRecord.vue'),
		  meta: {
		    title: '乐豆收取记录',
		    icon: 'bar-chart',
		    permission: 'M_ledouCollectRecord_list'
		  }
    },
    {
      path: '/businessManage/leduQuery',
      name: 'leduQuery',
      component: () => import(/* webpackChunkName: "businessManage" */
        '@/views/businessManage/leduQuery/leduQuery.vue'),
      meta: {
        title: '商户乐豆统计',
        icon: 'search',
        permission: 'M_ledouTjList'
      }
    }
    ]
  },
  {
    path: '/supplier',
    redirect: '/supplier/list',
    component: PageView,
    meta: {
      title: '供货商',
      icon: 'user-add',
      permission: 'M_supplier_list'
    },
    children: [{
      path: '/supplier/list',
      name: 'supplier',
      component: () => import(/* webpackChunkName: "supplier" */ '@/views/shopSetting/supplier.vue'),
      meta: {
        title: '供货商管理',
        icon: 'solution',
        permission: 'M_supplier_list'
      }
    }]
  },
  // auth
  {
    path: '/auth',
    redirect: '/auth/userList',
    component: PageView,
    meta: {
      title: '权限管理',
      icon: 'lock',
      permission: 'M_auth_0'
    },
    children: [{
      path: '/auth/userList',
      name: 'powerUserList',
      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
      meta: {
        title: '用户管理',
        icon: 'user',
        permission: 'M_power_user_list'
      }
    },
    {
      path: '/auth/roleList',
      name: 'powerRoleList',
      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
      meta: {
        title: '角色管理',
        icon: 'solution',
        permission: 'M_power_role_list'
      }
    },
    {
      path: '/menusAuth/menu',
      name: 'powerMenu',
      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/menu/menu.vue'),
      meta: {
        title: '菜单管理',
        icon: 'profile',
        permission: 'M_power_menu_list'
      }
    }
    ]
  },
  {
    path: '/setting',
    redirect: '/setting/userList',
    component: PageView,
    meta: {
      title: '系统设置',
      icon: 'setting',
      permission: 'M_setting_0'
    },
    children: [{
      path: '/setting/dataDictionary',
      name: 'powerDD',
      component: () => import(/* webpackChunkName: "setting" */
        '@/views/power/dataDictionary/dataDictionary.vue'),
      meta: {
        title: '数据字典管理',
        icon: 'database',
        permission: 'M_sys_dataDictionary'
      }
    },
    {
      path: '/setting/OperateJournal',
      name: 'powerOperateJournal',
      component: () => import(/* webpackChunkName: "setting" */
        '@/views/power/OperateJournal/OperateJournal.vue'),
      meta: {
        title: '操作日志',
        icon: 'read',
        permission: 'M_OperateJournal'
      }
    }
    ]
  }
  ]
},
{
  path: '*',
  redirect: '/404',
  hidden: true
}
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
  path: '/user',
  component: UserLayout,
  redirect: '/user/login',
  hidden: true,
  children: [{
    path: 'login',
    name: 'login',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  },
  {
    path: 'register',
    name: 'register',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  },
  {
    path: 'register-result',
    name: 'registerResult',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  },
  {
    path: 'recover',
    name: 'recover',
    component: undefined
  }
  ]
},
{
  path: '/404',
  component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
}

]
