import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
let routes = [
  {
    path: '/',
    name: 'init',
    component: () => import('@/view/init'),
    label: '初始化',
    need_login: false
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/components/user/index'),
    label: '首页',
    need_login: true
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/components/user/login'),
    label: '用户登录',
    need_login: false
  },
	{
		path: '/noAccess',
		name: 'noAccess',
		component: () => import(/* webpackChunkName: "noAccess" */'@/view/noAccess'),
    label: '无权限',
    need_login: false
	},
  // {
  //   path: '/login/:token',
  //   name: 'login',
  //   component: () => import('@/components/user/login'),
  //   label: '用户登录',
  //   need_login: false
  // },
  // {
  //   path: '/invite_reg',
  //   name: 'invite_reg',
  //   component: () => import('@/components/user/invite_reg'),
  //   label: '用户注册',
  //   need_login: false
  // },
  {
    path: '/user_setting',
    name: 'user_setting',
    component: () => import('@/components/user/user_setting'),
    label: '会员设置',
    need_login: true
  },
  {
    path: '/work',
    name: 'work',
    component: () => import('@/components/body/work'),
    label: '全部应用',
    need_login: true
  },
  // {
  //   path: '/account',
  //   name: 'account',
  //   component: () => import('@/components/user/account'),
  //   label: '个人信息',
  //   need_login: true
  // },

  {
    path: '/task_hall',
    name: 'task_hall',
    component: () => import('@/components/task/task_hall'),
    label: '任务大厅',
    need_login: true
  },
  {
    path: '/compile_temp_task',
    name: 'compile_temp_task',
    component: () => import('@/components/task/compile_temp_task'),
    label: '编辑悬赏任务',
    need_login: true
  },
  {
    path: '/temp_task',
    name: 'temp_task',
    component: () => import('@/components/task/temp_task'),
    label: '发布悬赏任务',
    need_login: true
  },
  {
    path: '/my_ticket',
    name: 'my_ticket',
    component: () => import('@/components/integral/my_ticket'),
    label: '我的奖票',
    need_login: true
  },
  {
    path: '/issue_lottery_ticket',
    name: 'issue_lottery_ticket',
    component: () => import('@/components/integral/issue_lottery_ticket'),
    label: '发放奖票',
    need_login: true
  },
  {
    path: '/ticket_statistics',
    name: 'ticket_statistics',
    component: () => import('@/components/integral/ticket_statistics'),
    label: '奖票统计',
    need_login: true
  },
  {
    path: '/ticket_personal_detail',
    name: 'ticket_personal_detail',
    component: () => import('@/components/integral/ticket_personal_detail'),
    label: '个人的奖票详情',
    need_login: true
  },
  {
    path: '/temp_task_edit',
    name: 'temp_task_edit',
    component: () => import('@/components/task/temp_task_edit'),
    label: '修改悬赏任务',
    need_login: true
  },
  {
    path: '/callback',
    name: 'callback',
    component: () => import('@/components/integral/callback'),
    label: '操作完成',
    need_login: true
  },
  {
    path: '/callback_new',
    name: 'callback_new',
    component: () => import('@/components/integral/callback_new'),
    label: '申请结果',
    need_login: true
  },
  {
    path: '/add_common_menu',
    name: 'add_common_menu',
    component: () => import('@/components/user/add_common_menu'),
    label: '添加常用应用',
    need_login: true
  },
  // {
  //   path: '/push_card',
  //   name: 'push_card',
  //   component: () => import('@/components/attendance/index'),
  //   label: '考勤打卡',
  //   need_login: true
  // },
  // {
  //   path: '/remedy',
  //   name: 'remedy',
  //   component: () => import('@/components/attendance/remedy'),
  //   label: '补卡申请',
  //   need_login: true
  // },

  {
    path: '/scanqr',
    name: 'scanqr',
    component: () => import('@/components/scan_qr'),
    label: '扫描二维码',
    need_login: true
  },
  {
    path: '/create_company',
    name: 'create_company',
    component: () => import('@/components/create_company'),
    label: '创建组织',
    need_login: false
  },
  {
    path: '/join_company',
    name: 'join_company',
    component: () => import('@/components/join_company'),
    label: '加入组织',
    need_login: false
  },
  {
    path: '/employee_info',
    name: 'employee_info',
    component: () => import('@/components/ems/employee_info'),
    label: '员工信息',
    need_login: true
  },
  {
    path: '/employee_invite',
    name: 'employee_invite',
    component: () => import('@/components/ems/invite'),
    label: '邀请成员',
    need_login: true
  },
  {
    path: '/employee_edit',
    name: 'employee_edit',
    component: () => import('@/components/ems/employee_edit'),
    label: '修改员工信息',
    need_login: true
  },

  // {
  //   path: '/about',
  //   name: 'about',
  //   component: () => import('@/components/about/about'),
  //   label: '关于',
  //   need_login: true
  // },
  // {
  //   path: '/username_edit',
  //   name: 'username_edit',
  //   component: () => import('@/components/user/username_edit'),
  //   label: '修改姓名',
  //   need_login: true
  // },
  {
    path: '/user_mobile',
    name: 'user_mobile',
    component: () => import('@/components/user/user_mobile'),
    label: '绑定手机',
    need_login: true
  },
  {
    path: '/safe',
    name: 'safe',
    component: () => import('@/components/user/safe'),
    label: '安全中心',
    need_login: true
  },
  {
    path: '/help',
    name: 'help',
    component: () => import('@/components/help'),
    label: '帮助中心',
    need_login: true
  },
  // {
  //   path: '/change_phone',
  //   name: 'change_phone',
  //   component: () => import('@/components/user/change_phone'),
  //   label: '修改手机号',
  //   need_login: true
  // },
  // {
  //   path: '/company_list',
  //   name: 'company_list',
  //   component: () => import('@/components/ems/company_list'),
  //   label: '我的组织',
  //   need_login: true
  // },
  // {
  //   path: '/login_company_list',
  //   name: 'login_company_list',
  //   component: () => import('@/components/ems/login_company_list'),
  //   label: '选择组织',
  //   need_login: false
  // },
  // {
  //   path: '/change_pwd',
  //   name: 'change_pwd',
  //   component: () => import('@/components/user/change_pwd'),
  //   label: '修改密码',
  //   need_login: true
  // },
  // 用户服务协议
  {
    path: '/user_agreement',
    name: 'user_agreement',
    component: () => import('@/components/user/user_agreement'),
    label: '用户服务协议',
    need_login: false
  },
  // 隐私协议
  {
    path: '/privacy_agreement',
    name: 'privacy_agreement',
    component: () => import('@/components/user/privacy_agreement'),
    label: '隐私协议',
    need_login: false
  },
  {
    path: '/TaskPointRatingSet',
    name: 'TaskPointRatingSet',
    component: () => import('@/components/task/TaskPointRatingSet'),
    label: '评分标准',
    need_login: true
  },
  // {
  //   path: '/comment',
  //   name: 'comment',
  //   component: () => import('@/components/user/comment'),
  //   label: '建议反馈',
  //   need_login: true
  // },
  // {
  //   path: '/version',
  //   name: 'version',
  //   component: () => import('@/components/about/version'),
  //   label: '版本更新',
  //   need_login: true
  // },
  // {
  //   path: '/version_info',
  //   name: 'version_info',
  //   component: () => import('@/components/about/version_info'),
  //   label: '更新内容',
  //   need_login: true
  // },
  {
    path: '/event_list',
    name: 'event_list',
    component: () => import('@/components/integral/event_list'),
    label: '积分事件',
    need_login: true
  },
  {
    path: '/integralDetail',
    name: 'integralDetail',
    component: () => import('@/components/integral/integralDetail'),
    label: '积分明细列表',
    need_login: true
  },
  {
    path: '/event_detail',
    name: 'event_detail',
    component: () => import('@/components/integral/event_detail'),
    label: '积分详情',
    need_login: true
  },
  // {
  //   path: '/forget_pwd',
  //   name: 'forget_pwd',
  //   component: () => import('@/components/user/forget_pwd'),
  //   label: '找回密码',
  //   need_login: false
  // }, 
  // {
  //   path: '/bind_weixin',
  //   name: 'bind_weixin',
  //   component: () => import('@/components/user/bind_weixin'),
  //   label: '绑定微信',
  //   need_login: false
  // },
  {
    path: '/help_detail',
    name: 'help_detail',
    component: () => import('@/components/help_detail'),
    label: '教程内容',
    need_login: true
  },
  {
    path: '/help_detail1',
    name: 'help_detail1',
    component: () => import('@/components/help_detail'),
    label: '教程内容',
    need_login: true
  },
  {
    path: '/department',
    name: 'department',
    component: () => import('@/components/body/department'),
    label: '组织架构',
    need_login: true
  },
  {
    path: '/empty',
    name: 'empty',
    component: () => import('@/components/error/empty'),
    label: '空',
    need_login: false
  },
  {
    path: '*',
    name: 'error404',
    component: () => import('@/components/error/404'),
    label: '找不到页面',
    need_login: false
  },

  // 20200227 xmx 新添加

  // 部门
  {
    path: '/dept',
    name: 'dept',
    component: () => import('@/components/ems/dept'),
    label: '部门',
    need_login: true
  },

  // 邀请新企业加入
  // {
  //   path: '/invite_newbusiness',
  //   name: 'invite_newbusiness',
  //   component: () => import('@/components/ems/invite_newbusiness'),
  //   label: '邀请成员',
  // },
  // 公司信息
  {
    path: '/company_info',
    name: 'company_info',
    component: () => import('@/components/ems/company_info'),
    label: '公司信息',
    need_login: true
  },
  // 添加员工
  {
    path: '/employee_add',
    name: 'employee_add',
    component: () => import('@/components/ems/employee_add'),
    label: '添加员工',
    need_login: true
  },

  // 员工信息
  {
    path: '/employee_info',
    name: 'employee_info',
    component: () => import('@/components/ems/employee_info'),
    label: '添加人员',
    need_login: true
  },
  // 新成员
  {
    path: '/new_employee',
    name: 'new_employee',
    component: () => import('@/components/ems/new_employee'),
    label: '新成员审批',
    need_login: true
  },
  //团队PK页面
  {
    path: '/list_pk',
    name: 'list_pk',
    component: () => import('@/components/pk/list_pk'),
    label: '团队PK',
    need_login: true
  },
  // 创建PK
  {
    path: '/create_pk',
    name: 'create_pk',
    component: () => import('@/components/pk/create_pk'),
    label: '创建PK',
    need_login: true
  },
  // 修改PK
  {
    path: '/edit_pk',
    name: 'edit_pk',
    component: () => import('@/components/pk/edit_pk'),
    label: 'PK设置',
    need_login: true
  },
  // 查看PK
  {
    path: '/read_pk',
    name: 'read_pk',
    component: () => import('@/components/pk/read_pk'),
    label: '查看pK',
    need_login: true
  },
  // 录入积分
  {
    path: '/add_log',
    name: 'add_log',
    component: () => import('@/components/pk/add_log'),
    label: '录入PK积分',
    need_login: true
  },
  // 积分录入
  {
    path: '/integral_approval',
    name: 'integral_approval',
    component: () => import('@/components/integral/integral_approval'),
    label: '审批',
    need_login: true
  },
  {
    path: '/integral_approval_performance',
    name: 'integral_approval_performance',
    component: () => import('@/components/integral/application_popup/performance'),
    label: '审批',
    need_login: true
  },
  {
    path: '/package_approval',
    name: 'package_approval',
    component: () => import('@/components/task/package_approval'),
    label: '绩效审批',
    need_login: true
  },
  {
    path: '/integral_approval_integral',
    name: 'integral_approval_integral',
    component: () => import('@/components/integral/application_popup/integral'),
    label: '审批',
    need_login: true
  },
  {
    path: '/integral_entry',
    name: 'integral_entry',
    component: () => import('@/components/integral/integral_entry'),
    label: '录入A分',
    need_login: true
  },
  // 临时任务
  {
    path: '/short_task',
    name: 'short_task',
    component: () => import('@/components/task/short_task'),
    label: '临时任务',
    need_login: true
  },
  // 编辑临时任务
  {
    path: '/compile_task',
    name: 'compile_task',
    component: () => import('@/components/task/compile_task'),
    label: '编辑临时任务',
    need_login: true
  },
  // 绩效工作
  {
    path: '/efficiency_create',
    name: 'efficiency_create_package',
    component: () => import('@/components/task/efficiency_task'),
    label: '绩效工作',
    need_login: true
  },
  {
    path: '/efficiency_edit',
    name: 'efficiency_edit',
    component: () => import('@/components/task/efficiency_task_edit'),
    label: '修改绩效工作',
    need_login: true
  },
  // 绩效评审
  {
    path: '/efficiency_review',
    name: 'efficiency_review',
    component: () => import('@/components/task/efficiency_review'),
    label: '绩效评审',
    need_login: true
  },
  // 绩效工作详情
  {
    path: '/efficiency_detail',
    name: 'efficiency_detail',
    component: () => import('@/components/task/efficiency_detail'),
    label: '绩效',
    need_login: true
  },
  // 新增绩效
  {
    path: '/efficiency_add',
    name: 'efficiency_add',
    component: () => import('@/components/task/efficiency_add'),
    label: '绩效',
    need_login: true
  },
  // 编辑绩效
  {
    path: '/compile_efficiency',
    name: 'compile_efficiency',
    component: () => import('@/components/task/compile_efficiency'),
    label: '编辑绩效工作',
    need_login: true
  },
  // 我的录入
  {
    path: '/integral_entry_list',
    name: 'integral_entry_list',
    component: () => import('@/components/integral/integral_entry_list'),
    label: '我奖扣的',
    need_login: true
  },
  // 我的审批
  {
    path: '/approval_list',
    name: 'approval_list',
    component: () => import('@/components/integral/approval_list'),
    label: '我的审批',
    need_login: true
  },
  // 批量审批
  {
    path: '/batchList',
    name: 'batchList',
    component: () => import('@/components/integral/batchList'),
    label: '批量审批',
    need_login: true
  },
  {
    path: '/taskFile',
    name: 'taskFile',
    component: () => import('@/components/integral/taskFile'),
    label: '工作详情',
    need_login: true
  },
  {
    path: '/remberOne',
    name: 'remberOne',
    component: () => import('@/components/integral/remberOne'),
    label: '记一条',
    need_login: true
  },
  {
    path: '/remberPoint',
    name: 'remberPoint',
    component: () => import('@/components/integral/remberPoint'),
    label: '记分',
    need_login: true
  },
  {
    path: '/process',
    name: 'process',
    component: () => import('@/components/integral/process'),
    label: '更新进度',
    need_login: true
  },

  // AB分录入列表详情
  {
    path: '/approval_detail',
    name: 'approval_detail',
    component: () => import('@/components/integral/approval_detail'),
    label: 'AB分审核列表',
    need_login: true
  },

  // 我的任务
  {
    path: '/my_task',
    name: 'my_task',
    component: () => import('@/components/task/my_task'),
    label: '我的任务',
    need_login: true
  },
  // 我发布的
  {
    path: '/my_publish',
    name: 'my_publish',
    component: () => import('@/components/task/my_publish'),
    label: '我发布的',
    need_login: true
  },
  // 重复任务
  {
    path: '/repetitive_tasks',
    name: 'repetitive_tasks',
    component: () => import('@/components/task/repetitive_tasks'),
    label: '重复任务',
    need_login: true
  },
  // 重复任务详情
  {
    path: '/repetitive_tasks_detail',
    name: 'repetitive_tasks_detail',
    component: () => import('@/components/task/repetitive_tasks_detail'),
    label: '重复任务详情',
    need_login: true
  },
  // 任务详情
  {
    path: '/task_detail',
    name: 'task_detail',
    component: () => import('@/components/task/task_detail'),
    label: '任务详情',
    need_login: true
  },

  // 用户权限设置
  {
    path: '/edit_user_power',
    name: 'edit_user_power',
    component: () => import('@/components/power/edit_user_power'),
    label: '设置权限',
    need_login: true
  },

  // 用户管理范围
  {
    path: '/power_range',
    name: 'power_range',
    component: () => import('@/components/power/power_range'),
    label: '用户管理范围',
    need_login: true
  },
  {
    path: '/manager_list',
    name: 'manager_list',
    component: () => import('@/components/ems/manager_list'),
    label: '全部管理者',
    need_login: true
  },
  {
    path: '/manager_detail',
    name: 'manager_detail',
    component: () => import('@/components/ems/manager_detail'),
    label: '管理者权限',
    need_login: true
  },

  {
    path: '/performance_list',
    name: 'performance_list',
    component: () => import('@/components/task/performance_list'),
    label: '员工绩效',
    need_login: true
  },

  {
    path: '/integral_application_list',
    name: 'integral_application_list',
    component: () => import('@/components/integral/integral_application_list'),
    label: '积分申请列表',
    need_login: true
  },
  {
    path: '/integral_entry_b',
    name: 'integral_entry_b',
    component: () => import('@/components/integral/integral_entry_b'),
    label: '录入积分',
    need_login: true
  },
  {
    path: '/integral_entry_n',
    name: 'integral_entry_n',
    component: () => import('@/components/integral/integral_entry_n'),
    label: '录入积分',
    need_login: true
  },
  // 我的排名
  {
    path: '/my_ranking',
    name: 'my_ranking',
    component: () => import('@/components/integral/my_ranking'),
    label: '我的排名',
    need_login: true
  },
  {
    path: '/statistics_personal',
    name: 'statistics_personal',
    component: () => import('@/components/integral/statistics_personal'),
    label: '我的排名详情',
    need_login: true
  },
  {
    path: '/ranking_detail',
    name: 'ranking_detail',
    component: () => import('@/components/integral/ranking_detail'),
    label: '自定义排名',
    need_login: true
  },
  {
    path: '/manager_reward_deduction',
    name: 'manager_reward_deduction',
    component: () => import('@/components/integral/manager_reward_deduction'),
    label: '管理者奖扣',
    need_login: true
  },
  // {
  //   path: '/manager_reward_deduction',
  //   name: 'manager_reward_deduction',
  //   component: () => import('@/components/integral/manager_reward_deduction_new'),
  //   label: '管理者奖扣',
  //   need_login: true
  // },
  {
    path: '/reward_deduction_statistics',
    name: 'reward_deduction_statistics',
    component: () => import('@/components/integral/reward_deduction_statistics'),
    label: '个人奖扣详情',
    need_login: true
  },
  {
    path: '/my_statistics_personal',
    name: 'my_statistics_personal',
    component: () => import('@/components/integral/my_statistics_personal'),
    label: '个人统计',
    need_login: true
  },
  {
    path: '/statistics_personal_a',
    name: 'statistics_personal_a',
    component: () => import('@/components/integral/statistics_personal_a'),
    label: 'A分统计',
    need_login: true
  },
  {
    path: '/statistics_personal_b',
    name: 'statistics_personal_b',
    component: () => import('@/components/integral/statistics_personal_b'),
    label: 'B分统计',
    need_login: true
  },
  {
    path: '/integral_rank',
    name: 'integral_rank',
    component: () => import('@/components/integral/integral_rank'),
    label: '阶段排名',
    need_login: true
  },
  {
    path: '/rankB',
    name: 'rankB',
    component: () => import('@/components/integral/rankB'),
    label: '累计B分排名',
    need_login: true
  },
  {
    path: '/customBRank',
    name: 'customBRank',
    component: () => import('@/components/integral/customBRank'),
    label: '自定义分组B分排名',
    need_login: true
  },
  {
    path: '/customBRankItem',
    name: 'customBRankItem',
    component: () => import('@/components/integral/customBRank_item'),
    label: '自定义分组',
    need_login: true
  },
  {
    path: '/customBRankDetail',
    name: 'customBRankDetail',
    component: () => import('@/components/integral/customBRankDetail'),
    label: '分组详情',
    need_login: true
  },
  // {
  //   path: '/message_detail',
  //   name: 'message_detail',
  //   component: () => import('@/components/message_detail'),
  //   label: '消息',
  //   need_login: true
  // },
  {
    path: '/rule_category',
    name: 'rule_category',
    component: () => import('@/components/integral/rule_category'),
    label: '积分分类',
    need_login: true
  },
  {
    path: '/rule_item_add',
    name: 'rule_item_add',
    component: () => import('@/components/integral/rule_item_add'),
    label: '创建规则',
    need_login: true
  },
  {
    path: '/rule_item_edit',
    name: 'rule_item_edit',
    component: () => import('@/components/integral/rule_item_edit'),
    label: '修改规则',
    need_login: true
  },
  {

    path: '/integral_noteone',
    name: 'integral_noteone',
    component: () => import('@/components/integral/integral_noteone'),
    label: '记一条',
    need_login: true
  },
  {
    path: '/integral_apply',
    name: 'integral_apply',
    component: () => import('@/components/integral/integral_application'),
    label: '积分申请',
    need_login: true
  },
  {
    path: '/point_base',
    name: 'point_base',
    component: () => import('@/components/integral/point_base'),
    label: '基础分设置',
    need_login: true
  },
  {
    path: '/senior_base',
    name: 'senior_base',
    component: () => import('@/components/integral/senior_base'),
    label: '工龄分设置',
    need_login: true
  },
  {
    path: '/automatic',
    name: 'automatic',
    component: () => import('@/components/integral/automatic'),
    label: '自动积分',
    need_login: true
  },
  {
    path: '/rule_category_add',
    name: 'rule_category_add',
    component: () => import('@/components/integral/rule_category_add'),
    label: '创建积分分类',
    need_login: true
  },
  {
    path: '/rule_category_edit',
    name: 'rule_category_edit',
    component: () => import('@/components/integral/rule_category_edit'),
    label: '修改积分分类',
    need_login: true
  },
  {
    path: '/demo_list',
    name: 'demo_list',
    component: () => import('@/components/demo/list'),
    label: '列表模板',
    need_login: true
  }, 
  // {
  //   path: '/demo_form',
  //   name: 'demo_form',
  //   component: () => import('@/components/demo/form'),
  //   label: '表单模板',
  //   need_login: true
  // }, 
  {
    path: '/demo_info',
    name: 'demo_info',
    component: () => import('@/components/demo/info'),
    label: '详情模板',
    need_login: true
  }, 
  // {
  //   path: '/demo_message_detail',
  //   name: 'demo_info',
  //   component: () => import('@/components/demo/message_detail'),
  //   label: '任务样式模板',
  //   need_login: false
  // },

  {
    path: '/team_data',
    name: 'team_data',
    component: () => import('@/components/integral/team_data'),
    label: '团队数据',
    need_login: true
  },
  // {
  //   path: '/bulletin_welfare',
  //   name: 'bulletin_welfare',
  //   component: () => import('@/components/data_mange/bulletin_welfare'),
  //   label: '公告福利',
  //   need_login: true
  // },
  // {
  //   path: '/publish_bulletin_welfare',
  //   name: 'publish_bulletin_welfare',
  //   component: () => import('@/components/data_mange/publish_bulletin_welfare'),
  //   label: '发布公告福利',
  //   need_login: true
  // },
  // {
  //   path: '/edit_bulletin_welfare',
  //   name: 'edit_bulletin_welfare',
  //   component: () => import('@/components/data_mange/publish_bulletin_welfare'),
  //   label: '编辑公告福利',
  //   need_login: true
  // },
  // {
  //   path: '/bulletin_welfare_detail',
  //   name: 'bulletin_welfare_detail',
  //   component: () => import('@/components/data_mange/bulletin_welfare_detail'),
  //   label: '公告福利详情',
  //   need_login: true
  // },
  {
    path: '/role_user_list',
    name: 'role_user_list',
    component: () => import('@/components/ems/role_user_list'),
    label: '角色管理',
    need_login: true
  },
  {
    path: '/role_permissions',
    name: 'role_permissions',
    component: () => import('@/components/power/role_permissions'),
    label: '角色授权',
    need_login: true
  },
  // {
  //   path: '/change_role',
  //   name: 'change_role',
  //   component: () => import('@/components/user/change_role'),
  //   label: '切换角色',
  //   need_login: true
  // },
  {
    path: '/check_icon',
    name: 'check_icon',
    component: () => import('@/components/user/check_icon'),
    label: '查看所有文件测试',
    need_login: true
  },
  // {
  //   path: '/android',
  //   name: 'android',
  //   component: () => import('@/view/android'),
  //   label: '下载APP',
  //   need_login: false
  // },
]
let routes_map = {}
for (let i in routes) {
  routes_map[routes[i].name] = routes[i]
}
window.$routes_map = routes_map
// window.$showBuyPopup = false

export default new Router({
  routes: routes
})
