fix: 修复app详情列表曲线图缺失、统计数据错位问题

This commit is contained in:
chenjinsong
2021-10-09 16:14:50 +08:00
parent 254fa3d5b6
commit 392cb144ee
4 changed files with 93 additions and 65 deletions

View File

@@ -915,12 +915,13 @@ export default {
const sumData = []
data.forEach(r => {
const hit = sumData.find(s => s.id === r.serverId)
const value = Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
if (hit) {
hit.value += Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
hit.value += value
} else {
sumData.push({
id: r.serverId,
value: Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
value
})
}
})

View File

@@ -23,6 +23,7 @@
<entity-list
:list-data="listData"
:from="from"
:loading="loading"
:page-obj="pageObjRight"
@showDetail="entityDetail"
@pageNo="pageNoRight"
@@ -71,7 +72,8 @@ export default {
total: 0
},
showDetail: false,
currentEntity: {}
currentEntity: {},
loading: true
}
},
components: {
@@ -121,17 +123,25 @@ export default {
}
},
async search () {
const vm = this
const params = { from: this.from, q: doubleQuotationToSingle(this.searchContent) }
this.listData = (await getEntityList({ ...this.pageObjRight, ...params })).map(d => ({
...d,
id: window.btoa(d.ip || d.domainName || d.appId),
latestSent: null,
latestReceived: null
}))
this.pageObjRight.total = await getEntityCount(params)
const { topFilterData, bottomFilterData } = await this.queryFilterData(params)
this.topFilterData = topFilterData
this.bottomFilterData = bottomFilterData
this.loading = true
try {
this.listData = (await getEntityList({ ...this.pageObjRight, ...params })).map(d => ({
...d,
id: window.btoa(d.ip || d.domainName || d.appName),
latestSent: null,
latestReceived: null
}))
this.pageObjRight.total = await getEntityCount(params)
const { topFilterData, bottomFilterData } = await this.queryFilterData(params)
this.topFilterData = topFilterData
this.bottomFilterData = bottomFilterData
} finally {
setTimeout(() => {
vm.loading = false
}, 250)
}
},
/* 重置条件 */
reset () {