CN-812 feat: npm下钻三级菜单网络性能接口,前端对应逻辑优化调整

This commit is contained in:
changcode
2022-11-25 16:08:32 +08:00
parent c7eacdd6f6
commit d25912b2ce
3 changed files with 30 additions and 95 deletions

View File

@@ -260,6 +260,8 @@ export default {
const queryCondition = ref(query.queryCondition || '')
const dimensionType = ref(query.dimensionType || '')
// 三级菜单判断
const tabOperationType = ref(query.tabOperationType)
const networkOverviewBeforeTab = ref(query.networkOverviewBeforeTab || '')
return {
panelType,
@@ -270,6 +272,7 @@ export default {
path,
queryCondition,
dimensionType,
tabOperationType,
networkOverviewBeforeTab
}
},
@@ -343,12 +346,13 @@ export default {
},
scoreCalculation () {
let condition = ''
let url = ''
if (this.queryCondition.indexOf(' OR ') > -1) {
condition = this.queryCondition.split(/["|'](.*?)["|']/)
} else {
condition = this.queryCondition
}
const type = this.dimensionType || this.networkOverviewBeforeTab
let type = this.dimensionType || this.networkOverviewBeforeTab
const params = {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
@@ -382,9 +386,14 @@ export default {
params.type = type
}
}
if (parseFloat(this.tabOperationType) === 3) {
url = api.npm.overview.allNetworkAnalysis
} else {
url = api.npm.overview.networkAnalysis
}
if ((type && condition) || type) {
params.type = params.type || type
get(api.npm.overview.networkAnalysis, params).then(res => {
get(url, params).then(res => {
if (res.code === 200) {
const data = {
establishLatencyMs: res.data.result.establishLatencyMsAvg || null,