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

This commit is contained in:
zyh
2024-09-18 18:12:46 +08:00
2 changed files with 7 additions and 3 deletions

View File

@@ -56,6 +56,7 @@
:chart-info="item" :chart-info="item"
:from="from" :from="from"
:time-range="timeRange" :time-range="timeRange"
:nowTimeType="nowTimeType"
@groupShow="groupShow" @groupShow="groupShow"
:isExportHtml="isExportHtml" :isExportHtml="isExportHtml"
:dataJson="dataJson" :dataJson="dataJson"
@@ -96,6 +97,7 @@
:dataJson="dataJson" :dataJson="dataJson"
:panelLock="panelLock" :panelLock="panelLock"
:time-range="timeRange" :time-range="timeRange"
:nowTimeType="nowTimeType"
@showFullscreen="showFullscreen" @showFullscreen="showFullscreen"
></panel-chart> ></panel-chart>
</el-dialog> </el-dialog>
@@ -120,6 +122,9 @@ export default {
dashboardId: {}, dashboardId: {},
chartDetailInfo: Object, chartDetailInfo: Object,
timeRange: Array, // 时间范围 timeRange: Array, // 时间范围
nowTimeType: {
type: Object
},
isGroup: Boolean, isGroup: Boolean,
groupInfo: {}, groupInfo: {},
from: String, from: String,

View File

@@ -228,13 +228,12 @@ export default {
const now = new Date(bus.computeTimezone(new Date().getTime())) const now = new Date(bus.computeTimezone(new Date().getTime()))
const origin = new Date(bus.timeFormate(bus.formateTimeToTime(this.timeRange[1]), 'YYYY-MM-DD HH:mm:ss')) const origin = new Date(bus.timeFormate(bus.formateTimeToTime(this.timeRange[1]), 'YYYY-MM-DD HH:mm:ss'))
const numInterval = now.getTime() - origin.getTime() const numInterval = now.getTime() - origin.getTime()
let nowTimeType = this.$route.query.nowTimeType let nowTimeType = this.nowTimeType
console.log(nowTimeType)
if (!nowTimeType) { if (!nowTimeType) {
nowTimeType = { nowTimeType = {
value: 1 value: 1
} }
} else {
nowTimeType = JSON.parse(nowTimeType)
} }
if (numInterval >= 15000 && nowTimeType.value !== -1) { // 大于1分钟则start、end均往后移numInterval否则时间不变 if (numInterval >= 15000 && nowTimeType.value !== -1) { // 大于1分钟则start、end均往后移numInterval否则时间不变
startTime = bus.getNewTime(bus.formateTimeToTime(this.timeRange[0]), numInterval, 'YYYY-MM-DD HH:mm:ss') startTime = bus.getNewTime(bus.formateTimeToTime(this.timeRange[0]), numInterval, 'YYYY-MM-DD HH:mm:ss')