filter

var treeNodeList = [
{
title: '基础资料',
icon: 'iconfont ic-ui-user',
index: 'customer',
children: [
// index 控制哪个菜单高亮,每个submenu对应一个index
// // name 用于匹配路由,判断有没有权限,有权限才显示
// { title: '品牌信息管理', url: '/brandInform', index: 'brandInform', name: 'brandInform' },
// { title: '品牌审核列表', url: '/brandaudit', index: 'brandaudit', name: 'brandaudit' },
{ title: '品牌管理', url: '/customer/brandlist', index: 'customerbrandlist', name: 'customerbrandlist' },
{ title: '供应商管理', url: '/customerList', index: 'customerList', name: 'customerList' },
{ title: '商品管理', url: '/productList', index: 'productList', name: 'productList' },
{ title: '商品标签审核', url: '/goodverify/labelverify', index: 'goodverifylabelverify', name: 'goodverifylabelverify' }
]
},
{
title: '财务基础设置',
icon: 'el-icon-s-goods',
index: 'financeBasics',
children: [
{ title: '核算主体', url: '/accountingentityList', index: 'accountingentityList', name: 'accountingentityList' },
{ title: '公司实体', url: '/companyentityList', index: 'companyentityList', name: 'companyentityList' },
{ title: '商品成本明细表', url: '/commodityCostList', index: 'commodityCostList', name: 'commodityCostList' }
]
},
{
title: '供应商运维',
icon: 'el-icon-aim',
index: 'supplierom',
children: [
{ title: '供应商查询', url: '/supplierom/suppliersearch', index: 'suppliersearch', name: 'suppliersearch' },
{ title: '供应商汇总', url: '/supplierom/suppliertotal', index: 'suppliertotal', name: 'suppliertotal' }
]
},
{
title: '商品类目',
icon: 'el-icon-notebook-1',
index: 'goodcategory',
children: [
{ title: '后台类目管理', url: '/goodcategory/category', index: 'goodcategorymanage', name: 'goodcategorymanage' },
{ title: '后台类目调整', url: '/goodcategory/categoryadgust', index: 'goodcategoryadgust', name: 'goodcategoryadgust' },
{
title: '前台类目管理',
url: '/goodcategory/receptionCategoryManage',
index: 'receptionCategoryManage',
name: 'receptionCategoryManage'
}
]
},
// {
// title: '商品审核',
// icon: 'el-icon-box',
// index: 'goodverify',
// children: [{ title: '商品标签审核', url: '/goodverify/labelverify', index: 'goodverifylabelverify', name: 'goodverifylabelverify' }]
// },
{
title: '入库单',
icon: 'iconfont el-icon-location',
index: 'form',
children: [{ title: '入库单列表', url: '/warehouseList', index: 'warehouseList', name: 'warehouseList' }]
},
{
title: '新提报单',
icon: 'iconfont ic-ui-bag',
index: 'report_new',
children: [
{ title: '商机管理', url: '/mybussiness', index: 'mybussiness', name: 'mybussiness' },
{ title: '入仓建议', url: '/warehouseentry', index: 'warehouseentry', name: 'warehouseentry' },
{ title: '我的提报单(新)', url: '/MyReportnew', index: 'MyReportnew', name: 'MyReportnew' },
{ title: '提报单审核(新)', url: '/myapprove', index: 'myapprove', name: 'myapprove' },
{ title: '我的采购单', url: '/mypurchase', index: 'mypurchase', name: 'mypurchase' },
{ title: '我的采购合同', url: '/mypurchasecontract', index: 'mypurchasecontract', name: 'mypurchasecontract' },
{ title: '商品定价管理', url: '/reportfixprice', index: 'reportfixprice', name: 'reportfixprice' },
{ title: '采购单(8金刚)', url: '/historyEight', index: 'historyEight', name: 'historyEight' },
{ title: '采购付款申请单', url: '/reportpayorder', index: 'reportpayorder', name: 'reportpayorder' },
{ title: '我的发票', url: '/reportmyfinace', index: 'reportmyfinace', name: 'reportmyfinace' },
// { title: '商机提报', url: '/bussinessreport', index: 'bussinessreport', name: 'bussinessreport' },
{ title: '狙击商品列表', url: '/reportshot', index: 'reportshot', name: 'reportshot' },
{ title: '我的退款', url: '/myRefund', index: 'myRefund', name: 'myRefund' },
{ title: '退款申请单', url: '/myRefundApply', index: 'myRefundApply', name: 'myRefundApply' },
{ title: '绩效确认', url: '/reportachieve', index: 'reportachieve', name: 'reportachieve' },
{ title: '商品改价', url: '/goodfixprice', index: 'goodfixprice', name: 'goodfixprice' },
{ title: '商品资质上传', url: '/goodsqualificationsupload', index: 'goodsqualificationsupload', name: 'goodsqualificationsupload' },
{ title: '一级经销商价格填写', url: '/levelprice', index: 'levelprice', name: 'levelprice' }
]
},
{
title: '稽核管理',
icon: 'el-icon-ship',
index: 'auditmanage',
children: [
{ title: '提报商品稽核', url: '/auditmanage/auditmanage', index: 'auditmanageauditmanage', name: 'auditmanageauditmanage' },
{ title: '提报商品稽核结果', url: '/auditmanage/auditresultmanage', index: 'auditresultmanage', name: 'auditresultmanage' }
]
},
{
title: '发货管理',
icon: 'el-icon-files',
index: 'sendgood',
children: [
{ title: '我的发货单', url: '/sendgood/mysend', index: 'sendgoodmysend', name: 'sendgoodmysend' },
{ title: '我的预约', url: '/sendgood/mysubscribe', index: 'sendgoodmysubscribe', name: 'sendgoodmysubscribe' }
]
},
{
title: '人员管理',
icon: 'el-icon-coordinate',
index: 'personalmanage',
children: [
{ title: '企微买手人员', url: '/personal/enterprise', index: 'personalenterprise', name: 'personalenterprise' },
{ title: '买手额度管理', url: '/personal/purchasequta', index: 'personalpurchasequta', name: 'personalpurchasequta' },
{ title: '人事关怀', url: '/personal/personalcare', index: 'personalpersonalcare', name: 'personalpersonalcare' }
]
},
{
title: '财务管理',
icon: 'el-icon-s-goods',
index: 'finance',
children: [
{ title: '采购付款单', url: '/finance/payorder', index: 'payorder', name: 'payorder' },
{ title: '采购付款一审', url: '/finance/payrfirst', index: 'payrfirst', name: 'payrfirst' },
{ title: '采购付款二审', url: '/finance/payrsecond', index: 'payrsecond', name: 'payrsecond' },
{ title: '财务人员审核设置', url: '/finance/verifyer', index: 'verifyer', name: 'verifyer' },
{ title: '发票审核', url: '/finance/invoiceverify', index: 'invoiceverify', name: 'invoiceverify' },
{ title: '退款管理', url: '/finance/RefundManagement', index: 'RefundManagement', name: 'RefundManagement' }
]
},
{
title: '采购计划',
icon: 'el-icon-moon-night',
index: 'purchaseplan',
children: [
{ title: '计划发布', url: '/purchaseplan/planpublist', index: 'purchaseplanplanpublist', name: 'purchaseplanplanpublist' },
{ title: '提报限制', url: '/purchaseplan/reportedToLimitList', index: 'reportedToLimitList', name: 'reportedToLimitList' }
]
},
{
title: '今日尾货',
icon: 'el-icon-film',
index: 'crmstock',
children: [
{ title: '尾货线索管理', url: '/crmstock/clue', index: 'crmstockclue', name: 'crmstockclue' },
{ title: '尾货采购初审', url: '/crmstock/purchase', index: 'crmstockpurchase', name: 'crmstockpurchase' },
{ title: '尾货采购提报', url: '/crmstock/report', index: 'crmstockreport', name: 'crmstockreport' },
{ title: '点位管理', url: '/crmstock/pointList', index: 'crmstockpointlist', name: 'crmstockpointlist' },
{ title: '点位审核(品控)', url: '/crmstock/pointControl', index: 'crmstockpointcontrol', name: 'crmstockpointcontrol' },
{ title: '点位审核(主管)', url: '/crmstock/pointMain', index: 'crmstockpointmain', name: 'crmstockpointmain' },
{ title: '采购数据', url: '/crmstock/purchasedata', index: 'crmstockpurchasedata', name: 'crmstockpurchasedata' }
]
},
{
title: '海鼎功能',
icon: 'iconfont ic-ui-project',
index: 'haiding',
children: [{ title: '海鼎自营进货定单', url: '/enterorder', index: 'enterorder', name: 'enterorder' }]
},
{
title: '仓库管理',
icon: 'iconfont ic-ui-dashboard',
index: 'storeHouse',
children: [{ title: '采购单(冻品)', url: '/coldlist', index: 'coldlist', name: 'coldlist' }]
},
{
title: '设备管理',
icon: 'iconfont ic-ui-panel',
index: 'deviceManage',
children: [{ title: 'POS设备列表', url: '/devicePOS', index: 'devicePOS', name: 'devicePOS' }]
},
{
title: '版本管理',
icon: 'iconfont ic-ui-version',
index: 'versionManage',
children: [{ title: '版本列表', url: '/versionPOS', index: 'versionPOS', name: 'versionPOS' }]
},
{
title: '风控管理',
icon: 'iconfont ic-ui-box',
index: 'risk',
children: [
{ title: '品类额度管理', url: '/categoryLines', index: 'categoryLines', name: 'categoryLines' },
{ title: '人员类别管理', url: '/personnelquota', index: 'personnelquota', name: 'personnelquota' },
{ title: '价格浮动管理', url: '/pricefluctuate', index: 'pricefluctuate', name: 'pricefluctuate' }
]
},
{
title: '商品质量管理',
icon: 'iconfont ic-ui-file',
index: 'qualityControl',
children: [
{ title: '商品事故单管理', url: '/goodsaccident', index: 'goodsaccident', name: 'goodsaccident' },
{ title: '门店反馈单管理', url: '/storefeedback', index: 'storefeedback', name: 'storefeedback' },
{ title: '商品价格更新', url: '/goodsprice', index: 'goodsprice', name: 'goodsprice' }
]
},
{
title: '分析报表管理',
icon: 'iconfont ic-ui-piechart',
index: 'analysisReport',
children: [
{ title: '品类销售额分析', url: '/salesvolume', index: 'salesvolume', name: 'salesvolume' },
{ title: '门店销售分析', url: '/storesales', index: 'storesales', name: 'storesales' },
{ title: '商品销售分析', url: '/goodsales', index: 'goodsales', name: 'goodsales' },
{ title: '商品价格查询', url: '/goodPrice', index: 'goodPrice', name: 'goodPrice' }
]
},
{
title: '报表管理',
icon: 'iconfont ic-ui-bill',
index: 'statement',
children: [
{ title: '采购绩效参考', url: '/purchaseSummer', index: 'purchaseSummer', name: 'purchaseSummer' },
{ title: '采购单信息查询', url: '/purchaseorders', index: 'purchaseorders', name: 'purchaseorders' },
{ title: '仓储信息查询', url: '/storagequery', index: 'storagequery', name: 'storagequery' },
{ title: '门店配货信息查询', url: '/storedistributionquery', index: 'storedistributionquery', name: 'storedistributionquery' },
{ title: '门店销售信息查询', url: '/storemarketquery', index: 'storemarketquery', name: 'storemarketquery' },
{ title: '商品库存查询', url: '/storestock', index: 'storestock', name: 'storestock' },
{ title: '采购额和库存水位', url: '/purchase/chart', index: 'purchasechart', name: 'purchasechart' }
]
},
{
title: '采购专项报表',
icon: 'el-icon-s-marketing',
index: 'purchase_report',
children: [
{ title: '采购榜单(bi)', url: '/purchaselist', index: 'purchaselist', name: 'purchaselist' },
{ title: '品类入库建议(bi)', url: '/suggestbi', index: 'suggestbi', name: 'suggestbi' },
{ title: '商品配货销售(bi)', url: '/distribution', index: 'distribution', name: 'distribution' },
{ title: '滞销明细(bi)', url: '/unsable', index: 'unsable', name: 'unsable' },
{ title: '定价定量辅助(bi)', url: '/label', index: 'label', name: 'label' },
{ title: '今日堆头(bi)', url: '/pushtoday', index: 'pushtoday', name: 'pushtoday' },
{ title: '配货标签征集意见(bi)', url: '/dissuggestbi', index: 'dissuggestbi', name: 'dissuggestbi' },
{ title: '配货进度(bi)', url: '/distripeed', index: 'distripeed', name: 'distripeed' },
{ title: '绩效结算口径状态(bi)', url: '/settlestatus', index: 'settlestatus', name: 'settlestatus' }
]
},
{
title: '数据看板',
icon: 'iconfont ic-ui-store',
index: 'dataBoard',
children: [{ title: '门店数据管理', url: '/dataBoard', index: 'dataBoard', name: 'dataBoard' }]
},
// {
// title: '抽奖管理',
// icon: 'iconfont ic-ui-receivables',
// index: 'vipprize',
// children: [
// { title: '导入设置', url: '/vipprizelist', index: 'vipprizelist', name: 'vipprizelist' },
// { title: '商品管理(游戏)', url: '/vipprizegood', index: 'vipprizegood', name: 'vipprizegood' },
// { title: '盲盒管理(游戏)', url: '/vipprizeblind', index: 'vipprizeblind', name: 'vipprizeblind' },
// { title: '订单查询(游戏)', url: '/vipprizeorder', index: 'vipprizeorder', name: 'vipprizeorder' },
// { title: '数据分析(游戏)', url: '/vipprizeanalysis', index: 'vipprizeanalysis', name: 'vipprizeanalysis' },
// { title: '用户列表(游戏)', url: '/vipprizeuserlist', index: 'vipprizeuserlist', name: 'vipprizeuserlist' },
// { title: '十连抽管理(游戏)', url: '/vipprizeluckyset', index: 'vipprizeluckyset', name: 'vipprizeluckyset' },
// { title: '公告(游戏)', url: '/vipprizenotice', index: 'vipprizenotice', name: 'vipprizenotice' },
// { title: '黑名单(游戏)', url: '/vipprizeblack', index: 'vipprizeblack', name: 'vipprizeblack' },
// { title: '跑马灯(游戏)', url: '/vipprizehorse', index: 'vipprizehorse', name: 'vipprizehorse' },
// { title: '订单管理/订单列表', url: '/orderlist', index: 'orderlist', name: 'orderlist' },
// { title: '订单管理/退款列表', url: '/drawback', index: 'drawback', name: 'drawback' },
// { title: '订单管理/支付流水', url: '/paymentflow', index: 'paymentflow', name: 'paymentflow' }
// ]
// },
{
title: '策略配置中心',
icon: 'iconfont ic-ui-advice',
index: 'policy',
children: [{ title: 'SQL配置中心', url: '/sqlConfig', index: 'sqlConfig', name: 'sqlConfig' }]
},
// {
// title: '关系组',
// icon: 'iconfont ic-ui-usersetting',
// index: 'relation',
// children: [
// { title: '审核人列表', url: '/approvePersonList', index: 'approvePersonList', name: 'approvePersonList' },
// { title: '关系组提报人列表', url: '/relationPersonList', index: 'relationPersonList', name: 'relationPersonList' }
// ]
// },
{
title: '权限管理',
icon: 'iconfont ic-ui-setting',
index: 'permission',
children: [
{ title: '管理员列表', url: '/adminList', index: 'adminList', name: 'adminList' },
{ title: '角色管理', url: '/permissionList', index: 'permissionList', name: 'permissionList' },
{ title: '采购修改工具', url: '/tools', index: 'tools', name: 'tools' },
{ title: '尾货宝用户列表', url: '/crmstock/stockuser', index: 'crmstockstockuser', name: 'crmstockstockuser' },
{ title: '仓库列表', url: '/storeHouse/warehouse', index: 'coldwarehouse', name: 'coldwarehouse' }
]
}
]

var query = '权限管理';

var filterObj = function(item){
console.log(item.title)
if(item.title.indexOf(query) > -1) return true;
if(item.hasOwnProperty("children")){
item.children = item.children.filter(function(child){
if(child.hasOwnProperty("type")){
return child.title.indexOf(query) > -1;
}else if(child.hasOwnProperty("children")){
return filterObj(child);
}
})
if(item.children.length > 0){
return true;
}
}else{
return child.title.indexOf(query) > -1;
}
}
var filter = treeNodeList.filter(function(item){
return filterObj(item);
});

console.log(JSON.stringify(filter));

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,937评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,503评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,712评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,668评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,677评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,601评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,975评论 3 396
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,637评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,881评论 1 298
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,621评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,710评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,387评论 4 319
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,971评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,947评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,189评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,805评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,449评论 2 342

推荐阅读更多精彩内容