fix: Dashboard - npm - 近期事件下钻列表调整

This commit is contained in:
@changcode
2022-08-26 11:30:53 +08:00
parent 12ea5dc160
commit 4c4e798c15
2 changed files with 16 additions and 2 deletions

View File

@@ -45,9 +45,8 @@
<script>
import { get } from '@/utils/http'
import { api } from '@/utils/api'
import { getSecond } from '@/utils/date-util'
import { getSecond, dateFormatByAppearance } from '@/utils/date-util'
import chartMixin from '@/views/charts2/chart-mixin'
import _ from 'lodash'
export default {
name: 'NpmRecentEvents',
@@ -85,6 +84,11 @@ export default {
params.type = type
params.limit = 10
url = api.npm.events.recentEventsD
this.customTableTitles = [
{ label: 'network.severity', prop: 'eventSeverity' },
{ label: 'detections.eventType', prop: 'eventType' },
{ label: 'detection.list.startTime', prop: 'startTime' }
]
} else {
url = api.npm.events.recentEvents
}
@@ -94,6 +98,11 @@ export default {
if (res.data.result.length === 0) {
this.isNoData = true
}
res.data.result.forEach(e => {
if (e.startTime) {
e.startTime = dateFormatByAppearance(e.startTime)
}
})
this.tableData = res.data.result
} else {
this.isNoData = true