Merge branch 'dev-3.8' of git.mesalab.cn:nezha/nezha-fronted into dev-3.8

This commit is contained in:
zyh
2023-08-25 13:59:15 +08:00
2 changed files with 9 additions and 2 deletions

View File

@@ -1113,6 +1113,9 @@ export default {
if (this.targetTab) { if (this.targetTab) {
switch (this.targetTab) { switch (this.targetTab) {
case 'alertMessageTab': case 'alertMessageTab':
case 'moduleAlertMessage':
case 'endpointAlertMessage':
case 'alertRuleAlertMessage':
return 'alertmessage' return 'alertmessage'
} }
} }

View File

@@ -381,10 +381,14 @@ export default {
this.oldSearchTime[1] = bus.timeFormate(this.oldSearchTime[1]) this.oldSearchTime[1] = bus.timeFormate(this.oldSearchTime[1])
} }
} }
if (moment(this.oldSearchTime[0], timeFormatMain).isValid() && moment(this.oldSearchTime[1], timeFormatMain).isValid() && !moment(this.oldSearchTime[0]).isBefore(this.oldSearchTime[1])) { let isBefore = true
if (moment(this.oldSearchTime[0], timeFormatMain).isValid() && moment(this.oldSearchTime[1], timeFormatMain).isValid()) {
isBefore = this.momentStrToTimestamp(this.oldSearchTime[0]) < this.momentStrToTimestamp(this.oldSearchTime[1])
}
if (moment(this.oldSearchTime[0], timeFormatMain).isValid() && moment(this.oldSearchTime[1], timeFormatMain).isValid() && !isBefore) {
this.oldSearchTimeError[0] = true this.oldSearchTimeError[0] = true
this.inputError = this.$t('date.fromGreaterTo') this.inputError = this.$t('date.fromGreaterTo')
} else if (moment(this.oldSearchTime[0], timeFormatMain).isValid() && moment(this.oldSearchTime[1], timeFormatMain).isValid() && moment(this.oldSearchTime[0]).isBefore(this.oldSearchTime[1])) { } else if (moment(this.oldSearchTime[0], timeFormatMain).isValid() && moment(this.oldSearchTime[1], timeFormatMain).isValid() && isBefore) {
this.oldSearchTimeError[0] = false this.oldSearchTimeError[0] = false
} }
}, },