NEZ-1232 fix: Chart Diagram 预览时悬浮图表位置有误

This commit is contained in:
zhangyu
2021-11-15 10:20:08 +08:00
parent 09f884d55f
commit 11fbf1f8e5
2 changed files with 8 additions and 10 deletions

View File

@@ -1253,19 +1253,19 @@ export default {
const ePosition = window.ePosition
const boxWidth = document.getElementsByClassName('page')[0].offsetWidth
const boxHeight = document.getElementsByClassName('page')[0].offsetHeight
this.tooltipPosition.left = ePosition.layerX + 20
this.tooltipPosition.top = ePosition.layerY
this.tooltipPosition.left = ePosition.offsetX + 20
this.tooltipPosition.top = ePosition.offsetY
this.$nextTick(() => {
if (this.$refs.topoTooltip) {
if ((boxWidth / 2) > ePosition.layerX) {
this.tooltipPosition.left = ePosition.layerX + 20
if ((boxWidth / 2) > ePosition.offsetX) {
this.tooltipPosition.left = ePosition.offsetX + 20
} else {
this.tooltipPosition.left = ePosition.layerX - 20 - this.$refs.topoTooltip.offsetWidth
this.tooltipPosition.left = ePosition.offsetX - 20 - this.$refs.topoTooltip.offsetWidth
}
if (boxHeight > (ePosition.layerY + this.$refs.topoTooltip.offsetHeight)) {
this.tooltipPosition.top = ePosition.layerY
if (boxHeight > (ePosition.offsetY + this.$refs.topoTooltip.offsetHeight)) {
this.tooltipPosition.top = ePosition.offsetY
} else {
this.tooltipPosition.top = ePosition.layerY - this.$refs.topoTooltip.offsetHeight
this.tooltipPosition.top = ePosition.offsetY - this.$refs.topoTooltip.offsetHeight
}
}
if (this.isScreen) {
@@ -2020,7 +2020,6 @@ export default {
item.animatePlay = item.data.animatePlay
item.data.animateType = item.animateType
if (item.type === 0 && JSON.stringify(item.data.imageId)) {
item.image = ''
item.animateFrames = []
item.animateReady = null
delete item.img

View File

@@ -2056,7 +2056,6 @@ export default {
item.animatePlay = item.data.animatePlay
item.data.animateType = item.animateType
if (item.type === 0 && JSON.stringify(item.data.imageId)) {
item.image = ''
item.animateFrames = []
item.animateReady = null
delete item.img