let routeDataList = [{
		id: '1',
		name: "预警记录",
		limits: "",
		route: "mineWarningRecording",
		routeUrl: "/pages_basics/views/earlyWarningManage/earlyWarningList",
		img: require('@/images/commonality/icon_003.png'),
		buttonType: "page",
	},
	{
		id: '2',
		name: "我的实验室",
		limits: "",
		route: "laboratory",
		routeUrl: "/pages_manage/views/laboratory/meLaboratory",
		img: require('@/images/commonality/icon_002.png'),
		buttonType: "page",
	},
	{
		id: '3',
		name: "预案执行记录",
		limits: "",
		route: "PlanExecuteRecord",
		routeUrl: "/pages_manage/views/plan/planList",
		img: require('@/images/commonality/icon_004.png'),
		buttonType: "page",
	},
	{
		id: '4', //id
		name: "身份验证", //名称
		limits: "", //权限字段
		route: "faceImage", //路由名称
		routeUrl: "/pages_basics/views/faceImage", //组件地址
		img: require('@/images/commonality/icon_001.png'), //图片
		buttonType: "page", //类型
	},
	{
		id: '5', //id
		name: "授权开门", //名称
		limits: "", //权限字段
		route: "empowerOpen", //路由名称
		routeUrl: "/pages_manage/views/accessControl/empowerOpen", //组件地址
		img: require('@/images/commonality/icon_001.png'), //图片
		buttonType: "page", //类型
	},
	{
		id: '6', //id
		name: "远程开门", //名称
		limits: "", //权限字段
		route: "remoteOpen", //路由名称
		routeUrl: "/pages_manage/views/accessControl/remoteOpen", //组件地址
		img: require('@/images/commonality/icon_001.png'), //图片
		buttonType: "page", //类型
	}
];

export function getMineConfig(data) {
	let list = JSON.parse(JSON.stringify(data));
	let mineList = [];
	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++) {
			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]) {
			mineList.push(bigObj);
		}
	}
	return mineList;
}
