fix:修复关闭assetping后依然存在ping筛选的问题
This commit is contained in:
@@ -91,7 +91,7 @@ export default {
|
|||||||
//单选
|
//单选
|
||||||
handler(val, index) {
|
handler(val, index) {
|
||||||
if (!this.allowedAll&&!val.allowed && (index == 0 || index == 1 || val.NotSet)) {
|
if (!this.allowedAll&&!val.allowed && (index == 0 || index == 1 || val.NotSet)) {
|
||||||
this.custom[index].show = true;
|
// this.custom[index].show = true;
|
||||||
} else {
|
} else {
|
||||||
this.custom[index].show = !this.custom[index].show;
|
this.custom[index].show = !this.custom[index].show;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item name="ping" :title="$t('asset.left.ping')">
|
<el-collapse-item name="ping" :title="$t('asset.left.ping')" v-if="assetPingSwitch">
|
||||||
<el-checkbox-group v-model="pingCheckList" size="small" @change="changePingCheckBox">
|
<el-checkbox-group v-model="pingCheckList" size="small" @change="changePingCheckBox">
|
||||||
<el-checkbox class="sidebar-info-item" :class="{'sidebar-info-item-active': indOf(pingCheckList, item.key)}" v-for="(item, index) in pingData" :key="index" :label="item.value">
|
<el-checkbox class="sidebar-info-item" :class="{'sidebar-info-item-active': indOf(pingCheckList, item.key)}" v-for="(item, index) in pingData" :key="index" :label="item.value">
|
||||||
<div class="sidebar-info-item-txt">
|
<div class="sidebar-info-item-txt">
|
||||||
@@ -159,6 +159,7 @@
|
|||||||
vendorCheckList: [],
|
vendorCheckList: [],
|
||||||
pingData: [],
|
pingData: [],
|
||||||
pingCheckList: [],
|
pingCheckList: [],
|
||||||
|
assetPingSwitch:true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -216,9 +217,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.initEvent(); //注册监听事件
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Promise.all([this.getProjectList(), this.getModuleList(), this.getLeftMenuList()]).then(response => {
|
Promise.all([this.getProjectList(), this.getModuleList(), this.getLeftMenuList()]).then(response => {
|
||||||
this.initEvent(); //注册监听事件
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.ready = true;
|
this.ready = true;
|
||||||
}, 300);
|
}, 300);
|
||||||
@@ -385,6 +388,10 @@
|
|||||||
bus.$on('asset-property-change',()=>{
|
bus.$on('asset-property-change',()=>{
|
||||||
this.getLeftMenuList();
|
this.getLeftMenuList();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bus.$on('asset-ping-switch-change',(isOpen)=>{
|
||||||
|
this.assetPingSwitch = isOpen
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 获取asset左侧菜单数据
|
// 获取asset左侧菜单数据
|
||||||
getLeftMenuList(){
|
getLeftMenuList(){
|
||||||
|
|||||||
@@ -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: {
|
methods: {
|
||||||
fullScreen() {
|
fullScreen() {
|
||||||
@@ -627,6 +637,11 @@
|
|||||||
this.pageObj[column] = content;
|
this.pageObj[column] = content;
|
||||||
this.getTableData();
|
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)
|
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))
|
? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path))
|
||||||
: this.tableTitle;
|
: this.tableTitle;
|
||||||
|
|
||||||
if (this.assetPingSwitch == 'off') {
|
if (this.assetPingSwitch == 'off') {
|
||||||
|
this.dispatchEvent('asset-ping-switch-change',false)
|
||||||
for (let i in tableTitle) {
|
for (let i in tableTitle) {
|
||||||
let label = tableTitle[i];
|
let label = tableTitle[i];
|
||||||
if (label.prop == 'pingStatus') {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user