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

This commit is contained in:
zyh
2024-09-20 10:47:04 +08:00
6 changed files with 15 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ export default {
if (this.$refs.pickTime.$refs.multipleTime && !this.$refs.pickTime.$refs.multipleTime.showDropdown) {
multipleTime = ''
}
this.$emit('dateChange', this.filter, multipleTime)
this.$emit('dateChange', this.filter, multipleTime, nowTimeType)
}, 100)
},
closeDialog () {

View File

@@ -229,7 +229,6 @@ export default {
const origin = new Date(bus.timeFormate(bus.formateTimeToTime(this.timeRange[1]), 'YYYY-MM-DD HH:mm:ss'))
const numInterval = now.getTime() - origin.getTime()
let nowTimeType = this.nowTimeType
console.log(nowTimeType)
if (!nowTimeType) {
nowTimeType = {
value: 1

View File

@@ -126,7 +126,7 @@ export default {
},
methods: {
isGroup,
dateChange (filter, multipleTime) {
dateChange (filter, multipleTime, nowTimeType) {
this.loading = true
// TODO assetInfo、endpointInfo、echarts等进行不同的处理
let startTime = bus.formateTimeToTime(filter.start_time)
@@ -144,6 +144,10 @@ export default {
this.multipleTime = false
}
this.time = [startTime, endTime]
this.$store.dispatch('dispatchPanelTime', {
time: [filter.start_time, filter.end_time],
nowTimeType: nowTimeType
})
this.chartInfo.loaded && this.chartInfo.alertRule && this.chartInfo.alertRule.type !== 3 && this.query(elements, startTime, endTime, step)
},
// 参数 isRefresh 标识是否是刷新操作

View File

@@ -186,7 +186,7 @@ export default {
immediate: true,
handler (n) {
if (n && n.length) {
this.timeRange = this.timeRange = [
this.timeRange = [
bus.timeFormate(bus.computeTimezone(n[0] * 1000)),
bus.timeFormate(bus.computeTimezone(n[1] * 1000))
]

View File

@@ -676,7 +676,7 @@ export default {
this.$get('/alert/rule/' + row.alertRule.id).then(res => {
this.currentMsg = { ...row, alertRule: { ...res.data } }
this.$nextTick(() => {
this.searchTime = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())]
this.searchTime = [bus.timeFormate(bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000)), bus.timeFormate(bus.computeTimezoneTime(new Date().getTime()))]
this.$store.dispatch('dispatchPanelTime', {
time: this.searchTime,
nowTimeType: {
@@ -1070,6 +1070,12 @@ export default {
this.chartInfo = chartInfo
this.graphShow = show
}
},
beforeDestroy () {
this.$store.dispatch('dispatchPanelTime', {
time: [],
nowTimeType: {}
})
}
}
</script>

View File

@@ -595,7 +595,7 @@ export default {
this.$get('/alert/rule/' + row.alertRule.id).then(res => {
this.currentMsg = { ...row, alertRule: { ...res.data } }
this.$nextTick(() => {
this.searchTimeDialog = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())]
this.searchTimeDialog = [bus.timeFormate(bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000)), bus.timeFormate(bus.computeTimezoneTime(new Date().getTime()))]
this.$store.dispatch('dispatchPanelTime', {
time: this.searchTimeDialog,
nowTimeType: {