let routeDataList = [
	//原教职工
	{
		name: "随手拍",
		limits:"demo",
		route: "snapshotManage",
		routeUrl: "/pages_safetyExamine/snapshotManage/snapshotAdd",
		img: require('@/images/basicsModules/icon_sy_ssp.png'),
		buttonType:"page",
	},
	{
		name: "安全检查",
		limits:"demo",
		route: "safetyExamine",
		routeUrl: "/pages_safetyExamine/safetyExamineWorkbench",
		img: require('@/images/basicsModules/icon_sy_aqjc.png'),
		buttonType:"page",
	},
	{
		name: "离开检查",
		limits:"",
		route: "leaveInspection",
		routeUrl: "/pages_basics/photoInspection",
		img: require('@/images/basicsModules/icon_dzt_pzjc.png'),
		buttonType:"page",
	},
	{
		name: "准入审核",
		limits:"",
		route: "accessQualification",
		routeUrl: "/pages_manage/accessQualification/accessQualification",
		img: require('@/images/basicsModules/icon_sy_zrsq.png'),
		buttonType:"page",
	},
	{
		name: "气瓶管理",
		limits:"",
		route: "gasBottle",
		routeUrl: "/pages_manage/gasBottle/gasManage/gasManage",
		img: require('@/images/basicsModules/icon_sy_qpgl.png'),
		buttonType:"page",
	},
	{
		name: "化学品管理",
		limits:"",
		route: "chemicalsManage",
		routeUrl: "",
		img: require('@/images/basicsModules/icon_sy_hxp.png'),
		buttonType:"none",
	},
	{
		name: "特种设备",
		limits:"",
		route: "specialEquipment",
		routeUrl: "",
		img: require('@/images/basicsModules/icon_sy_tzsb.png'),
		buttonType:"none",
	},
	{
		name: "安全档案",
		limits:"",
		route: "safeArchives",
		routeUrl: "",
		img: require('@/images/basicsModules/icon_sy_aqxx.png'),
		buttonType:"none",
	},
	{
		name: "安全报警",
		limits:"",
		route: "warningRecording",
		routeUrl: "/pages_basics/earlyWarningManage/earlyWarningList",
		img: require('@/images/basicsModules/button_1.png'),
		buttonType:"page",
	},
	{
		name: "应急疏散",
		limits:"",
		route: "emergencyEvacuation",
		routeUrl: "/pages_manage/emergencyEvacuationBig",
		img: require('@/images/basicsModules/button_2.png'),
		buttonType:"page",
	},
	{
		name: "分级管控",
		limits:"",
		route: "gradingControl",
		routeUrl: "/pages_manage/gradingControl/gradingControl",
		img: require('@/images/basicsModules/icon_sy_fjgk.png'),
		buttonType:"page",
	},
	//原学生
	{
		name: "积分兑换",
		limits:"",
		route: "integralExchange",
		routeUrl: "/pages_student/integralManage/codeSuccess",
		img: require('@/images/basicsModules/btn_wd_jfdh.png'),
		buttonType:"page",
	},
	{
		name: "准入申请",
		limits:"",
		route: "accessApplication",
		routeUrl: "/pages_student/accessApplication/safeAccess",
		img: require('@/images/basicsModules/icon_sy_zrsq.png'),
		buttonType:"page",
	},
	{
		name: "气瓶管理",
		limits:"",
		route: "studentGasBottle",
		routeUrl: "/pages_student/gasBottle/gasManage/gasManage",
		img: require('@/images/basicsModules/icon_sy_qpgl.png'),
		buttonType:"page",
	},
	{
		name: "安全检查",
		limits:"",
		route: "studentSafetyInspect",
		routeUrl: "/pages_manage/workbench/problemRectification/rectifyList",
		img: require('@/images/basicsModules/icon_sy_aqjc.png'),
		buttonType:"page",
	},
	{
		name: "分级管控",
		limits:"",
		route: "studentGrading",
		routeUrl: "/pages_student/gradingControl/gradingControl",
		img: require('@/images/basicsModules/icon_sy_qpgl.png'),
		buttonType:"page",
	},
	{
		name: "成绩查询",
		limits:"",
		route: "cjcx",
		routeUrl: "",
		img: require('@/images/basicsModules/img_bg_cjcx.png'),
		buttonType:"none",
	},
	{
		name: "违规记录",
		limits:"",
		route: "meViolation",
		routeUrl: "/pages_student/workbench/meViolation",
		img: require('@/images/basicsModules/img_bg_wgjl.png'),
		buttonType:"page",
	},
	{
		name: "积分明细",
		limits:"",
		route: "jfmx",
		routeUrl: "",
		img: require('@/images/basicsModules/img_bg_jfmx.png'),
		buttonType:"none",
	},
];

export function getHomeConfig(data) {
	let list = JSON.parse(JSON.stringify(data));
	let homeList = [];
	for(let i=0 ; i<list.length; i++){
		let bigObj = {
			type:list[i].type,
			layout:[],
		};
		for(let l=0 ; l<list[i].layout.length; l++){
		console.log('list',list[i].layout[l])
			for(let o=0 ; o<routeDataList.length; o++){
				if(list[i].layout[l].path === routeDataList[o].route){
					bigObj.layout.push({
						limits:routeDataList[o].limits,
						route:routeDataList[o].route,
						routeUrl:routeDataList[o].routeUrl,
						name:routeDataList[o].name,
						img:routeDataList[o].img,
						buttonType:routeDataList[o].buttonType,
					})
				}
			}
		}
		if(bigObj.layout[0]){
			homeList.push(bigObj);
		}
	}
  return homeList;
}