fix:修改时间选择器 定时刷新导致时间显示不正确的问题
This commit is contained in:
@@ -726,11 +726,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (value < 1024 && type === 'Data') {
|
if (value < 1024 && type === 'Data') {
|
||||||
const interVal = value / copies
|
let interVal = value / copies
|
||||||
|
interVal = !isNaN(interVal) ? interVal : 1
|
||||||
return interVal
|
return interVal
|
||||||
}
|
}
|
||||||
if (value < 1000 && (type === 'DataRate' || type === 'Misc')) {
|
if (value < 1000 && (type === 'DataRate' || type === 'Misc')) {
|
||||||
const interVal = value / copies
|
let interVal = value / copies
|
||||||
|
interVal = !isNaN(interVal) ? interVal : 1
|
||||||
return interVal
|
return interVal
|
||||||
}
|
}
|
||||||
if (type === 'Data') {
|
if (type === 'Data') {
|
||||||
@@ -743,7 +745,8 @@ export default {
|
|||||||
}
|
}
|
||||||
interVal = Math.ceil(interVal) * Math.pow(1024, pow)
|
interVal = Math.ceil(interVal) * Math.pow(1024, pow)
|
||||||
}
|
}
|
||||||
interVal = interVal || 1
|
console.log(interVal)
|
||||||
|
interVal = !isNaN(interVal) ? interVal : 1
|
||||||
return interVal
|
return interVal
|
||||||
}
|
}
|
||||||
if (type === 'DataRate' || type === 'Misc') {
|
if (type === 'DataRate' || type === 'Misc') {
|
||||||
@@ -756,7 +759,7 @@ export default {
|
|||||||
}
|
}
|
||||||
interVal = Math.ceil(interVal) * Math.pow(1000, pow)
|
interVal = Math.ceil(interVal) * Math.pow(1000, pow)
|
||||||
}
|
}
|
||||||
interVal = interVal || 1
|
interVal = !isNaN(interVal) ? interVal : 1
|
||||||
return interVal
|
return interVal
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -1766,10 +1766,10 @@ export default {
|
|||||||
maxValue = 0
|
maxValue = 0
|
||||||
minValue = 0
|
minValue = 0
|
||||||
for (let j = 0; j < dataArg.length; j++) {
|
for (let j = 0; j < dataArg.length; j++) {
|
||||||
for (let i = 0; i < dataArg[j].data.length - 1; i++) {
|
for (let i = 0; i < dataArg[j].data.length; i++) {
|
||||||
if (dataArg[j].data[i + 1][1] !== 'NaN') {
|
if (!isNaN(dataArg[j].data[i][1])) {
|
||||||
maxValue = (maxValue < Number(dataArg[j].data[i + 1][1]) ? Number(dataArg[j].data[i + 1][1]) : maxValue)
|
maxValue = (maxValue < Number(dataArg[j].data[i][1]) ? Number(dataArg[j].data[i][1]) : maxValue)
|
||||||
minValue = (minValue > Number(dataArg[j].data[i + 1][1]) ? Number(dataArg[j].data[i + 1][1]) : minValue)
|
minValue = (minValue > Number(dataArg[j].data[i][1]) ? Number(dataArg[j].data[i][1]) : minValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1063,7 +1063,8 @@ const cn = {
|
|||||||
project: '项目',
|
project: '项目',
|
||||||
module: '模块',
|
module: '模块',
|
||||||
endpoint: 'endpoint',
|
endpoint: 'endpoint',
|
||||||
asset: '资产'
|
asset: '资产',
|
||||||
|
timeError: '结束时间必须大于开始时间'
|
||||||
},
|
},
|
||||||
P1Rule: 'P1: 万分紧急,可导致业务瘫痪的告警',
|
P1Rule: 'P1: 万分紧急,可导致业务瘫痪的告警',
|
||||||
P2Rule: 'P2: 重要,需要紧急关注的警报,但还没有影响业务',
|
P2Rule: 'P2: 重要,需要紧急关注的警报,但还没有影响业务',
|
||||||
|
|||||||
@@ -1068,8 +1068,8 @@ const en = {
|
|||||||
project: 'project',
|
project: 'project',
|
||||||
module: 'module',
|
module: 'module',
|
||||||
endpoint: 'endpoint',
|
endpoint: 'endpoint',
|
||||||
asset: 'asset'
|
asset: 'asset',
|
||||||
|
timeError: 'The end time must be greater than the start time'
|
||||||
},
|
},
|
||||||
P1Rule: 'P1: Critical, alert that can cause business paralysis',
|
P1Rule: 'P1: Critical, alert that can cause business paralysis',
|
||||||
P2Rule: 'P2: Major, alert that requires urgent attention, but does not affect the business yet',
|
P2Rule: 'P2: Major, alert that requires urgent attention, but does not affect the business yet',
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getIntervalData (interval) { // interval:结束时间到现在的秒数
|
getIntervalData (interval) { // interval:结束时间到现在的秒数
|
||||||
const start = new Date(this.searchTime[0])
|
// const start = new Date(this.searchTime[0])
|
||||||
const end = new Date(this.searchTime[1])
|
// const end = new Date(this.searchTime[1])
|
||||||
start.setSeconds(start.getSeconds() + interval)
|
// start.setSeconds(start.getSeconds() + interval)
|
||||||
end.setSeconds(end.getSeconds() + interval)
|
// end.setSeconds(end.getSeconds() + interval)
|
||||||
|
//
|
||||||
this.searchTime = this.timeFormate([start, end])
|
// this.searchTime = this.timeFormate([start, end])
|
||||||
this.$refs.timePicker.setCostomTime(this.searchTime)
|
// this.$refs.timePicker.setCostomTime(this.searchTime)
|
||||||
this.$emit('change', this.searchTime)
|
// this.$emit('change', this.searchTime)
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
this.refreshDataFunc()
|
this.refreshDataFunc()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -173,9 +173,9 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
const validate = (rule, value, callback) => {
|
const validate = (rule, value, callback) => {
|
||||||
if (!this.editAlertSilence.startAt) {
|
if (!this.editAlertSilence.startAt) {
|
||||||
callback(new Error('请选择开始时间!'))
|
callback(new Error(this.$t('alert.silence.selectTime')))
|
||||||
} else if (!this.editAlertSilence.endAt) {
|
} else if (!this.editAlertSilence.endAt) {
|
||||||
callback(new Error('请选择结束时间!'))
|
callback(new Error(this.$t('alert.silence.selectTime')))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
@@ -244,8 +244,9 @@ export default {
|
|||||||
this.editAlertSilence.matcher = this.editAlertSilence.ruleId || this.editAlertSilence.linkId
|
this.editAlertSilence.matcher = this.editAlertSilence.ruleId || this.editAlertSilence.linkId
|
||||||
this.$refs.alertSilenceForm.validate((valid) => {
|
this.$refs.alertSilenceForm.validate((valid) => {
|
||||||
if (this.endAtTamp < this.startAtTamp) {
|
if (this.endAtTamp < this.startAtTamp) {
|
||||||
|
this.prevent_opt.save = false
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '结束时间必须大于开始时间',
|
message: this.$t('alert.silence.timeError'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -500,10 +500,10 @@ export default {
|
|||||||
maxValue = 0
|
maxValue = 0
|
||||||
minValue = 0
|
minValue = 0
|
||||||
for (let j = 0; j < dataArg.length; j++) {
|
for (let j = 0; j < dataArg.length; j++) {
|
||||||
for (let i = 0; i < dataArg[j].data.length - 1; i++) {
|
for (let i = 0; i < dataArg[j].data.length; i++) {
|
||||||
if (dataArg[j].data[i + 1][1] !== 'NaN') {
|
if (!isNaN(dataArg[j].data[i][1])) {
|
||||||
maxValue = (maxValue < Number(dataArg[j].data[i + 1][1]) ? Number(dataArg[j].data[i + 1][1]) : maxValue)
|
maxValue = (maxValue < Number(dataArg[j].data[i][1]) ? Number(dataArg[j].data[i][1]) : maxValue)
|
||||||
minValue = (minValue > Number(dataArg[j].data[i + 1][1]) ? Number(dataArg[j].data[i + 1][1]) : minValue)
|
minValue = (minValue > Number(dataArg[j].data[i][1]) ? Number(dataArg[j].data[i][1]) : minValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user