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

@@ -86,6 +86,11 @@
border-radius: 4px; border-radius: 4px;
padding: 0 6px; padding: 0 6px;
} }
span {
font-size: 12px;
color: #353636;
font-weight: 400;
}
} }
.el-table--group::after,.el-table--border::after, .el-table::before { .el-table--group::after,.el-table--border::after, .el-table::before {
height: 0px; height: 0px;

View File

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