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', fourthPanel: 'fourthPanel',
networkOverviewBeforeTab: 'networkOverviewBeforeTab', networkOverviewBeforeTab: 'networkOverviewBeforeTab',
tabOperationType: 'tabOperationType', tabOperationType: 'tabOperationType',
tabOperationBeforeType: 'tabOperationBeforeType' tabOperationBeforeType: 'tabOperationBeforeType',
tabIndex: 'tabIndex'
} }
export const scoreUrl = [ 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.changeUrlTabState()
this.$router.push({ this.$router.push({
path: this.$route.path, path: this.$route.path,
@@ -1894,15 +1902,7 @@ export default {
}, },
beforeUnmount () { 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 () { unmounted () {
this.isNoData = false this.isNoData = false

View File

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