commit
cb164d6f0b
|
@ -65,17 +65,16 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
contextMenuVisible(value) {
|
contextMenuVisible(value) {
|
||||||
var _this = this;
|
const cm = (e) => {
|
||||||
var cm = function(e){
|
const sp = document.getElementById("contextmenu");
|
||||||
let sp = document.getElementById("contextmenu");
|
if (sp && !sp.contains(e.target)) {
|
||||||
if(sp&&!sp.contains(e.target)){
|
this.closeMenu()
|
||||||
_this.closeMenu()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.addEventListener('click', e=>cm(e))
|
document.body.addEventListener('click', e => cm(e))
|
||||||
}else{
|
} else {
|
||||||
document.body.removeEventListener('click', e=>cm(e))
|
document.body.removeEventListener('click', e => cm(e))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -160,24 +159,24 @@
|
||||||
this.contextMenuVisible = false
|
this.contextMenuVisible = false
|
||||||
},
|
},
|
||||||
//TAB 刷新
|
//TAB 刷新
|
||||||
refreshTab(){
|
refreshTab() {
|
||||||
var nowTag = this.contextMenuItem;
|
|
||||||
this.contextMenuVisible = false
|
this.contextMenuVisible = false
|
||||||
|
const nowTag = this.contextMenuItem;
|
||||||
//判断是否当前路由,否的话跳转
|
//判断是否当前路由,否的话跳转
|
||||||
if(this.$route.fullPath != nowTag.fullPath){
|
if (this.$route.fullPath !== nowTag.fullPath) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: nowTag.fullPath,
|
path: nowTag.fullPath,
|
||||||
query: nowTag.query
|
query: nowTag.query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$store.commit("refreshIframe", nowTag)
|
this.$store.commit("refreshIframe", nowTag)
|
||||||
var _this = this;
|
setTimeout(() => {
|
||||||
setTimeout(function() {
|
this.$store.commit("removeKeepLive", nowTag.name)
|
||||||
_this.$store.commit("removeKeepLive", nowTag.name)
|
this.$store.commit("setRouteShow", false)
|
||||||
_this.$store.commit("setRouteShow", false)
|
this.$nextTick(() => {
|
||||||
_this.$nextTick(() => {
|
this.$store.commit("pushKeepLive", nowTag.name)
|
||||||
_this.$store.commit("pushKeepLive",nowTag.name)
|
this.$store.commit("setRouteShow", true)
|
||||||
_this.$store.commit("setRouteShow", true)
|
|
||||||
})
|
})
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue