fix:修复关闭assetping后依然存在ping筛选的问题

This commit is contained in:
wangwenrui
2020-08-28 16:28:06 +08:00
parent 2469e93b61
commit b4ab263c6c
3 changed files with 38 additions and 4 deletions

View File

@@ -376,6 +376,16 @@
}
}
},
'tools.customTableTitle':{
deep:true,
immediate:true,
handler(n,o){
let pingTitle=n.find(item=>{return item.prop=='pingStatus'})
if(pingTitle){
this.dispatchEvent('asset-ping-switch-change',pingTitle.show)
}
}
}
},
methods: {
fullScreen() {
@@ -627,6 +637,11 @@
this.pageObj[column] = content;
this.getTableData();
});
},
dispatchEvent(event,param){
this.$nextTick(()=>{
bus.$emit(event,param)
})
}
},
@@ -635,11 +650,23 @@
let tableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)
? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path))
: this.tableTitle;
if (this.assetPingSwitch == 'off') {
this.dispatchEvent('asset-ping-switch-change',false)
for (let i in tableTitle) {
let label = tableTitle[i];
if (label.prop == 'pingStatus') {
tableTitle.splice(i, 1);
label.show=false;
label.NotSet=true;
break;
}
}
}else{
for (let i in tableTitle) {
let label = tableTitle[i];
if (label.prop == 'pingStatus') {
label.show=true;
label.NotSet=false;
break;
}
}