// 研究员 export const RESEARCHLIST = ['ficc_researcher', 'researcher', 'rai_researcher','ficc_admin',]; // 销售/组长 const SELLERLIST = ['ficc_seller', 'ficc_group', 'ficc_team']; // 权益销售/组长 const SELLERLIST_RAI = [ 'rai_seller', 'rai_group', 'rai_admin']; // admin const ADMINLIST = ['admin']; /* 获取默认选中活动类型和 活动类型数组 默认时间 fromType: 1 点击日历表格添加 2点击添加活动按钮 */ export const getDefaultOption = (role,fromType) => { const defaultStartTime = () => { let date = new Date(); date = new Date(date.toLocaleDateString() + " 15:30"); return new Date(date.setDate(date.getDate() + 1)).getTime(); } // 默认结束时间为当前第二天的16.00 const defaultEndTime = () => { let date = new Date(); date = new Date(date.toLocaleDateString() + " 16:00"); return new Date(date.setDate(date.getDate() + 1)).getTime(); } let type = SELLERLIST_RAI.includes(role) ? 5 : RESEARCHLIST.includes(role) ? 1 : SELLERLIST.includes(role) ? 2 : 3; let res; switch(type) { case 1: res = { defaultActivityType: '内部会议', activityTypeList:['内部会议'], startTime: defaultStartTime(), endTime: defaultEndTime() } break; case 2: res = { defaultActivityType: fromType === 1 ? '路演' : '内部会议', activityTypeList:['路演','内部会议','公开会议'], startTime: defaultStartTime(), endTime: defaultEndTime() } break; case 3: res = { defaultActivityType: '报告电话会', activityTypeList:['报告电话会','内部会议'], startTime: defaultStartTime(), endTime: defaultEndTime() } break; case 5: res = { defaultActivityType: fromType === 1 ? '路演' : '内部会议', activityTypeList:['路演','沙龙'], startTime: defaultStartTime(), endTime: defaultEndTime() } break; } return res; }