fix: CN-1518 实体详情流量曲线图的交互逻辑优化(减少请求次数)

This commit is contained in:
hyx
2023-12-21 15:59:04 +08:00
parent 0f2f5ecdde
commit eb7a9f875c
5 changed files with 83 additions and 18 deletions

View File

@@ -156,7 +156,19 @@ export default {
e.invertTab = true
}
})
this.init(n, this.showMarkLine, '', n)
const { query } = this.$route
const rangeParam = query.range
if (rangeParam !== -1) {
let timeFilter = {}
if (query.startTime && query.endTime) {
timeFilter = { startTime: parseInt(query.startTime), endTime: parseInt(query.endTime) }
this.init(n, this.showMarkLine, '', n, timeFilter)
} else {
this.init(n, this.showMarkLine, '', n)
}
} else {
this.initTabData(n, this.showMarkLine, '', n)
}
}
},
methods: {
@@ -165,13 +177,19 @@ export default {
const newUrl = urlParamsHandler(window.location.href, query, newParam)
overwriteUrl(newUrl)
},
init (val, show, active, n) {
init (val, show, active, n, timeFilter) {
const newVal = val ? _.clone(val) : this.metric
const params = {
let params = {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime)
}
if (timeFilter) {
params = {
startTime: timeFilter.startTime,
endTime: timeFilter.endTime
}
}
let url
if (this.lineQueryCondition && this.fourthMenu) {