修改头部菜单显示逻辑
parent
edf113de5a
commit
c1b8eded3e
|
@ -143,6 +143,7 @@ export default {
|
||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
showMenus: [],
|
showMenus: [],
|
||||||
showMenusNavIds: [],
|
showMenusNavIds: [],
|
||||||
|
notDetail:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -175,7 +176,9 @@ export default {
|
||||||
const prjId = urlParams.get("prjId");
|
const prjId = urlParams.get("prjId");
|
||||||
localStorage.setItem("selProj", prjId);
|
localStorage.setItem("selProj", prjId);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
location.hash = "#/detail";
|
if(this.notDetail == false){
|
||||||
|
location.hash = "#/detail";
|
||||||
|
}
|
||||||
}, 800);
|
}, 800);
|
||||||
}
|
}
|
||||||
window.xapp = this;
|
window.xapp = this;
|
||||||
|
@ -216,7 +219,6 @@ export default {
|
||||||
},
|
},
|
||||||
loadMenu() {
|
loadMenu() {
|
||||||
this.$api.project.bigScreenGetMenuByProjectId(this.selProjectId).then((d) => {
|
this.$api.project.bigScreenGetMenuByProjectId(this.selProjectId).then((d) => {
|
||||||
|
|
||||||
let objs = d.data || [];
|
let objs = d.data || [];
|
||||||
if (objs.length == 0) {
|
if (objs.length == 0) {
|
||||||
objs = [
|
objs = [
|
||||||
|
@ -232,6 +234,18 @@ export default {
|
||||||
}
|
}
|
||||||
this.showMenus = objs;
|
this.showMenus = objs;
|
||||||
this.showMenusNavIds = this.showMenus.map((d) => d.navId);
|
this.showMenusNavIds = this.showMenus.map((d) => d.navId);
|
||||||
|
let tmps = this.showMenusNavIds.filter((item) => [1, 2, 3, 4, 5, 6, 7].includes(+item));
|
||||||
|
if (!tmps.includes(2)) {
|
||||||
|
let nav = tmps[0];
|
||||||
|
nav = tmps[0];
|
||||||
|
tmps = this.showMenusNavIds.filter((item) => String(item).startsWith(nav+""));
|
||||||
|
if (tmps.length > 1) {
|
||||||
|
nav= tmps[1];
|
||||||
|
}
|
||||||
|
this.$store.dispatch("ChangeNav", nav);
|
||||||
|
this.doNav(+nav);
|
||||||
|
this.notDetail=true;
|
||||||
|
}
|
||||||
console.log(this.showMenusNavIds);
|
console.log(this.showMenusNavIds);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -746,7 +746,7 @@ export default {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #909399;
|
color: #edffff85;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1920px) {
|
@media (max-width: 1920px) {
|
||||||
|
|
Loading…
Reference in New Issue