From e14f624b860452419e5f90e58baa80cc82020512 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 26 Feb 2022 16:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/addMenuCatalog/addMenuCatalog.js | 2 +- .../components/frame/breadcrumb/breadcrumb.js | 43 ++++-------- public/components/frame/menu/menu.html | 6 +- public/components/frame/menu/menu.js | 43 +++++------- public/components/frame/nav/nav.html | 38 ++-------- public/components/frame/nav/nav.js | 69 +++++++++++++++---- .../menuCatalogManage/menuCatalogManage.html | 2 +- public/vcCore/vcFramework.js | 10 +-- 8 files changed, 103 insertions(+), 110 deletions(-) diff --git a/public/components/dev/addMenuCatalog/addMenuCatalog.js b/public/components/dev/addMenuCatalog/addMenuCatalog.js index 0cada4423..a40fae6cb 100644 --- a/public/components/dev/addMenuCatalog/addMenuCatalog.js +++ b/public/components/dev/addMenuCatalog/addMenuCatalog.js @@ -12,7 +12,7 @@ icon: '', seq: '', storeType: '', - url: '', + url: '#', isShow: '', } diff --git a/public/components/frame/breadcrumb/breadcrumb.js b/public/components/frame/breadcrumb/breadcrumb.js index 691a2cb5f..f141a3994 100755 --- a/public/components/frame/breadcrumb/breadcrumb.js +++ b/public/components/frame/breadcrumb/breadcrumb.js @@ -20,42 +20,24 @@ _freshBreadCrumbByUrl: function() { let tabs = vc.getTabFromLocal(); - - let _tmpMenus = vc.getMenus(); - - if (_tmpMenus == null || _tmpMenus == undefined) { - return; - } let _curPath = location.hash; if (_curPath.indexOf('?') != -1) { _curPath = _curPath.substring(0, _curPath.indexOf('?')); } - tabs.forEach(item => { - let _path = item; + let _path = item.url; if (_path.indexOf('?') != -1) { _path = _path.substring(0, _path.indexOf('?')); } - let _url = vc.getUrl() + _path; - - _tmpMenus.forEach(_menu => { - _menu.childs.forEach(child => { - //console.log(_url, child.href) - if (_url != child.href) { - return; - } - _tmpBreadCrumbInf = { - href: item, - pageName: child.name, - active: '0' - }; - if (_path == _curPath) { - _tmpBreadCrumbInf.active = '1' - } - this.breadCrumbs.push(_tmpBreadCrumbInf); - }) - }) - + _tmpBreadCrumbInf = { + href: item.url, + pageName: item.name, + active: '0' + }; + if (_path == _curPath) { + _tmpBreadCrumbInf.active = '1' + } + this.breadCrumbs.push(_tmpBreadCrumbInf); }); }, @@ -70,7 +52,8 @@ }, _deleteSmallTab: function(_item) { let _tabs = vc.getTabFromLocal(); - vc.deleteTabToLocal(_item.href); + _item.url = _item.href; + vc.deleteTabToLocal(_item); vm.breadCrumbs = []; if (_item.active == '0') { vm._freshBreadCrumbByUrl(); @@ -80,7 +63,7 @@ vc.jumpToPage("/"); return; } - vc.jumpToPage(vc.getUrl() + _tabs[_tabs.length - 2]); + vc.jumpToPage(vc.getUrl() + _tabs[_tabs.length - 2].url); } }, diff --git a/public/components/frame/menu/menu.html b/public/components/frame/menu/menu.html index 4385ca39d..5f1d2e8c2 100755 --- a/public/components/frame/menu/menu.html +++ b/public/components/frame/menu/menu.html @@ -12,7 +12,7 @@ -