fix: 修改 diagram tooltip的时间 未跟panel一致的问题
This commit is contained in:
@@ -243,7 +243,7 @@ export default {
|
||||
fromTopo: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getButtonCode () {
|
||||
@@ -945,7 +945,25 @@ export default {
|
||||
delete option.yAxis.maxInterval
|
||||
}
|
||||
if (this.fromTopo) {
|
||||
const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', '']
|
||||
if (panelTime[0]) {
|
||||
const numInterval = new Date(panelTime[1]).getTime() - new Date(panelTime[0]).getTime()
|
||||
console.log(numInterval)
|
||||
|
||||
if (numInterval >= 60 * 60 * 1000) {
|
||||
option.xAxis.minInterval = 20 * 60 * 1000
|
||||
} else if (numInterval >= 30 * 60 * 1000 && numInterval < 60 * 60 * 1000) {
|
||||
option.xAxis.minInterval = 10 * 60 * 1000
|
||||
} else if (numInterval >= 15 * 60 * 1000 && numInterval < 30 * 60 * 1000) {
|
||||
option.xAxis.minInterval = 5 * 60 * 1000
|
||||
} else if (numInterval >= 5 * 60 * 1000 && numInterval < 15 * 60 * 1000) {
|
||||
option.xAxis.minInterval = 1 * 60 * 1000
|
||||
} else {
|
||||
option.xAxis.minInterval = 15 * 1000
|
||||
}
|
||||
} else {
|
||||
option.xAxis.minInterval = 20 * 60 * 1000
|
||||
}
|
||||
}
|
||||
// params.series = dataArg;
|
||||
if (chartSite === 'local') { // 本地显示
|
||||
|
||||
@@ -661,8 +661,9 @@ export default {
|
||||
})
|
||||
})
|
||||
}
|
||||
const endTime = this.filterTime[1]
|
||||
const startTime = this.filterTime[0]
|
||||
const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', '']
|
||||
const endTime = panelTime[1] || this.filterTime[1]
|
||||
const startTime = panelTime[0] || this.filterTime[0]
|
||||
const step = bus.getStep(startTime, endTime)
|
||||
data.pens && data.pens.forEach((item, index) => {
|
||||
this.chartGetData.push({ id: item.id, res: [] })
|
||||
|
||||
@@ -128,8 +128,9 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const endTime = this.filter.end_time
|
||||
const startTime = this.filter.start_time
|
||||
const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', '']
|
||||
const endTime = panelTime[1] || bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss')
|
||||
const startTime = panelTime[0] || bus.timeFormate(bus.getOffsetTimezoneData(-1), 'yyyy-MM-dd hh:mm:ss')
|
||||
const step = bus.getStep(startTime, endTime)
|
||||
this.$nextTick(() => {
|
||||
const axiosArr = chartItem.elements.map((ele) => {
|
||||
|
||||
@@ -826,6 +826,13 @@ export default {
|
||||
temp.search()
|
||||
}, 1000)
|
||||
},
|
||||
searchTime: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (n) {
|
||||
localStorage.setItem('panelTime', JSON.stringify(n))
|
||||
}
|
||||
},
|
||||
$route: {
|
||||
immediate: true,
|
||||
handler () {
|
||||
@@ -852,6 +859,7 @@ export default {
|
||||
if (this.scrollbarWrap) {
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce)
|
||||
};
|
||||
localStorage.removeItem('panelTime')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user