NEZ-2860 fxi: Chart preview 时间范围错误

This commit is contained in:
zhangyu
2023-06-08 15:33:35 +08:00
parent 844772c937
commit feecf7956a
4 changed files with 25 additions and 10 deletions

View File

@@ -121,6 +121,11 @@
>
<panel-chart
v-if="prevChart"
:nowTimeType="{
id: 4,
type: 'hour',
value: 1
}"
style="height: 100%;width: 100%"
:ref="'chart-fullscreen-previewShow'"
:chart-info="prevChart"
@@ -183,10 +188,7 @@ export default {
computed: {
chartLastPosition () {
return this.$store.getters.getChartLastPosition
},
timeRange () {
return this.$store.getters.getTimeRange
},
}
},
data () {
return {
@@ -201,7 +203,7 @@ export default {
id: '',
name: ''
},
// timeRange: [],
timeRange: [],
prevChart: '',
filterPanel: '',
groupArr: [],
@@ -510,9 +512,9 @@ export default {
if (show) {
this.prevChart = ''
setTimeout(() => {
// const start = new Date().setHours(new Date().getHours() - 1)
// const end = new Date()
// this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)]
const start = new Date().setHours(new Date().getHours() - 1)
const end = new Date()
this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)]
this.prevChart = {
...lodash.cloneDeep(this.editChart),
loaded: true