CN-820 npm 下钻ip维度:直接进入as a client时没数据

This commit is contained in:
hyx
2022-12-02 13:44:49 +08:00
parent e3422757a2
commit 5818485f3f
3 changed files with 28 additions and 21 deletions

View File

@@ -291,7 +291,8 @@ export const curTabState = {
fourthPanel: 'fourthPanel',
networkOverviewBeforeTab: 'networkOverviewBeforeTab',
tabOperationType: 'tabOperationType',
tabOperationBeforeType: 'tabOperationBeforeType'
tabOperationBeforeType: 'tabOperationBeforeType',
tabIndex: 'tabIndex'
}
export const scoreUrl = [

View File

@@ -1221,6 +1221,14 @@ export default {
})
}
})
if (!this.getUrlParam(this.curTabState.tabIndex)) {
let thirdMenu = this.urlChangeParams[this.curTabState.thirdMenu]
if(thirdMenu === 'network.serverIps'){
this.urlChangeParams[this.curTabState.tabIndex] = 1
}else if(thirdMenu === 'network.clientIps' || thirdMenu === 'network.ips'){
this.urlChangeParams[this.curTabState.tabIndex] = 0
}
}
this.changeUrlTabState()
this.$router.push({
path: this.$route.path,
@@ -1894,15 +1902,7 @@ export default {
},
beforeUnmount () {
// 以下元素,检测到内存并未释放
this.list = null
this.tabList = null
this.allList = null
this.drillDownTableConfigs = null
this.curTable = null
this.commonColumnList = null
this.networkTable = null
this.tableData = null
this.tableDataBackup = null
},
unmounted () {
this.isNoData = false

View File

@@ -115,11 +115,15 @@ export default {
curTabIndex = 0
if (self.serverSessions === 0) {
self.disableTab(1)
}else if(curTabIndexInUrl !== null){
curTabIndex = curTabIndexInUrl
}
}else if(thirdMenu === 'network.serverIps'){
curTabIndex = 1
if (self.clientSessions === 0) {
self.disableTab(0)
}else if(curTabIndexInUrl !== null){
curTabIndex = curTabIndexInUrl
}
}else if (self.clientSessions === 0) {
curTabIndex = 1
@@ -127,21 +131,23 @@ export default {
} else if (self.serverSessions === 0) {
curTabIndex = 0
self.disableTab(1)
} else if(curTabIndexInUrl !== null){
curTabIndex = curTabIndexInUrl
}
this.$nextTick(() => {
if(curTabIndexInUrl !== null){
self.currentTab = curTabIndexInUrl
self.isCurTabReady = true
setTimeout(() => {
this.$emit('tabChange', curTabIndexInUrl)
}, 400)
}else {
self.currentTab = curTabIndex
self.isCurTabReady = true
}
self.currentTab = curTabIndex
self.isCurTabReady = true
//URL中tabIndex的设置client初始化时查询条件需要side条件
const { query } = this.$route
const newUrl = urlParamsHandler(window.location.href, query, {
tabIndex: self.currentTab
})
overwriteUrl(newUrl)
setTimeout(() => {
self.handleActiveBar(self.currentTab)
}, 400)
setTimeout(() => {
this.$emit('tabChange', self.currentTab)
}, 400)
})
})