filter

作者: friendshi洛初Udo邭 | 来源:发表于2022-03-05 16:47 被阅读0次

    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));

    相关文章

      网友评论

          本文标题:filter

          本文链接:https://www.haomeiwen.com/subject/ohrbrrtx.html