Commit 68bd6679 by 冒粤蓉

fi

1 parent 8039de4d
......@@ -212,15 +212,17 @@ export default {
}
// 同步激活样式
resData.forEach((item) => {
const { menuName: pMenuName } = item.origin;
item.showSubList = pMenuName === curBreadcrumb[0].name;
item.children.forEach((cItem, cIndex) => {
cItem.subItemActive = false;
if(cItem.origin.menuName === curBreadcrumb[1].name) {
cItem.subItemActive = true;
curBreadcrumb[1].id = cItem.id;
}
})
if(curBreadcrumb) {
const { menuName: pMenuName } = item.origin;
item.showSubList = pMenuName === curBreadcrumb[0].name;
item.children.forEach((cItem, cIndex) => {
cItem.subItemActive = false;
if(cItem.origin.menuName === curBreadcrumb[1].name) {
cItem.subItemActive = true;
curBreadcrumb[1].id = cItem.id;
}
})
}
});
if(isInit && curBreadcrumb) {
......@@ -228,10 +230,33 @@ export default {
let path = thisBread.path || '/noData';
let name = thisBread.name || '';
let id = thisBread.id || '';
if(!path || path == '/noData') {
showEmpty = true;
};
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 => {
......
......@@ -40,7 +40,7 @@ export default {
const subMircroEle = document.getElementById('sub-system-frame');
subMircroEle.addEventListener('DOMNodeInserted', function (e) {
const target = e.currentTarget,
tarInner = target.innerHTML;
tarInner = target.innerHTML;
if (!state.el_sub_innerH !== !tarInner) {
state.el_sub_innerH = target.innerHTML;
}
......
......@@ -20,9 +20,9 @@ export const Common = {
if(authFlag) {
data.forEach(labelItem => {
if(flag) {
elItem.style.display = 'none';
elItem.style.visibility = 'hidden';
if(elText.includes(labelItem.label)) {
elItem.style.display = 'block';
elItem.style.visibility = 'visible';
flag = false;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!