diff --git a/nezha-fronted/src/components/chart/ChartScreenHeader.vue b/nezha-fronted/src/components/chart/ChartScreenHeader.vue index d2e9af158..21ec07214 100644 --- a/nezha-fronted/src/components/chart/ChartScreenHeader.vue +++ b/nezha-fronted/src/components/chart/ChartScreenHeader.vue @@ -203,8 +203,13 @@ export default { this.searchTime[1] = bus.timeFormate(this.timeRange[1]) this.nowType.start_time = this.searchTime[0] this.nowType.end_time = this.searchTime[1] - this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowType) - this.setSearchTime(this.nowType.type, this.nowType.value, this.nowType) + if (!this.nowTimeType) { + this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowType) + this.setSearchTime(this.nowType.type, this.nowType.value, this.nowType) + } else { + this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowTimeType) + this.setSearchTime(this.nowType.type, this.nowType.value, this.nowTimeType) + } } } } diff --git a/nezha-fronted/src/components/chart/chartHeaderMixin.js b/nezha-fronted/src/components/chart/chartHeaderMixin.js index 64c61f578..9dfe1a20f 100644 --- a/nezha-fronted/src/components/chart/chartHeaderMixin.js +++ b/nezha-fronted/src/components/chart/chartHeaderMixin.js @@ -31,6 +31,9 @@ export default { type: Boolean, default: true }, + nowTimeType: { + type: Number + }, hiddenText: { // 隐藏图表的悬浮文字 type: String } diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 539a40386..a0ee60cfc 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -8,6 +8,7 @@ :isExportHtml="isExportHtml" :isError="isError" :from="from" + :nowTimeType="nowTimeType" :chartData="chartData" :chart-info="chartInfo" :showAllData.sync="showAllData" @@ -28,6 +29,7 @@ :is-group="isGroup(chartInfo.type)" :isError="isError" :from="from" + :nowTimeType="nowTimeType" :chartData="chartData" :chart-info="chartInfo" :showAllData.sync="showAllData" @@ -98,6 +100,9 @@ export default { type: Boolean, default: true }, + nowTimeType: { + type: Object + }, isExportHtml: { // 是否是导出的html type: Boolean, default: false diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index 6eb8af283..302d27b95 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -113,6 +113,11 @@ >