fix: 实体列表恢复事件数量,并完善下拉详情和列表事件数量的一致性

This commit is contained in:
刘洪洪
2023-11-22 10:44:17 +08:00
parent bfb1d93d95
commit b30a8a8a25
7 changed files with 46 additions and 18 deletions

View File

@@ -292,17 +292,31 @@ export default {
/** 获取事件数量 */
queryEventNum () {
this.loadingEvent = true
const performance = axios.get(this.performanceEventUrl, { params: this.getQueryParams() })
const security = axios.get(this.securityEventUrl, { params: this.getQueryParams() })
// const performance = axios.get(this.performanceEventUrl, { params: this.getQueryParams() })
// const security = axios.get(this.securityEventUrl, { params: this.getQueryParams() })
// performance接口修改暂时不能访问故只调用security的后续加上
this.eventNum = 0
Promise.all([performance, security]).then(response => {
this.eventNum = response[0].data.data.result.length + response[1].data.data.result.length
}).catch(e => {
this.eventNum = 0
const param = {
params: {
...this.getQueryParams(),
pageSize: -1
}
}
axios.get(this.securityEventUrl, param).then(res => {
if (res.status === 200) {
this.eventNum = res.data.data.result.length
}
}).finally(() => {
this.loadingEvent = false
})
// Promise.all([performance, security]).then(response => {
// this.eventNum = response[0].data.data.result.length + response[1].data.data.result.length
// }).catch(e => {
// this.eventNum = 0
// }).finally(() => {
// this.loadingEvent = false
// })
},
handleScoreData () {
this.score = computeScore(this.performanceScoreData, this.$store.getters.getScoreBase)
@@ -335,7 +349,7 @@ export default {
setTimeout(() => {
this.queryEntityDetailTraffic()
this.queryNetworkQuantity()
// this.queryEventNum()
this.queryEventNum()
})
},
beforeUnmount () {