fix:修改asset为0 时点击顶部资产不可以进入的问题
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
<el-submenu index="3" popper-class="nz-submenu">
|
||||
<template slot="title">
|
||||
<div v-if="assetData.length == 0">{{$t('overall.asset')}}</div>
|
||||
<div v-if="assetData.length == 0" @click="jumpToAsset()">{{$t('overall.asset')}}</div>
|
||||
<div v-else @click="jumpToAsset()" :class="{'menu-active' : route == '/asset'}">{{$t('overall.asset')}}</div>
|
||||
</template>
|
||||
<template>
|
||||
@@ -377,10 +377,11 @@
|
||||
getAssetData() {
|
||||
this.$get('idc', {pageSize:-1}).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.assetData = response.data.list
|
||||
this.assetData = response.data.list;
|
||||
this.assetData.forEach(item => {
|
||||
this.$set(item, item.name, false)
|
||||
})
|
||||
});
|
||||
this.$store.commit('setIdcArr',this.assetData);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1321,6 +1321,7 @@
|
||||
jumpTo(data, id) {
|
||||
if(data=='asset'){
|
||||
bus.$emit("clear-asset-filter"); //清除leftMenu左侧菜单过滤条件
|
||||
// if(this.$store.getters.getIdcArr.length===0){return}//如果不存在idc 则不跳转
|
||||
}
|
||||
this.$router.push({
|
||||
path: "/" + data,
|
||||
|
||||
@@ -24,7 +24,8 @@ const store = new Vuex.Store({
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
searchName: ''
|
||||
}
|
||||
},
|
||||
idcArr:[],
|
||||
},
|
||||
getters: {
|
||||
getLinkData(state){
|
||||
@@ -36,6 +37,9 @@ const store = new Vuex.Store({
|
||||
getReloadFacade(state){
|
||||
return state.reloadFacade
|
||||
},
|
||||
getIdcArr(state){
|
||||
return state.idcArr
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
/* 监听对象变化,用于顶部菜单与底部内容的同步 */
|
||||
@@ -95,6 +99,9 @@ const store = new Vuex.Store({
|
||||
state.reloadFacade=true;
|
||||
})
|
||||
},
|
||||
setIdcArr(state,data){
|
||||
state.idcArr = data
|
||||
},
|
||||
setCurrentDc(state,data){
|
||||
state.currentDc = data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user