CN-399 Detection--服务质量事件 指标变化曲线开发:时间查询参数应为秒级时间戳
This commit is contained in:
@@ -160,8 +160,8 @@ export default {
|
|||||||
|
|
||||||
get(api.detection.performanceEvent.metric, {
|
get(api.detection.performanceEvent.metric, {
|
||||||
domain: this.detection.domain,
|
domain: this.detection.domain,
|
||||||
startTime: this.searchStartTime*1000,
|
startTime: this.searchStartTime,
|
||||||
endTime: this.searchEndTime*1000,
|
endTime: this.searchEndTime,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
resolve(response.data.result[0])
|
resolve(response.data.result[0])
|
||||||
|
|||||||
@@ -91,15 +91,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { api, getData } from '@/utils/api'
|
import { api, getData } from '@/utils/api'
|
||||||
import { eventSeverityColor, unitTypes } from '@/utils/constants'
|
import { eventSeverityColor,unitTypes ,topDomain} from '@/utils/constants'
|
||||||
import { getSecond } from '@/utils/date-util'
|
import { getSecond } from '@/utils/date-util'
|
||||||
import { get } from '@/utils/http'
|
import { get } from '@/utils/http'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import { markRaw } from 'vue'
|
import { markRaw } from 'vue'
|
||||||
import { metricOption } from '@/views/detections/options/detectionOptions'
|
import { metricOption } from '@/views/detections/options/detectionOptions'
|
||||||
import { sortBy, reverseSortBy, computeSecondaryDomain } from '@/utils/tools'
|
import { sortBy,reverseSortBy } from '@/utils/tools'
|
||||||
export default {
|
export default {
|
||||||
name: 'DetectionPerformanceEventDomainOverview',
|
name: 'DetectionPerformanceEventDomainOverview',
|
||||||
props: {
|
props: {
|
||||||
detection: Object
|
detection: Object
|
||||||
@@ -135,10 +135,35 @@ export default {
|
|||||||
}
|
}
|
||||||
return result || '-'
|
return result || '-'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computeSecondaryDomain () {
|
||||||
|
return function (name) {
|
||||||
|
// 命中的顶级域名
|
||||||
|
let hitTopDomain = ''
|
||||||
|
// 同顶级域名比对
|
||||||
|
const hits = []
|
||||||
|
topDomain.forEach(td => {
|
||||||
|
const hitIndex = name.lastIndexOf(td)
|
||||||
|
if (hitIndex > -1 && hitIndex + td.length === name.length) {
|
||||||
|
hits.push(td)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (hits.length > 0) {
|
||||||
|
hits.sort((a, b) => {
|
||||||
|
return b.split('.').length - a.split('.').length
|
||||||
|
})
|
||||||
|
hitTopDomain = hits[0]
|
||||||
|
} else {
|
||||||
|
const arr = name.split('.')
|
||||||
|
hitTopDomain = arr[arr.length - 1]
|
||||||
|
}
|
||||||
|
const index = name.lastIndexOf(hitTopDomain)
|
||||||
|
const preArr = name.substring(0, index).split('.')
|
||||||
|
return [preArr[preArr.length - 2], hitTopDomain].join('.')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
computeSecondaryDomain,
|
|
||||||
query () {
|
query () {
|
||||||
this.queryBasic().then(responses => {
|
this.queryBasic().then(responses => {
|
||||||
responses && (this.basicInfo = responses)
|
responses && (this.basicInfo = responses)
|
||||||
@@ -194,8 +219,8 @@ export default {
|
|||||||
|
|
||||||
get(api.detection.performanceEvent.metric, {
|
get(api.detection.performanceEvent.metric, {
|
||||||
domain: this.detection.domain,
|
domain: this.detection.domain,
|
||||||
startTime: this.searchStartTime*1000,
|
startTime: this.searchStartTime,
|
||||||
endTime: this.searchEndTime*1000,
|
endTime: this.searchEndTime,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
resolve(response.data.result[0])
|
resolve(response.data.result[0])
|
||||||
@@ -240,5 +265,5 @@ export default {
|
|||||||
chartOption: metricOption,
|
chartOption: metricOption,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -183,8 +183,8 @@ export default {
|
|||||||
|
|
||||||
get(api.detection.performanceEvent.metric, {
|
get(api.detection.performanceEvent.metric, {
|
||||||
domain: this.detection.domain,
|
domain: this.detection.domain,
|
||||||
startTime: this.searchStartTime*1000,
|
startTime: this.searchStartTime,
|
||||||
endTime: this.searchEndTime*1000,
|
endTime: this.searchEndTime,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
resolve(response.data.result[0])
|
resolve(response.data.result[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user