

/* 根据研究员id找父类index */
export const findParentByid = (id,arr) => {
	let obj = arr.find(item => item.ResearcherList.some( _ => _.AdminId === id));
	// console.log(obj)
	return arr.findIndex(_ => _.GroupName === obj.GroupName);
}

//  研究员
export const RESEARCHLIST = ['ficc_researcher', 'researcher', 'rai_researcher','ficc_admin', 'rai_admin',];

// 销售/组长
const SELLERLIST = ['ficc_seller', 'rai_seller', 'ficc_group', 'rai_group','seller'];

// admin
const ADMINLIST = ['admin'];

/* 根据角色获取我的日历顶部tab */
export const getTabsByRole = (role) => {
	return RESEARCHLIST.includes(role) 
		? [
			{
				label: '活动审批',
				key:1
			},
			{
				label: '内部会议',
				key:3
			},
			{
				label: '事项',
				key:5
			},
		] : SELLERLIST.includes(role)
		? [
			{
				label: '活动申请',
				key:2
			},
			{
				label: '内部会议',
				key:3
			},
			{
				label: '事项',
				key:5
			},
		] : ADMINLIST.includes(role)
		? [
			{
				label: '内部会议',
				key:3
			},
			{
				label: '报告电话会',
				key:4
			},
		] : [];
}