import Magix from 'magix' // dmp从接口返回菜单数据,处理转化成新的menu结构 const user = Magix.config('dmp-new.user') const { permissions2 } = user const all = Magix.config('dmp-new.all') // 洞察页面权限受制于各个子权限 const HAS_INSIGHT = permissions2['DMP_MENU_CROWD_INSIGHT_ANALYSIS'] || permissions2['DMP_FUNCTION_SCENARIO_CLUSTER'] || permissions2['DMP_MENU_CROWD_VALUE_ANALYSIS'] || permissions2['DMP_MENU_MARKET_CHANCE_YUNTU'] || permissions2['DMP_FUNCTION_LIVE'] || permissions2['DMP_FUNCTION_SHOP_SCENARIO'] // 有 deeplink 权限 const HAS_DEEPLINK = permissions2['DMP_FUNCTION_DEEPLINK_ASSERTS'] // const INSIGHT_HOME = '/crowds-new/create-types' const DEEPLINK_HOME = '/deeplink/distribute' const INSIGHT_DEEPLINK_MAP_PATH = HAS_DEEPLINK ? DEEPLINK_HOME : INSIGHT_HOME // 菜单路由页面配置 const Menus = [ { has: permissions2['DMP_MENU_HOMEPAGE'], name: '首页', path: '/home/index' }, { has: permissions2['DMP_MENU_DOUBLE11_CROWD'], // has: true, name: all.promotionAlpConfigs.menuName, path: '/promotion/index' }, { has: HAS_INSIGHT, name: '营销策略中心', icon: '', subs: [ // 有deeplink权限的直接进deeplink分布页 // ...(HAS_DEEPLINK // ? [] // : [ // { // thirds: [ // { // icon: '', // has: HAS_INSIGHT, // name: '洞察', // path: INSIGHT_HOME // } // ] // } // ]), { icon: '', has: HAS_DEEPLINK, name: 'DEEPLINK分析', thirds: [ { has: true, name: 'DEEPLINK资产分布', path: '/deeplink/distribute', info: { // 有 info 子菜单通栏显示,并且右侧有菜单说明信息 subTitle: 'DEEPLINK资产分布', title: '标准化细化消费者资产指标,体系化衡量品牌资产和营销现状。', tip: '清晰、全面洞察人群资产分布现状和结构,满足多场景下运营评估衡量诉求。' } }, { has: true, name: 'DEEPLINK资产流转', path: '/deeplink/flow' }, { has: true, name: '品牌全域资产分布', path: '/deeplink/l-brand' }, { has: permissions2['DMP_FUNCTION_DEEPLINK_MBR'], name: '会员资产分析', path: '/deeplink/member-analysis/index', info: { // 有 info 子菜单通栏显示,并且右侧有菜单说明信息 subTitle: '会员资产分析', title: '会员健康度+营销策略助力品牌运营会员资产。', tip: '会员核心指标、会员价值指标、会员黄金四象限全方位扫描会员资产状态;DEEPLINK资产分层、营销渠道效率贡献助力不同会员营销场景。' } }, { has: permissions2['DMP_FUNCTION_DEEPLINK_MARKET'], name: '细分市场资产空间', path: '/deeplink/subdivide/index', info: { // 有 info 子菜单通栏显示,并且右侧有菜单说明信息 subTitle: '细分市场', title: '灵活定义目标市场,下钻分析品牌资产渗透空间。', tip: '洞察已渗透品牌资产人群流转和媒介触达情况;人、货、场多维度探寻资产未加深人群加深机会。' } }, { has: permissions2[all.BRAND_COMPETE_GENERAL_PERMISSION_KEY], name: '品牌竞争分析', path: '/deeplink/compete/list' } ] }, { icon: '', has: true, name: '消费者运营', thirds: [ { has: permissions2['DMP_MENU_CROWD_INSIGHT_ANALYSIS'], name: '人群画像分析', path: '/insight-new/perspective' }, { has: permissions2['DMP_FUNCTION_SHOP_SCENARIO'], name: '超级用户洞察', path: '/crowds-new/super-new/old-customer-analysis' } ] }, { icon: '', has: permissions2['DMP_FUNCTION_SCENARIO_CLUSTER'], name: '货品运营', thirds: [ { has: true, name: '本店单品诊断', path: '/crowds-new/scenes/overview' }, { has: true, name: '单品洞察报告', path: '/crowds-new/scenes/single-item-analyse-task' } ] }, { icon: '', has: permissions2['DMP_FUNCTION_LIVE'], name: '场景运营', thirds: [ { has: true, name: '店铺直播分析', path: '/crowds-new/scenes/zhibo/shop-analyse' }, { has: true, name: '行业直播分析', path: '/crowds-new/scenes/zhibo/industry-analyse' }, { has: permissions2['DMP_FUNCTION_CHANNEL_STRATEGY_ANALYSIS'], name: '营销渠道策略', path: '/insight-new/channel-strategy/index' } ] } // { // thirds: [ // { // icon: '', // has: permissions2['DMP_FUNCTION_SHOP_SCENARIO'], // name: '超级用户洞察', // path: '/crowds-new/super-new/old-customer-analysis' // } // ] // }, // { // thirds: [ // { // icon: '', // has: permissions2['DMP_FUNCTION_CHANNEL_STRATEGY_ANALYSIS'], // name: '营销渠道策略', // path: '/insight-new/channel-strategy/index' // } // ] // } ] }, { has: true, name: '标签', subs: [ { has: true, thirds: [ { path: '/tag-markets-new/index', icon: '', has: permissions2['DMP_MENU_TAG_MARKET'], name: '标签市场' }, { path: '/crowds-new/tag-recommend', icon: '', has: permissions2['DMP_MENU_TAG_RECOMMEND'] && !permissions2['DMP_FUNCTION_TAG_RECOMMEND'], name: '标签推荐' }, { path: '/tag-recommend/recommend', icon: '', has: permissions2['DMP_FUNCTION_TAG_RECOMMEND'], name: '标签推荐' } ] } ] }, { has: true, name: '人群运营中心', subs: [ { has: true, thirds: [ { icon: '', has: permissions2['DMP_MENU_CROWD_LIST_OWN'], name: '我创建的人群', path: '/crowds-new/list' }, { icon: '', has: permissions2['DMP_FUNCTION_CROWD_CHANNEL_PROPERTY'], name: '渠道沉淀人群', path: '/crowds-new/channel-subside/list' }, { icon: '', has: permissions2['DMP_MENU_CROWD_LIST_PAERNER'], name: '合作方人群', path: '/crowds-new/partner' }, { icon: '', has: permissions2['DMP_MENU_TAG_PRIVATE'], name: '第一方数据上传', path: '/tools/first-data' }, { icon: '', has: permissions2['DMP_FUNCTION_CROWD_ITER'], name: '智能迭代人群', path: '/crowds-new/ai-iteration/list' // info: { // // 有 info 子菜单通栏显示,并且右侧有菜单说明信息 // subTitle: '智能迭代人群', // title: '系统自动迭代人群组成,不断提升人群效率。', // tip: '人群投放过程中,系统自动识别优质特征,并定期迭代优化人群构成,提升人群投放效率。' // } }, { icon: '', has: permissions2['DMP_MENU_TAG_PRIVATE_chongzhi'], name: '模板', path: '/template/list' }, { icon: '', has: permissions2['DMP_MENU_TAG_PRIVATE_chongzhi'], name: '模板包', path: '/template/packages' } ] // single-item-analyse-task } ] }, { has: permissions2['DMP_FUNCTION_RPT_VERSION3'], name: '报表', subs: [ { has: true, thirds: [ { icon: '', has: true, name: '账户概览', path: '/reports/overview/index' }, { icon: '', has: true, name: '人群报表', path: '/reports/crowds/index' }, { icon: '', has: permissions2['DMP_FUNCTION_WEEKLY_REPORT'], name: '达摩盘周报', path: '/reports/weekly/index' }, { icon: '', has: true, name: '结案报告', path: '/effects/case/outer/index', viewPath: 'dmp-xiaoer/views/pages' }, { icon: '', has: HAS_DEEPLINK, name: '品牌经营报告', path: '/reports/manage/list' } ] } ] }, { has: user.accountLevel == 1, // 基础用户才有营销学院菜单 name: '营销学院', path: 'https://shuyuan.taobao.com/#!/product/detail/index?id=85' } ] // 非菜单路由的页面 const CustomPath = [ { has: HAS_DEEPLINK, name: '经营月报详情页', path: '/reports/manage/report', mapThirdPath: '/reports/manage/list' }, { has: HAS_DEEPLINK, name: '品牌竞争分析报告', path: '/deeplink/compete/report', mapThirdPath: '/deeplink/compete/list' }, { has: HAS_DEEPLINK, name: 'deeplink资产分析', path: '/deeplink/bp-case-analysis/wrapper', mapThirdPath: '/deeplink/distribute' }, { has: HAS_DEEPLINK, name: '目标竞争标杆品牌池管理', path: '/deeplink/compete-brands/list', mapThirdPath: '/deeplink/distribute' }, { has: HAS_DEEPLINK, name: 'deeplink权限判断', path: '/deeplink/landing', mapThirdPath: '/deeplink/distribute', ignoreLeft: true }, { has: true, name: '结案报告详情', path: '/effects/case/outer/detail', mapThirdPath: '/effects/case/outer/index', viewPath: 'dmp-xiaoer/views/pages', ignoreLeft: true }, { has: permissions2['DMP_FUNCTION_CROWD_ITER'], name: '智能迭代人群详情', path: '/crowds-new/ai-iteration/detail', mapThirdPath: '/crowds-new/ai-iteration/list' }, { has: true, name: '标签专题列表', path: '/tag-recommend/tag-topic-list', mapThirdPath: '/tag-recommend/recommend', ignoreLeft: false }, { has: true, name: '人群报表详情', path: '/reports/crowds/detail', mapThirdPath: '/reports/crowds/index', ignoreLeft: false }, { has: true, name: '人群报表详情-new', path: '/reports/crowds/detail-new', mapThirdPath: '/reports/crowds/index', ignoreLeft: false }, { has: true, name: '任务分析结果', path: '/crowds-new/scenes/analyse-result', mapThirdPath: INSIGHT_DEEPLINK_MAP_PATH, ignoreLeft: true }, // { // has: true, // name: '新版标签市场', // path: '/tag-markets-new/index', // mapThirdPath: '/tag-markets-new/index' // }, { has: true, name: '单品智能圈人', path: '/crowds-new/scenes/create-item-crowd', mapThirdPath: INSIGHT_DEEPLINK_MAP_PATH, ignoreLeft: true }, { has: true, name: '创建单品分析任务', path: '/crowds-new/scenes/create-analyse-task', mapThirdPath: INSIGHT_DEEPLINK_MAP_PATH, ignoreLeft: true }, { has: true, name: '自定义圈人', path: '/crowds-new/create', mapThirdPath: '/crowds-new/list', ignoreLeft: true }, { has: true, name: '场景圈人', path: '/crowds-new/scene-crowds/create', mapThirdPath: '/crowds-new/list', ignoreLeft: true }, { has: true, name: '超级新用户', path: '/crowds/super-new', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '关键词定向', path: '/crowds/keywords', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '线下圈人', path: '/crowds/lbs/create', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '线下圈楼宇', path: '/crowds/lbs/create-building', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '自定义人群', path: '/crowds/custom', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '标签市场创建人群', path: '/crowds/create', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '创建第一方标签', path: '/crowds/first-party-tag/create', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '北极星人群创建', path: '/crowds/polaris-crowd', mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '通知列表', path: '/notice/list', ignoreLeft: true }, { has: true, name: '通知详情', path: '/notice/detail', // mapThirdPath: '/crowds/list', ignoreLeft: true }, { has: true, name: '人群追踪报告', path: '/crowds/trace-report', mapThirdPath: '/crowds/trace', ignoreLeft: true }, { has: true, name: '上传帮助列表', path: '/help-simba/category', ignoreLeft: true }, { has: true, name: '上传帮助内容', path: '/help-simba/content', ignoreLeft: true }, { has: true, name: '新建策略计划', path: '/strategy/partials/strategyPlanHandle', mapThirdPath: '/strategy/strategyPlan', viewPath: 'tactics/views/pages', viewData: { productType: 'dmp' }, ignoreLeft: true }, { has: true, name: '路径详情洞察', path: '/insight/path-detail', viewPath: 'tactics/views/pages', viewData: { productType: 'dmp' }, ignoreLeft: true }, { has: true, name: '策略详情', path: '/strategy/detail', viewPath: 'tactics/views/pages', viewData: { productType: 'dmp' }, mapThirdPath: '/strategy/strategyPlan' }, { has: true, name: '策略效果分析', viewPath: 'tactics/views/pages', viewData: { productType: 'dmp' }, path: '/effect/strategyPlan-detail', ignoreLeft: true }, { has: true, name: '渠道触达分析路径详情', viewPath: 'tactics/views/pages', viewData: { productType: 'dmp' }, path: '/crowd/channelDetail', ignoreLeft: true }, { has: true, name: '人群模板创建', path: '/template/create', ignoreLeft: true }, { has: true, name: '消息中心', path: '/message/index', viewPath: 'common-site/views/pages', viewData: { bizCode: all.bizCode } }, { name: '老客分析', path: '/crowds-new/super-new/old-customer-analysis', ignoreLeft: true, mapThirdPath: INSIGHT_DEEPLINK_MAP_PATH }, { has: true, name: '超级新用户', path: '/crowds-new/super-new/super-new-create', ignoreLeft: true, mapThirdPath: INSIGHT_DEEPLINK_MAP_PATH } ] export { Menus, CustomPath }