import home from '../asset/icons/home.png'; import homeCheck from '../asset/icons/homeCheck.png'; import active from '../asset/icons/active.png'; import activeCheck from '../asset/icons/activeCheck.png'; import msgManage from '../asset/icons/msgManage.png'; import msgCheck from '../asset/icons/msgCheck.png'; import infoManage from '../asset/icons/infoManage.png'; import infoCheck from '../asset/icons/infoCheck.png'; import statistics from '../asset/icons/statistical.png'; import statisticsCheck from '../asset/icons/statisticalCheck.png'; import busManage from '../asset/icons/busManage.png'; import busCheck from '../asset/icons/busCheck.png'; import userCenter from '../asset/icons/userCenter.png'; import userCenterCheck from '../asset/icons/userCenterCheck.png'; import sys from '../asset/icons/sys.png'; import sysCheck from '../asset/icons/sysCheck.png'; import video from '../asset/icons/vedio.png'; const full = [{ id: 'backIndex', name: '后台首页', icon: home, iconCheck: homeCheck, path: '/' }, { id: 'busManage', name: '业务管理', icon: busManage, iconCheck: busCheck, children: [{ id: 'onlineAppeal', name: '在线申诉', path: '/busManage/onlineAppeal' }, { id: 'stateCompen', name: '国家赔偿', path: '/busManage/stateCompen' }, { id: 'appointment', name: '信访预约', path: '/busManage/appointment' }, { id: 'judicialRelief', name: '司法救助', path: '/busManage/judicialRelief' }, { id: 'caseProgress', name: '案件进度', path: '/busManage/caseProgress' }] }, { id: 'complaintSugges', name: '投诉建议', icon: home, iconCheck: homeCheck, children: [{ id: 'onlineAdvice', name: '在线建议', path: '/complaintSugges/onlineAdvice' }, { id: 'onlineComplaints', name: '在线投诉', path: '/complaintSugges/onlineComplaints' }, { id: 'onlineLetter', name: '在线信访', path: '/complaintSugges/onlineLetter' }, { id: 'another', name: '其他', path: '/complaintSugges/another' }] }, { id: 'snapshot', name: '公益随手拍', icon: active, iconCheck: activeCheck, path: '/snapshot' }, { id: 'crimeCrackdown', name: '扫黑除恶', icon: active, iconCheck: activeCheck, path: '/sweeping' }, { id: 'activeManage', name: '法治活动', icon: active, iconCheck: activeCheck, path: '/activeManage' }, { id: 'careList', name: '社会关护管理', icon: active, iconCheck: activeCheck, path: '/careList' }, { id: 'underAgeList', name: '涉未成年负责部门组织', icon: active, iconCheck: activeCheck, path: '/underAgeList' }, { id: 'questionnaire', name: '问卷管理部分', icon: msgManage, iconCheck: activeCheck, children: [{ id: 'newlyList', name: '问卷管理', path: '/questionnaire/newlyList' }, { id: 'newly', name: '新建问卷', path: '/questionnaire/newly/new' }] }, { id: 'entry', name: '入职查询', icon: msgManage, iconCheck: activeCheck, children: [{ id: 'applyFor', name: '入职申请', path: '/entry/applyFor' }, { id: 'examine', name: '检察院审核', path: '/entry/examine' }, { id: 'policeSecurity', name: '公安审核', path: '/entry/policeSecurity' }] }, { id: 'msgManage', name: '消息管理', icon: msgManage, iconCheck: msgCheck, children: [{ id: 'deputy', name: '人大代表联络站', path: '/msgList/deputy' }, { id: 'committee', name: '政协委员联络站', path: '/msgList/committee' }, { id: 'peopleSupervise', name: '人民监督员联络站', path: '/msgList/peopleSupervise' }, { id: 'authProcurator', name: '特约检察员联络站', path: '/msgList/authProcurator' }, { id: 'online', name: '在线咨询(个人)', path: '/msgList/online' }, { id: 'onlineCompany', name: '在线咨询(企业)', path: '/msgList/onlineCompany' }] }, { id: 'infoManage', name: '信息维护', icon: infoManage, iconCheck: infoCheck, children: [{ id: 'knowledgeBase', name: '知识库', path: '/knowledgeBase' }, { id: 'leadership', name: '监督人员', path: '/supPerson' }, { id: 'company', name: '自贸区企业', path: '/company' }, { id: 'articlePublish', name: '信息公布', path: '/articlePublish' }, { id: 'typeManage', name: '信息分类', path: '/typeManage' }] }, { id: 'statistics', name: '统计分析', icon: statistics, iconCheck: statisticsCheck, path: '/statistical' }, { id: 'userCenter', name: '用户审核', icon: userCenter, iconCheck: userCenterCheck, path: '/userCenter' }, { id: 'videoContant', name: '视频聊天平台', icon: video, iconCheck: video, path: 'https://xnwj.gznsjc.gov.cn/nsjc-charge/web/index.html#/' } , { id: 'insideUser', name: '内部用户管理', icon: userCenter, iconCheck: userCenterCheck, path: '/insideUser' } , { id: 'proManage', name: '系统管理', icon: sys, iconCheck: sysCheck, path: 'http://xnwj.gznsjc.gov.cn/nsjc-charge/base/home.html' }]; export default function (ids) { const reduce = tl => tl.reduce((list, { id, children, ...other }) => { if (children) { children = reduce(children); if (children.length) { list.push({ ...other, children, count: (ids.find(({ name }) => name === id) || { count: 0 }).count }); } } else { const found = ids.find(({ name }) => name === id); if (found) { other.count = found.count; list.push(other); } } return list; }, []); return reduce(full); };