Commit 68bd6679 by 冒粤蓉

fi

1 parent 8039de4d
...@@ -212,6 +212,7 @@ export default { ...@@ -212,6 +212,7 @@ export default {
} }
// 同步激活样式 // 同步激活样式
resData.forEach((item) => { resData.forEach((item) => {
if(curBreadcrumb) {
const { menuName: pMenuName } = item.origin; const { menuName: pMenuName } = item.origin;
item.showSubList = pMenuName === curBreadcrumb[0].name; item.showSubList = pMenuName === curBreadcrumb[0].name;
item.children.forEach((cItem, cIndex) => { item.children.forEach((cItem, cIndex) => {
...@@ -221,6 +222,7 @@ export default { ...@@ -221,6 +222,7 @@ export default {
curBreadcrumb[1].id = cItem.id; curBreadcrumb[1].id = cItem.id;
} }
}) })
}
}); });
if(isInit && curBreadcrumb) { if(isInit && curBreadcrumb) {
...@@ -228,10 +230,33 @@ export default { ...@@ -228,10 +230,33 @@ export default {
let path = thisBread.path || '/noData'; let path = thisBread.path || '/noData';
let name = thisBread.name || ''; let name = thisBread.name || '';
let id = thisBread.id || ''; let id = thisBread.id || '';
if(!path || path == '/noData') {
showEmpty = true;
};
name && getMenuAuth(id, name); name && getMenuAuth(id, name);
history.pushState(null, path, path); history.pushState({breadcrumb: curBreadcrumb}, path, path);
store.dispatch('app/setCommonData', { showEmpty });
} else {
let firstList = state.menuList[0];
let pOrigin = firstList.origin;
let cOrigin = firstList.children[0].origin;
const breadcrumb = [
{
name: pOrigin.menuName,
path: pOrigin.frontRoute
},
{
name: cOrigin.menuName,
path: cOrigin.frontRoute
}
];
if(!cOrigin.frontRoute || cOrigin.frontRoute == '/noData') {
showEmpty = true;
};
name && getMenuAuth(firstList.children[0].id, cOrigin.menuName);
history.pushState({breadcrumb}, cOrigin.frontRoute, cOrigin.frontRoute);
store.dispatch('app/setCommonData', { showEmpty });
} }
} }
}, err => { }, err => {
......
...@@ -20,9 +20,9 @@ export const Common = { ...@@ -20,9 +20,9 @@ export const Common = {
if(authFlag) { if(authFlag) {
data.forEach(labelItem => { data.forEach(labelItem => {
if(flag) { if(flag) {
elItem.style.display = 'none'; elItem.style.visibility = 'hidden';
if(elText.includes(labelItem.label)) { if(elText.includes(labelItem.label)) {
elItem.style.display = 'block'; elItem.style.visibility = 'visible';
flag = false; flag = false;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!