Merge branch 'dev-3.9' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.10

This commit is contained in:
zhangyu
2023-11-30 09:44:53 +08:00
3 changed files with 5 additions and 4 deletions

View File

@@ -600,7 +600,7 @@ export default {
this.$get(url, queryParams).then(response => { this.$get(url, queryParams).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {
this.nowTime = this.utcTimeToTimezoneStr(response.time) this.nowTime = response.time
this.tableData = response.data.list this.tableData = response.data.list
this.deleteBox.ids = '' this.deleteBox.ids = ''
this.pageObj.total = response.data.total this.pageObj.total = response.data.total

View File

@@ -259,12 +259,13 @@ export default {
return function (record) { return function (record) {
// 当 state = active | silence 时duration = 当前服务器时间result.time- startAt // 当 state = active | silence 时duration = 当前服务器时间result.time- startAt
if (record.state == 1 || record.state == 2) { if (record.state == 1 || record.state == 2) {
return calcDurationByStringTimeB(record.startAt, this.timezoneToUtcTimeStr(this.nowTime)) console.log(record.startAt, this.nowTime, record.endAt)
return calcDurationByStringTimeB(record.startAt, this.nowTime)
} }
if (record.endAt) { if (record.endAt) {
return calcDurationByStringTimeB(record.startAt, record.endAt) return calcDurationByStringTimeB(record.startAt, record.endAt)
} }
return calcDurationByStringTimeB(record.startAt, this.timezoneToUtcTimeStr(this.nowTime)) return calcDurationByStringTimeB(record.startAt, this.nowTime)
} }
} }
}, },

View File

@@ -951,7 +951,7 @@ export default {
this.$get('/alert/message/query', { ...queryParams }).then(response => { this.$get('/alert/message/query', { ...queryParams }).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code == 200) { if (response.code == 200) {
this.nowTime = this.utcTimeToTimezoneStr(response.time) this.nowTime = response.time
response.data.list.forEach((item) => { response.data.list.forEach((item) => {
const labels = JSON.parse(item.labels) const labels = JSON.parse(item.labels)
if (labels) { if (labels) {