fix:修改 alertMessage endTIme 显示不正确的问题

This commit is contained in:
zhangyu
2021-05-19 18:41:00 +08:00
parent f2ae0c9717
commit 0f5176cd48
2 changed files with 5 additions and 5 deletions

View File

@@ -60,12 +60,12 @@
<span v-else-if="item.prop === 'severity'&&scope.row[item.prop]" class="severity"> <span v-else-if="item.prop === 'severity'&&scope.row[item.prop]" class="severity">
<i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}} <i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}}
</span> </span>
<span v-else-if="item.prop === 'startAt'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span> <span v-else-if="item.prop === 'startAt'">{{utcTimeToTimezoneStr(scope.row.startAt)}}</span>
<template v-else-if="item.prop === 'duration'"> <template v-else-if="item.prop === 'duration'">
<el-tooltip :disabled="!scope.row.endAt" effect="light" placement="right"> <el-tooltip :disabled="!scope.row.endAt" effect="light" placement="right">
<div slot="content"> <div slot="content">
{{$t('config.terminallog.endTime')}}<br/> {{$t('config.terminallog.endTime')}}<br/>
{{scope.row.endAt}} {{utcTimeToTimezoneStr(scope.row.endAt)}}
</div> </div>
<span>{{getDuration(scope.row)}}</span> <span>{{getDuration(scope.row)}}</span>
</el-tooltip> </el-tooltip>
@@ -236,7 +236,7 @@ export default {
}, },
getDuration () { getDuration () {
return function (record) { return function (record) {
if (record.endTime) { if (record.endAt) {
return calcDurationByStringTimeB(record.startAt, record.endAt) return calcDurationByStringTimeB(record.startAt, record.endAt)
} }
return calcDurationByStringTimeB(record.startAt, this.nowTime) return calcDurationByStringTimeB(record.startAt, this.nowTime)

View File

@@ -144,7 +144,7 @@ export default {
id: 26, id: 26,
name: this.$t('alert.list.id'), name: this.$t('alert.list.id'),
type: 'id', type: 'id',
label: 'id', label: 'ids',
disabled: false disabled: false
}, },
{ {
@@ -244,7 +244,7 @@ export default {
}, },
queryChartDate () { queryChartDate () {
const $temp = this const $temp = this
const start = this.searchTime[0] ? this.searchTime[0] : bus.computeTimezoneTime(new Date().getTime() - 1 * 30 * 60* 1000) const start = this.searchTime[0] ? this.searchTime[0] : bus.computeTimezoneTime(new Date().getTime() - 1 * 30 * 60 * 1000)
const end = this.searchTime[1] ? this.searchTime[1] : bus.computeTimezoneTime(new Date().getTime()) const end = this.searchTime[1] ? this.searchTime[1] : bus.computeTimezoneTime(new Date().getTime())
this.searchTimeDialog = [start, end] this.searchTimeDialog = [start, end]
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60) const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)