Merge branch 'dev-3.7' of git.mesalab.cn:nezha/nezha-fronted into dev-3.8

This commit is contained in:
zyh
2023-09-08 10:19:31 +08:00
2 changed files with 16 additions and 14 deletions

View File

@@ -360,20 +360,17 @@ export default {
// 提示框大小
const boxWidth = size.contentSize[0]
const boxHeight = size.contentSize[1]
const chartDom = document.getElementById('chart-local-' + this.chartInfo.id)
if (chartDom) {
if (windowMouse.x < (windowWidth / 2)) { // 说明鼠标在左边放不下提示框
x = pointX + 15
} else {
x = pointX - boxWidth - 15
}
if (windowMouse.y + 50 + boxHeight < windowHeight) { // 说明鼠标上面放不下提示框
y = pointY + 15
} else {
y = pointY - boxHeight - 10
}
return [x, y]
if (windowMouse.x < (windowWidth / 2)) { // 说明鼠标在左边放不下提示框
x = pointX + 15
} else {
x = pointX - boxWidth - 15
}
if (windowMouse.y + 50 + boxHeight < windowHeight) { // 说明鼠标上面放不下提示框
y = pointY + 15
} else {
y = pointY - boxHeight - 10
}
return [x, y]
},
mouseLeaveChart () {
const myChart = getChart(this.chartId)

View File

@@ -67,8 +67,9 @@ import logsData from '@/components/chart/logsData'
import lodash from 'lodash'
import alertMessageInfoTab from '@/components/common/alert/alertMessageInfoTab'
import alertMessageInfoTimeLine from '@/components/common/alert/alertMessageInfoTimeLine'
import { lineChartMove } from '@/components/common/js/common'
export default {
name: 'panelChart',
name: 'alertMessageInfo',
components: {
alertMessageInfoTab,
chart,
@@ -354,9 +355,13 @@ export default {
this.showAllData = !this.showMultiple(this.chartInfo.type)
this.getAlertMessageInfo()
window.addEventListener('resize', this.resize)
if (!document.onmousemove) { // 添加鼠标移动事件监听
document.onmousemove = lineChartMove
}
},
destroyed () {
window.removeEventListener('resize', this.resize)
document.onmousemove = null
}
}
</script>