fix;修改 silence的时间问题
This commit is contained in:
@@ -225,6 +225,8 @@ export default {
|
|||||||
}
|
}
|
||||||
const params = { ...this.editAlertSilence, matchers: JSON.stringify(this.editAlertSilence.matchers) }
|
const params = { ...this.editAlertSilence, matchers: JSON.stringify(this.editAlertSilence.matchers) }
|
||||||
if (valid) {
|
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) {
|
if (this.editAlertSilence.id) {
|
||||||
this.$put('/alert/silence', params).then(response => {
|
this.$put('/alert/silence', params).then(response => {
|
||||||
this.prevent_opt.save = false
|
this.prevent_opt.save = false
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<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>
|
||||||
@@ -76,6 +76,9 @@
|
|||||||
<template v-else-if="item.prop === 'utime'">
|
<template v-else-if="item.prop === 'utime'">
|
||||||
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
|
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
|
||||||
</template>
|
</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>
|
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop] || '-'}}</span>
|
||||||
<template v-else>-</template>
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -147,6 +147,34 @@ export default {
|
|||||||
this.importBox.show = false
|
this.importBox.show = false
|
||||||
this.deleteBox.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 () {
|
add () {
|
||||||
this.blackObject.startAt = bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss')
|
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')
|
this.blackObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'yyyy-MM-dd hh:mm:ss')
|
||||||
@@ -158,7 +186,9 @@ export default {
|
|||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.object = {
|
this.object = {
|
||||||
...response.data,
|
...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
|
this.rightBox.show = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user