fix;修改 silence的时间问题
This commit is contained in:
@@ -225,6 +225,8 @@ export default {
|
||||
}
|
||||
const params = { ...this.editAlertSilence, matchers: JSON.stringify(this.editAlertSilence.matchers) }
|
||||
if (valid) {
|
||||
params.startAt = bus.timeFormate(new Date(this.timezoneToUtcTime(params.startAt)))
|
||||
params.endAt = bus.timeFormate(new Date(this.timezoneToUtcTime(params.endAt)))
|
||||
if (this.editAlertSilence.id) {
|
||||
this.$put('/alert/silence', params).then(response => {
|
||||
this.prevent_opt.save = false
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-tooltip :disabled="!scope.row.endAt" effect="light" placement="right">
|
||||
<div slot="content">
|
||||
{{$t('config.terminallog.endTime')}}<br/>
|
||||
{{scope.row.endAt}}
|
||||
{{utcTimeToTimezoneStr(scope.row.endAt)}}
|
||||
</div>
|
||||
<span>{{getDuration(scope.row)}}</span>
|
||||
</el-tooltip>
|
||||
@@ -76,6 +76,9 @@
|
||||
<template v-else-if="item.prop === 'utime'">
|
||||
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'startAt'">
|
||||
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
|
||||
</template>
|
||||
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop] || '-'}}</span>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
|
||||
@@ -147,6 +147,34 @@ export default {
|
||||
this.importBox.show = false
|
||||
this.deleteBox.show = false
|
||||
},
|
||||
getTableData (params) {
|
||||
if (params && Object.keys(params).length > 0) {
|
||||
for (const key in params) {
|
||||
this.$set(this.searchLabel, key, params[key])
|
||||
}
|
||||
}
|
||||
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
||||
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
|
||||
this.tools.loading = true
|
||||
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
|
||||
this.tools.loading = false
|
||||
if (response.code === 200) {
|
||||
for (let i = 0; i < response.data.list.length; i++) {
|
||||
response.data.list[i].status = response.data.list[i].status + ''
|
||||
// response.data.list[i].startAt = bus.UTCTimeToConfigTimezone(response.data.list[i].startAt)
|
||||
// response.data.list[i].endAt = bus.UTCTimeToConfigTimezone(response.data.list[i].endAt)
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.pageObj.total = response.data.total
|
||||
if (!this.scrollbarWrap) {
|
||||
this.$nextTick(() => {
|
||||
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
||||
this.toTopBtnHandler(this.scrollbarWrap)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
add () {
|
||||
this.blackObject.startAt = bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss')
|
||||
this.blackObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'yyyy-MM-dd hh:mm:ss')
|
||||
@@ -158,7 +186,9 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.object = {
|
||||
...response.data,
|
||||
matchers: JSON.parse(response.data.matchers)
|
||||
matchers: JSON.parse(response.data.matchers),
|
||||
startAt: bus.UTCTimeToConfigTimezone(response.data.startAt),
|
||||
endAt: bus.UTCTimeToConfigTimezone(response.data.endAt)
|
||||
}
|
||||
this.rightBox.show = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user