import Vue from 'vue'
import VueRouter from 'vue-router'

//解决重复点击导航栏报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [{
		path: '/index',
		name: 'index',
		title: '初始页',
		component: () => import( /* webpackChunkName: "index" */ '@/index'),
		redirect: "home",
		children: [{
				path: '/home',
				name: 'home',
				title: '首页',
				component: () => import( /* webpackChunkName: "home" */ '@/home'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'home',
				}
			},
			{
				path: '/inform',
				name: 'inform',
				title: '通知',
				component: () => import( /* webpackChunkName: "award_punish" */ '@/inform'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'home',
				}
			},
			{
				path: '/award_punish',
				name: 'award_punish',
				title: '我奖扣的',
				component: () => import( /* webpackChunkName: "award_punish" */
					'@/views/abPoint/award_punish.vue'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'abPoint',
					jurisdiction: ['employee'] //什么权限隐藏
				}
			},
			{
				path: '/apply_list',
				name: 'apply_list',
				title: '我申请的',
				component: () => import( /* webpackChunkName: "apply_list" */ '@/views/abPoint/apply_list.vue'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'abPoint',
					jurisdiction: ['creator']
				}
			},
			{
				path: '/my_issue',
				name: 'my_issue',
				title: '我发布的',
				component: () => import( /* webpackChunkName: "my_issue" */ '@/views/task/my_issue.vue'),
				meta: {
					icon: 'icon-PC_gongzuotai_renwu',
					groupCode: 'task',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/get_task',
				name: 'get_task',
				title: '抢任务',
				component: () => import( /* webpackChunkName: "get_task" */ '@/views/task/get_task.vue'),
				meta: {
					icon: 'icon-PC_gongzuotai_renwu',
					groupCode: 'task',
				}
			},
			{
				path: '/my_task',
				name: 'my_task',
				title: '我的任务',
				component: () => import( /* webpackChunkName: "my_task" */ '@/views/task/my_task.vue'),
				meta: {
					icon: 'icon-PC_gongzuotai_renwu',
					groupCode: 'task',
					jurisdiction: ['creator']
				}
			},
			{
				path: '/myExamine',
				name: 'myExamine',
				title: '我审批的',
				component: () => import( /* webpackChunkName: "myExamine" */ '@/views/task/myExamine'),
				meta: {
					icon: 'icon-PC_gongzuotai_renwu',
					groupCode: 'task',
					jurisdiction: ['employee'] //什么权限隐藏
				}
			},
			{
				path: '/allTask',
				name: 'allTask',
				title: '全部任务',
				component: () => import( /* webpackChunkName: "allTask" */ '@/views/task/allTask'),
				meta: {
					icon: 'icon-PC_gongzuotai_renwu',
					groupCode: 'task',
					jurisdiction: ['employee'] //什么权限隐藏
				}
			},
			{
				path: '/grantAward',
				name: 'grantAward',
				title: '发放奖票',
				component: () => import(/* webpackChunkName: "print" */'@/views/award/grantAward'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'award',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/myGrantAward',
				name: 'myGrantAward',
				title: '我发放的',
				component: () => import(/* webpackChunkName: "print" */'@/views/award/myGrantAward'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'award',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/myAward',
				name: 'myAward',
				title: '我的奖票',
				component: () => import(/* webpackChunkName: "print" */'@/views/award/myAward'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'award',
					jurisdiction: []
				}
			},
			{
				path: '/print',
				name: 'print',
				title: '奖票打印',
				component: () => import(/* webpackChunkName: "print" */'@/views/award/print'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'award',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/lotteryTicket_statistics',
				name: 'lotteryTicket_statistics',
				title: '奖票统计',
				component: () => import( /* webpackChunkName: "lotteryTicket_statistics" */
					'@/views/award/lotteryTicket_statistics'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'award',
					jurisdiction: ['employee']
				}
			},

			{
				path: '/dept_rank',
				name: 'dept_rank',
				title: '阶段排名',
				component: () => import( /* webpackChunkName: "dept_rank" */ '@/views/ranking/dept_rank.vue'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'ranking',
				}
			},
			{
				path: '/JfDetail',
				name: 'JfDetail',
				title: '积分明细',
				component: () => import( /* webpackChunkName: "JfDetail" */ '@/views/ranking/JfDetail.vue'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'ranking',
					noShow: true, //不显示在导航里
				}
			},
			{
				path: '/total_rank',
				name: 'total_rank',
				title: '累计B分排名',
				component: () => import( /* webpackChunkName: "total_rank" */ '@/views/ranking/total_rank.vue'),
				meta: {
					icon: 'icon-shezhi_jiaose',
					groupCode: 'ranking',
				}
			},
			{
				path: '/custom_rank',
				name: 'custom_rank',
				title: '自定义B分排名',
				component: () => import( /* webpackChunkName: "custom_rank" */
					'@/views/ranking/custom_rank.vue'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'ranking',
				}
			},
			{
				path: '/each_rank',
				name: 'each_rank',
				title: '各项B分统计',
				component: () => import( /* webpackChunkName: "each_rank" */
					'@/views/ranking/each_rank.vue'),
				meta: {
					icon: 'icon-shezhi_jiaose',
					groupCode: 'ranking',
				}
			},
			{
				path: '/manager_statistics',
				name: 'manager_statistics',
				title: '管理者奖扣',
				component: () => import( /* webpackChunkName: "manager_statistics" */
					'@/views/ranking/manager_statistics.vue'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'ranking',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/integral_event',
				name: 'integral_event',
				title: '积分事件',
				component: () => import( /* webpackChunkName: "integral_event" */
					'@/views/ranking/integral_event.vue'),
				meta: {
					icon: 'icon-shezhi_jifenguize',
					groupCode: 'ranking',
					groupName: "统计",
				}
			},
			{
				path: '/integral_event_two',
				name: 'integral_event_two',
				title: '执行明细',
				component: () => import( /* webpackChunkName: "integral_event_two" */
					'@/views/ranking/integral_event_two.vue'),
				meta: {
					icon: 'icon-shezhi_jifenguize',
					groupCode: 'ranking',
					groupName: "统计",
					noShow: true, //不显示在导航里
				}
			},
			{
				path: '/individual_statistics',
				name: 'individual_statistics',
				title: '个人统计',
				component: () => import( /* webpackChunkName: "individual_statistics" */
					'@/views/ranking/individual_statistics.vue'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'ranking',
				}
			},
			{
				path: '/department_statistics',
				name: 'department_statistics',
				title: '部门统计',
				component: () => import( /* webpackChunkName: "department_statistics" */
					'@/views/ranking/department_statistics.vue'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'ranking',
					jurisdiction: ['employee']
				}
			},
			{
				path: '/balanceA',
				name: 'balanceA',
				title: 'A分余额',
				component: () => import( /* webpackChunkName: "balanceA" */
					'@/views/ranking/balanceA'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'ranking',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/framework',
				name: 'framework',
				title: '组织架构',
				component: () => import( /* webpackChunkName: "framework" */ '@/views/set/framework.vue'),
				meta: {
					icon: 'icon-shezhi_zuzhijiagou',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/jurisdiction',
				name: 'jurisdiction',
				title: '角色权限',
				component: () => import( /* webpackChunkName: "jurisdiction" */ '@/views/set/jurisdiction.vue'),
				meta: {
					icon: 'icon-shezhi_jiaose',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/rule',
				name: 'rule',
				title: '积分规则',
				component: () => import( /* webpackChunkName: "rule" */ '@/views/set/rule.vue'),
				meta: {
					icon: 'icon-shezhi_jifenguize',
					groupCode: 'set',
					groupName: "设置",
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/initialPoint',
				name: 'initialPoint',
				title: '初始分',
				component: () => import( /* webpackChunkName: "initialPoint" */ '@/views/set/initialPoint.vue'),
				meta: {
					icon: 'icon-shezhi_jichushezhi',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/check',
				name: 'check',
				title: '考勤积分',
				component: () => import( /* webpackChunkName: "check" */ '@/views/set/check.vue'),
				meta: {
					icon: 'icon-kaoqin_kaoqinyuebaobiao',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/voluntarilyPoint',
				name: 'voluntarilyPoint',
				title: '自动积分',
				component: () => import( /* webpackChunkName: "voluntarilyPoint" */
					'@/views/set/voluntarilyPoint.vue'),
				meta: {
					icon: 'icon-shezhi_zidongjifen',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/log',
				name: 'log',
				title: '日志设置',
				component: () => import( /* webpackChunkName: "log" */ '@/views/set/log.vue'),
				meta: {
					icon: 'icon-shezhi_xitongpeizhi',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/screenSet',
				name: 'screenSet',
				title: '大屏配置',
				component: () => import( /* webpackChunkName: "screenSet" */ '@/views/set/screenSet.vue'),
				meta: {
					icon: 'icon-shezhi_xitongpeizhi',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/systemLayout',
				name: 'systemLayout',
				title: '系统配置',
				component: () => import( /* webpackChunkName: "systemLayout" */ '@/views/set/systemLayout.vue'),
				meta: {
					icon: 'icon-shezhi_xitongpeizhi',
					groupCode: 'set',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/update_notice',
				name: 'update_notice',
				title: '公告列表',
				component: () => import( /* webpackChunkName: "update_notice" */
					'@/views/subassembly/update_notice.vue'),
				hidden: true, //侧边栏隐藏
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'abPoint',
				}
			},
			{
				path: '/approval_list',
				name: 'approval_list',
				title: '待我审批',
				component: () => import( /* webpackChunkName: "approval_list" */
					'@/views/workbench/approval_list.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'workbench',
				}
			},
			{
				path: '/approval_batch',
				name: 'approval_batch',
				title: '批量审批',
				component: () => import( /* webpackChunkName: "approval_batch" */
					'@/views/workbench/approval_batch.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'workbench',
				}
			},
			{
				path: '/alreadySp',
				name: 'alreadySp',
				title: '我已审批',
				component: () => import( /* webpackChunkName: "alreadySp" */
					'@/views/workbench/alreadySp.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'workbench',
				}
			},
			{
				path: '/approvalAll',
				name: 'approvalAll',
				title: '审批跟进',
				component: () => import( /* webpackChunkName: "approvalAll" */'@/views/workbench/approvalAll.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'workbench',
					jurisdiction: ['dept_manager', 'employee']
				}
			},
			// {
			// 	path: '/review',
			// 	name: 'review',
			// 	title: '复核',
			// 	component: () => import( /* webpackChunkName: "review" */ '@/views/workbench/review.vue'),
			// 	meta: {
			// 		icon: 'icon-shezhi_gongdaolbiao',
			// 		groupCode: 'review',
			// 		// jurisdiction: ['dept_manager', 'employee']
			// 	}
			// },
			{
				path: '/review',
				name: 'review',
				title: '复核',
				component: () => import( /* webpackChunkName: "review" */ '@/views/workbench/integral_review.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'integral_review',
					// jurisdiction: ['dept_manager', 'employee']
				}
			},
			{
				path: '/flBox',
				name: 'flBox',
				title: '功勋点管理',
				component: () => import( /* webpackChunkName: "flBox" */ '@/views/welfare/flBox.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'welfare',
				}
			},
			{
				path: '/prize',
				name: 'prize',
				title: '奖品管理',
				component: () => import( /* webpackChunkName: "approval_list" */ '@/views/welfare/prize.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'welfare',
				}
			},
			{
				path: '/conversion',
				name: 'conversion',
				title: '兑换管理',
				component: () => import( /* webpackChunkName: "approval_list" */
					'@/views/welfare/conversion.vue'),
				meta: {
					icon: 'icon-shezhi_gongdaolbiao',
					groupCode: 'welfare',
				}
			},
		]
	},
	{
		path: '/',
		name: '/',
		title: '初始化',
		component: () => import( /* webpackChunkName: "init" */ '@/init'),
	},
	{
		path: '/noAccess',
		name: 'noAccess',
		title: '无权限',
		component: () => import( /* webpackChunkName: "noAccess" */ '@/noAccess'),
	},
	{
		path: '/screen',
		name: 'screen',
		title: '数据大屏展示',
		component: () => import( /* webpackChunkName: "screen" */ '@/screen'),
	},
	{
		path: '/screenSan',
		name: 'screenSan',
		title: '数据大屏展示',
		component: () => import( /* webpackChunkName: "screenSan" */ '@/screenSan'),
	},
	{
		path: '/deptRankSwiper',
		name: 'deptRankSwiper',
		title: '轮播',
		component: () => import( /* webpackChunkName: "deptRankSwiper" */ '@/views/ranking/deptRankSwiper.vue'),
	},
	{
		path: '/hint',
		name: 'hint',
		title: '提示页',
		component: () => import( /* webpackChunkName: "hint" */ '@/hint'),
	},
	{
		path: '/dome',
		name: 'dome',
		title: '虚拟列表',
		component: () => import( /* webpackChunkName: "dome" */ '@/dome'),
	},
]

const router = new VueRouter({
	// mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
