diff --git a/nezha-fronted/src/components/chart/chart/chartGauge.vue b/nezha-fronted/src/components/chart/chart/chartGauge.vue index 5c3caaae4..bc405d6d1 100644 --- a/nezha-fronted/src/components/chart/chart/chartGauge.vue +++ b/nezha-fronted/src/components/chart/chart/chartGauge.vue @@ -170,6 +170,7 @@ export default { option.series[0].detail = { fontSize: 24, fontWeight: 'bolder', + offsetCenter: [0, '20%'], formatter: (params) => { let showValue = chartDataFormat.getUnit(self.chartInfo.unit ? self.chartInfo.unit : 2).compute(params, null, -1, 2).trim() if (item.mapping) { @@ -177,9 +178,9 @@ export default { } let str = '' if (this.chartInfo.param.text === 'all') { - str += item.alias - str += '\n' str += showValue + str += '\n' + str += item.alias } if (this.chartInfo.param.text === 'value' || !this.chartInfo.param.text) { str += showValue diff --git a/nezha-fronted/src/components/chart/chart/options/chartGauge.js b/nezha-fronted/src/components/chart/chart/options/chartGauge.js index f1552a660..da0e0dff6 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartGauge.js +++ b/nezha-fronted/src/components/chart/chart/options/chartGauge.js @@ -37,7 +37,8 @@ const chartGaugeOption = { show: false }, title: { - show: false + show: false, + offsetCenter: [0, '-50%'] }, data: [] } diff --git a/nezha-fronted/src/components/common/timePicker.vue b/nezha-fronted/src/components/common/timePicker.vue index a0a0f0980..cb38c761a 100644 --- a/nezha-fronted/src/components/common/timePicker.vue +++ b/nezha-fronted/src/components/common/timePicker.vue @@ -172,7 +172,7 @@ export default { this.$set(this.showTime, 'text', this.searchTime[0] + ' ' + this.$t('dashboard.panel.to') + ' ' + this.searchTime[1]) this.$emit('change', this.searchTime) }, - setCustomTime (timeGroup,timeRange) { + setCustomTime (timeGroup, timeRange) { if (timeGroup) { this.showTime = this.nowTimeType = this.timeData.find(item => item.id == timeGroup.id) console.log(this.showTime) @@ -188,8 +188,13 @@ export default { value: 1 } const time = bus.getTimezontDateRange() - this.$set(this.searchTime, 0, time[0]) - this.$set(this.searchTime, 1, time[1]) + if (timeGroup.start_time) { + this.$set(this.searchTime, 0, bus.timeFormate(timeGroup.start_time, 'yyyy-MM-dd hh:mm:ss')) + this.$set(this.searchTime, 1, bus.timeFormate(timeGroup.end_time, 'yyyy-MM-dd hh:mm:ss')) + } else { + this.$set(this.searchTime, 0, bus.timeFormate(time[0], 'yyyy-MM-dd hh:mm:ss')) + this.$set(this.searchTime, 1, bus.timeFormate(time[1], 'yyyy-MM-dd hh:mm:ss')) + } } } else { this.showTime = this.nowTimeType = {