diff --git a/src/views/charts2/charts/npm/NpmIpMap.vue b/src/views/charts2/charts/npm/NpmIpMap.vue index 23e794ee..1cc407af 100644 --- a/src/views/charts2/charts/npm/NpmIpMap.vue +++ b/src/views/charts2/charts/npm/NpmIpMap.vue @@ -90,6 +90,7 @@ export default { // typeVal: this.$store.getters.getBreadcrumbColumnValue typeVal: this.getUrlParam(this.curTabState.fourthMenu, '') } + if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip' getData(api.npm.overview.map, params).then(res => { const subParams = { ...params, @@ -121,6 +122,9 @@ export default { pktRetransPercent: t.packetRetransScore ? t.packetRetransScore.pktRetransPercent : null } t.score = computeScore(data) + if (t.score === '-') { + t.score = '' + } }) this.loadMarkerData(imageSeries, mapData) }) @@ -133,7 +137,7 @@ export default { }, loadMarkerData (imageSeries, data) { imageSeries.data = data.map(r => ({ - score: r.score, + score: r.score || '–', name: r.province || r.country, throughput: valueToRangeValue(r.throughBitsRate, unitTypes.bps).join(' '), id: r.serverId, diff --git a/src/views/charts2/charts/npm/NpmLine.vue b/src/views/charts2/charts/npm/NpmLine.vue index 4754849e..7fe2ee53 100644 --- a/src/views/charts2/charts/npm/NpmLine.vue +++ b/src/views/charts2/charts/npm/NpmLine.vue @@ -135,20 +135,22 @@ export default { get(url, params).then(res => { if (res.code === 200) { this.isNoData = res.data.result.length === 0 - if (this.chart.params.index === 0) { - res.data.result.forEach((t, i) => { - if (t.type === 'totalBitsRate') { - this.chartOptionLineData[i].values = t.values - } else if (t.type === 'inboundBitsRate') { - this.chartOptionLineData[i].values = t.values - } else if (t.type === 'outboundBitsRate') { - this.chartOptionLineData[i].values = t.values - } - }) - const result = this.chartOptionLineData.filter(t => this.chartData.params.color.indexOf(t.color) > -1) - this.echartsInit(result, this.chartData, this.chartData.params.unitType) - } else { - this.echartsInit(res.data.result, this.chartData, this.chartData.params.unitType) + if (!this.isNoData) { + if (this.chart.params.index === 0) { + res.data.result.forEach((t, i) => { + if (t.type === 'totalBitsRate') { + this.chartOptionLineData[i].values = t.values + } else if (t.type === 'inboundBitsRate') { + this.chartOptionLineData[i].values = t.values + } else if (t.type === 'outboundBitsRate') { + this.chartOptionLineData[i].values = t.values + } + }) + const result = this.chartOptionLineData.filter(t => this.chartData.params.color.indexOf(t.color) > -1) + this.echartsInit(result, this.chartData, this.chartData.params.unitType) + } else { + this.echartsInit(res.data.result, this.chartData, this.chartData.params.unitType) + } } } }).finally(() => { diff --git a/src/views/charts2/charts/npm/NpmRecentEvents.vue b/src/views/charts2/charts/npm/NpmRecentEvents.vue index 2c6b03a4..a7403cae 100644 --- a/src/views/charts2/charts/npm/NpmRecentEvents.vue +++ b/src/views/charts2/charts/npm/NpmRecentEvents.vue @@ -83,11 +83,7 @@ export default { }, methods: { recentEventsListData () { - // const condition = this.$store.getters.getQueryCondition.split(/["|'](.*?)["|']/) - // const conditionStr = this.$route.query.queryCondition ? this.$route.query.queryCondition : '' const condition = this.queryCondition.split(/["|'](.*?)["|']/) - // const type = this.$store.getters.getDimensionType - // const type = this.$route.query.dimensionType ? this.$route.query.dimensionType : '' let url = '' const params = { startTime: getSecond(this.timeFilter.startTime), @@ -97,6 +93,7 @@ export default { if (condition.length > 1 && this.dimensionType) { params.param = condition[1] params.type = this.dimensionType + if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip' params.limit = 10 url = api.npm.events.recentEventsD this.customTableTitles = [ diff --git a/src/views/charts2/charts/npm/NpmTabs.vue b/src/views/charts2/charts/npm/NpmTabs.vue index 4cdd9336..3a5a9f39 100644 --- a/src/views/charts2/charts/npm/NpmTabs.vue +++ b/src/views/charts2/charts/npm/NpmTabs.vue @@ -93,15 +93,10 @@ export default { self.serverSessions = self.sessionData.serverSessions / (self.sessionData.clientSessions * 1 + self.sessionData.serverSessions * 1) } }).finally(() => { - let thirdMenu = this.$route.query['thirdMenu'] let currentTab = 0 self.tabs[0].disable = false self.tabs[1].disable = false - if(thirdMenu === 'network.clientIps'){ - currentTab = 0 - }else if(thirdMenu === 'network.serverIps'){ - currentTab = 1 - }else if (self.clientSessions === 0) { + if (self.clientSessions === 0) { currentTab = 1 self.tabs[0].disable = true self.tabs[1].disable = false