fix: 1.npm tab为location折线图数据为空时ecahrts图加载报错2.npm 下钻世界地图接口参数错误和tab切换未正常禁用问题

This commit is contained in:
@changcode
2022-11-18 15:18:12 +08:00
parent 4c107704e7
commit 90ee54c3ad
4 changed files with 23 additions and 25 deletions

View File

@@ -90,6 +90,7 @@ export default {
// typeVal: this.$store.getters.getBreadcrumbColumnValue // typeVal: this.$store.getters.getBreadcrumbColumnValue
typeVal: this.getUrlParam(this.curTabState.fourthMenu, '') typeVal: this.getUrlParam(this.curTabState.fourthMenu, '')
} }
if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip'
getData(api.npm.overview.map, params).then(res => { getData(api.npm.overview.map, params).then(res => {
const subParams = { const subParams = {
...params, ...params,
@@ -121,6 +122,9 @@ export default {
pktRetransPercent: t.packetRetransScore ? t.packetRetransScore.pktRetransPercent : null pktRetransPercent: t.packetRetransScore ? t.packetRetransScore.pktRetransPercent : null
} }
t.score = computeScore(data) t.score = computeScore(data)
if (t.score === '-') {
t.score = ''
}
}) })
this.loadMarkerData(imageSeries, mapData) this.loadMarkerData(imageSeries, mapData)
}) })
@@ -133,7 +137,7 @@ export default {
}, },
loadMarkerData (imageSeries, data) { loadMarkerData (imageSeries, data) {
imageSeries.data = data.map(r => ({ imageSeries.data = data.map(r => ({
score: r.score, score: r.score || '–',
name: r.province || r.country, name: r.province || r.country,
throughput: valueToRangeValue(r.throughBitsRate, unitTypes.bps).join(' '), throughput: valueToRangeValue(r.throughBitsRate, unitTypes.bps).join(' '),
id: r.serverId, id: r.serverId,

View File

@@ -135,6 +135,7 @@ export default {
get(url, params).then(res => { get(url, params).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.isNoData = res.data.result.length === 0 this.isNoData = res.data.result.length === 0
if (!this.isNoData) {
if (this.chart.params.index === 0) { if (this.chart.params.index === 0) {
res.data.result.forEach((t, i) => { res.data.result.forEach((t, i) => {
if (t.type === 'totalBitsRate') { if (t.type === 'totalBitsRate') {
@@ -151,6 +152,7 @@ export default {
this.echartsInit(res.data.result, this.chartData, this.chartData.params.unitType) this.echartsInit(res.data.result, this.chartData, this.chartData.params.unitType)
} }
} }
}
}).finally(() => { }).finally(() => {
this.toggleLoading(false) this.toggleLoading(false)
}) })

View File

@@ -83,11 +83,7 @@ export default {
}, },
methods: { methods: {
recentEventsListData () { recentEventsListData () {
// const condition = this.$store.getters.getQueryCondition.split(/["|'](.*?)["|']/)
// const conditionStr = this.$route.query.queryCondition ? this.$route.query.queryCondition : ''
const condition = this.queryCondition.split(/["|'](.*?)["|']/) const condition = this.queryCondition.split(/["|'](.*?)["|']/)
// const type = this.$store.getters.getDimensionType
// const type = this.$route.query.dimensionType ? this.$route.query.dimensionType : ''
let url = '' let url = ''
const params = { const params = {
startTime: getSecond(this.timeFilter.startTime), startTime: getSecond(this.timeFilter.startTime),
@@ -97,6 +93,7 @@ export default {
if (condition.length > 1 && this.dimensionType) { if (condition.length > 1 && this.dimensionType) {
params.param = condition[1] params.param = condition[1]
params.type = this.dimensionType params.type = this.dimensionType
if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip'
params.limit = 10 params.limit = 10
url = api.npm.events.recentEventsD url = api.npm.events.recentEventsD
this.customTableTitles = [ this.customTableTitles = [

View File

@@ -93,15 +93,10 @@ export default {
self.serverSessions = self.sessionData.serverSessions / (self.sessionData.clientSessions * 1 + self.sessionData.serverSessions * 1) self.serverSessions = self.sessionData.serverSessions / (self.sessionData.clientSessions * 1 + self.sessionData.serverSessions * 1)
} }
}).finally(() => { }).finally(() => {
let thirdMenu = this.$route.query['thirdMenu']
let currentTab = 0 let currentTab = 0
self.tabs[0].disable = false self.tabs[0].disable = false
self.tabs[1].disable = false self.tabs[1].disable = false
if(thirdMenu === 'network.clientIps'){ if (self.clientSessions === 0) {
currentTab = 0
}else if(thirdMenu === 'network.serverIps'){
currentTab = 1
}else if (self.clientSessions === 0) {
currentTab = 1 currentTab = 1
self.tabs[0].disable = true self.tabs[0].disable = true
self.tabs[1].disable = false self.tabs[1].disable = false