fix: 修复detection下拉内容中domain和app的展示调整

This commit is contained in:
刘洪洪
2023-01-09 16:36:44 +08:00
parent 4804748564
commit d84483c0dc
4 changed files with 44 additions and 30 deletions

View File

@@ -61,7 +61,7 @@
<div class="metric__column">
<div class="overview__title">{{$t('detections.metric')}}</div>
<div class="overview__row">
<div class="row__content--metric ">{{detection.eventType || '-'}}</div>
<div class="row__content--metric ">{{getNameByEventType(detection.eventType) || '-'}}</div>
</div>
</div>
<div class="metric__column">
@@ -95,7 +95,7 @@ import { get } from '@/utils/http'
import * as echarts from 'echarts'
import { markRaw } from 'vue'
import { metricOption } from '@/views/detections/options/detectionOptions'
import { sortBy, reverseSortBy } from '@/utils/tools'
import { sortBy, reverseSortBy, getNameByEventType } from '@/utils/tools'
import _ from 'lodash'
export default {
name: 'DetectionPerformanceEventAppOverview',
@@ -134,6 +134,7 @@ export default {
}
},
methods: {
getNameByEventType,
query () {
this.queryBasic().then(responses => {
responses && (this.basicInfo = responses)
@@ -180,6 +181,10 @@ export default {
this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex - 1, this.metricList.length).map(v => [Number(v[0]) * 1000, Number(v[1]), unitTypes.number])
}
this.chartOptionMetric.series.forEach(item => {
item.name = this.getNameByEventType(this.detection.eventType)
})
this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric)
},