处理无法在 web 和 alarm间切换(在 Alarm 下面操作一会再点击 WEB 之后无法跳转)的问题
This commit is contained in:
parent
b835c6e7fa
commit
82e8482275
|
@ -41,8 +41,15 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
onMenuSelect({ key }) {
|
onMenuSelect({ key }) {
|
||||||
const childPath = this.getChildrenPath(this.menuItems.find(menu => menu.name === key))
|
const childPath = this.getChildrenPath(this.menuItems.find(menu => menu.name === key))
|
||||||
if (key == "abnormal-alarm" || key == "istatistics") {
|
if (key == "abnormal-alarm" ) {
|
||||||
const selectedKeys = window.sessionStorage.getItem('currMenu')
|
const selectedKeys = window.sessionStorage.getItem('currMenu_alarm')
|
||||||
|
if (selectedKeys) {
|
||||||
|
this.$router.push(selectedKeys)
|
||||||
|
} else {
|
||||||
|
this.$router.push(childPath)
|
||||||
|
}
|
||||||
|
} else if (key == "istatistics") {
|
||||||
|
const selectedKeys = window.sessionStorage.getItem('currMenu_web')
|
||||||
if (selectedKeys) {
|
if (selectedKeys) {
|
||||||
this.$router.push(selectedKeys)
|
this.$router.push(selectedKeys)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -108,7 +108,7 @@ export default {
|
||||||
// 将从缓存中取出openKeys
|
// 将从缓存中取出openKeys
|
||||||
// const openKeys = window.sessionStorage.getItem('openKeys')
|
// const openKeys = window.sessionStorage.getItem('openKeys')
|
||||||
// console.log(openKeys);
|
// console.log(openKeys);
|
||||||
const selectedKeys = window.sessionStorage.getItem('currMenu')
|
const selectedKeys = window.sessionStorage.getItem('currMenu_alarm')
|
||||||
if (selectedKeys) {
|
if (selectedKeys) {
|
||||||
// this.defaultSelectedKeys.push(selectedKeys)
|
// this.defaultSelectedKeys.push(selectedKeys)
|
||||||
this.currSlecteKey.push(selectedKeys)
|
this.currSlecteKey.push(selectedKeys)
|
||||||
|
@ -128,23 +128,23 @@ export default {
|
||||||
// this.openKeys = JSON.parse(openKeys)
|
// this.openKeys = JSON.parse(openKeys)
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
watch: {
|
// watch: {
|
||||||
"$route": {
|
// "$route": {
|
||||||
handler: function (val, oldVal) {
|
// handler: function (val, oldVal) {
|
||||||
this.currSlecteKey=[]
|
// this.currSlecteKey=[]
|
||||||
console.log(val);
|
// console.log(val);
|
||||||
this.currSlecteKey.push(val.path)
|
// this.currSlecteKey.push(val.path)
|
||||||
window.sessionStorage.setItem('currMenu', val.path)
|
// window.sessionStorage.setItem('currMenu', val.path)
|
||||||
},
|
// },
|
||||||
deep:true,
|
// deep:true,
|
||||||
immediate:true
|
// immediate:true
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
// 点击菜单,路由跳转,注意的是当点击MenuItem才会触发此函数
|
// 点击菜单,路由跳转,注意的是当点击MenuItem才会触发此函数
|
||||||
menuClick({ item, key, keyPath }) {
|
menuClick({ item, key, keyPath }) {
|
||||||
this.currSlecteKey =[]
|
this.currSlecteKey =[]
|
||||||
window.sessionStorage.setItem('currMenu', key)
|
window.sessionStorage.setItem('currMenu_alarm', key)
|
||||||
// var parentPath = item._props.parentMenu._props.eventKey;
|
// var parentPath = item._props.parentMenu._props.eventKey;
|
||||||
// var parentTitle = parentPath.substring(parentPath.lastIndexOf("/") + 1, parentPath.length)
|
// var parentTitle = parentPath.substring(parentPath.lastIndexOf("/") + 1, parentPath.length)
|
||||||
// var par = {"type": "q"}
|
// var par = {"type": "q"}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user