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

// 销售/组长
export const sellerList = ['ficc_seller', 'rai_seller', 'ficc_group', 'rai_group','rai_admin'];

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

//顶部tabs
export const getTabs = (role) => {
	return ENUM_RESEARCHLIST.includes(role) 
		? [
			{
				label: '待处理申请',
				key:1
			},
			{
				label: '已处理申请',
				key:2
			},
			{
				label: '内部会议',
				key:3
			},
			{
				label: '事项',
				key:5
			},
		] : sellerList.includes(role)
		? [
			{
				label: '待处理申请',
				key:1
			},
			{
				label: '已处理申请',
				key:2
			},
			{
				label: '内部会议',
				key:3
			}, //研报后台5.9 销售也增加事项
			{
				label: '事项',
				key:5
			},
		] : adminList.includes(role)
		? [
			{
				label: '内部会议',
				key:3
			},
			{
				label: '报告电话会',
				key:4
			},
		] : [];
}

//表格列
export const tableColums = (type) => {
	const role = localStorage.getItem('Role');

	return type === 1 ? [
		{
			label: '活动时间',
			key: 'time',
			widthsty: '200px'
		},
		{
			label: '研究员',
			key: 'ResearcherName',
			hidden: !sellerList.includes(role),
			// minwidthsty: '115px',
		},
		{
			label: '活动类型',
			key: 'ActivityType',
			// minwidthsty: '115px',
		},
		{
			label: '活动形式',
			key: 'RoadshowType',
		},
		{
			label: '会议主题',
			key: 'Theme',
			// widthsty: '100px',
		},
		{
			label: '客户(合作方)名称',
			key: 'company',
			// widthsty: '100px',
		},
		{
			label: '状态',
			key: 'Status',
			hidden: !sellerList.includes(role),
			// widthsty: '100px',
		},
		{
			label: '销售',
			key: 'SysUserRealName',
			hidden: !ENUM_RESEARCHLIST.includes(role),
			// widthsty: '100px',
		},
		{
			label: '提交时间',
			key: 'CreateTime',
			// widthsty: '100px',
		}
	] : type === 2 ? [
		{
			label: '活动时间',
			key: 'time',
			widthsty: '200px'
		},
		{
			label: '研究员',
			key: 'ResearcherName',
			hidden: !sellerList.includes(role),
			// minwidthsty: '115px',
		},
		{
			label: '活动类型',
			key: 'ActivityType',
			// minwidthsty: '115px',
		},
		{
			label: '活动形式',
			key: 'RoadshowType',
		},
		{
			label: '会议主题',
			key: 'Theme',
			// widthsty: '100px',
		},
		{
			label: '客户(合作方)名称',
			key: 'company',
			// widthsty: '100px',
		},
		{
			label: '状态',
			key: 'Status',
			hidden: !sellerList.includes(role),
			// widthsty: '100px',
		},
		{
			label: '销售',
			key: 'SysUserRealName',
			hidden: !ENUM_RESEARCHLIST.includes(role),
			// widthsty: '100px',
		},
		{
			label: '提交时间',
			key: 'CreateTime',
			// widthsty: '100px',
		},
		{
			label: '状态',
			key: 'Status',
			hidden: !ENUM_RESEARCHLIST.includes(role),
			// widthsty: '100px',
		},
		{
			label: '提交人',
			key: 'SysUserRealName',
			// widthsty: '100px',
		},
	] : type === 3 ? [
		{
			label: '活动时间',
			key: 'time',
			widthsty: '200px'
		},
		{
			label: '活动类型',
			key: 'ActivityType',
			// minwidthsty: '115px',
		},
		{
			label: '参会研究员',
			key: 'ResearcherName',
			minwidthsty: '200px'
		},
		{
			label: '添加时间',
			key: 'CreateTime',
			// widthsty: '100px',
		}
	] : type === 4 ? [
		{
			label: '活动时间',
			key: 'time',
			widthsty: '200px'
		},
		{
			label: '活动类型',
			key: 'ActivityType',
			// minwidthsty: '115px',
		},
		{
			label: '活动类别',
			key: 'ActivityCategory',
			// widthsty: '100px',
		},
		{
			label: '参会研究员',
			key: 'ResearcherName',
			minwidthsty: '200px',
		},
		{
			label: '添加时间',
			key: 'CreateTime',
			// widthsty: '100px',
		}
	] : [
		{
			label: '活动时间',
			key: 'time',
			widthsty: '200px'
		},
		{
			label: '活动类型',
			key: 'ActivityType',
			// minwidthsty: '115px',
		},
		{
			label: '活动内容',
			key: 'MatterContent',
			// widthsty: '100px',
		},
		{
			label: '添加时间',
			key: 'CreateTime',
			// widthsty: '100px',
		}
	]
}

//操作
export const handleArr = (type) => {
	if(type === 1 && sellerList.includes(localStorage.getItem('Role'))) return ['撤回']
	if(type === 1 && ENUM_RESEARCHLIST.includes(localStorage.getItem('Role'))) return ['接受','拒绝']
	if(type === 2 && sellerList.includes(localStorage.getItem('Role'))) return ['拒绝理由','修改重提','删除']
	if([3,4,5].includes(type)) return ['修改','删除']

	return []
}
