fix:修改添加机柜 dc没有刷新的问题
This commit is contained in:
@@ -195,6 +195,7 @@
|
||||
this.rightBox.show = false;
|
||||
if (refresh) {
|
||||
this.getTableData();
|
||||
this.$store.commit('setDcDataRefresh');
|
||||
}
|
||||
},
|
||||
newCabinet() {
|
||||
@@ -248,6 +249,7 @@
|
||||
if(response.code == 200){
|
||||
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
||||
this.getTableData();
|
||||
this.$store.commit('setDcDataRefresh');
|
||||
}else{
|
||||
this.$message.error(response.msg);
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
<transition name="right-box">
|
||||
<traffic-setting-box @close="closeTrafficBox" :dc="dc" ref="trafficBox" v-if="rightBox.trafficSetting.show"></traffic-setting-box>
|
||||
</transition>
|
||||
<span v-if="dcDataRefresh" style="display: none"></span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -270,6 +271,14 @@
|
||||
scrollbarWrap: null,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
dcDataRefresh(){//通过vuex更新dc 需要该属性到页面 否则不被监听
|
||||
if(this.$store.getters.getDcDataRefresh){
|
||||
this.getTableData();
|
||||
}
|
||||
return this.$store.getters.getDcDataRefresh;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
assetStatClassName(param) {
|
||||
if (param.column.label == this.$t("config.dc.assets")) {
|
||||
|
||||
@@ -31,6 +31,7 @@ const store = new Vuex.Store({
|
||||
},
|
||||
idcArr:[],
|
||||
overViewProject:{},
|
||||
dcDataRefresh:false,
|
||||
},
|
||||
getters: {
|
||||
getLinkData(state){
|
||||
@@ -48,6 +49,9 @@ const store = new Vuex.Store({
|
||||
getOverViewProject(state){
|
||||
return state.overViewProject
|
||||
},
|
||||
getDcDataRefresh(state){
|
||||
return state.dcDataRefresh
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
/* 监听对象变化,用于顶部菜单与底部内容的同步 */
|
||||
@@ -116,6 +120,13 @@ const store = new Vuex.Store({
|
||||
setOverViewProject(state,data){
|
||||
state.overViewProject=data;
|
||||
},
|
||||
setDcDataRefresh(state){
|
||||
console.log(123)
|
||||
state.dcDataRefresh=true;
|
||||
setTimeout(()=>{
|
||||
state.dcDataRefresh=false;
|
||||
},100)
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user