forked from github/dataease
refactor(仪表板): 优化仪表板矩阵模式下的拖拽可能出现的松开手柄后大小再次变化,位置未置顶问题
This commit is contained in:
parent
930c57ad2d
commit
f590a72526
@ -126,7 +126,7 @@
|
||||
:canvas-id="canvasId"
|
||||
/>
|
||||
<!-- 右击菜单 -->
|
||||
<ContextMenu />
|
||||
<ContextMenu/>
|
||||
|
||||
<!-- 对齐标线 -->
|
||||
<span
|
||||
@ -1055,7 +1055,6 @@ export default {
|
||||
lineRef.init(newVal)
|
||||
}
|
||||
}
|
||||
console.log(newVal)
|
||||
})
|
||||
},
|
||||
deep: true
|
||||
|
@ -830,6 +830,22 @@ export default {
|
||||
this.beforeDestroyFunction()
|
||||
},
|
||||
methods: {
|
||||
sizeAdaptor() {
|
||||
this.top = this.y
|
||||
this.left = this.x
|
||||
const [parentWidth, parentHeight] = this.getParentSize()
|
||||
this.parentWidth = parentWidth
|
||||
this.parentHeight = parentHeight
|
||||
const [width, height] = getComputedSize(this.$el)
|
||||
this.aspectFactor = (this.w !== 'auto' ? this.w : width) / (this.h !== 'auto' ? this.h : height)
|
||||
if (this.outsideAspectRatio) {
|
||||
this.aspectFactor = this.outsideAspectRatio
|
||||
}
|
||||
this.width = this.w !== 'auto' ? this.w : width
|
||||
this.height = this.h !== 'auto' ? this.h : height
|
||||
this.right = this.parentWidth - this.width - this.left
|
||||
this.bottom = this.parentHeight - this.height - this.top
|
||||
},
|
||||
setChartData(chart) {
|
||||
this.chart = chart
|
||||
},
|
||||
@ -1482,6 +1498,7 @@ export default {
|
||||
this.hasMove && this.$store.commit('recordSnapshot', 'handleUp')
|
||||
// 记录snapshot后 移动已记录设置为false
|
||||
this.hasMove = false
|
||||
this.sizeAdaptor()
|
||||
}, 200)
|
||||
} else {
|
||||
this.hasMove && this.$store.commit('recordSnapshot', 'handleUp')
|
||||
@ -1890,18 +1907,7 @@ export default {
|
||||
if (!this.enableNativeDrag) {
|
||||
this.$el.ondragstart = () => false
|
||||
}
|
||||
const [parentWidth, parentHeight] = this.getParentSize()
|
||||
this.parentWidth = parentWidth
|
||||
this.parentHeight = parentHeight
|
||||
const [width, height] = getComputedSize(this.$el)
|
||||
this.aspectFactor = (this.w !== 'auto' ? this.w : width) / (this.h !== 'auto' ? this.h : height)
|
||||
if (this.outsideAspectRatio) {
|
||||
this.aspectFactor = this.outsideAspectRatio
|
||||
}
|
||||
this.width = this.w !== 'auto' ? this.w : width
|
||||
this.height = this.h !== 'auto' ? this.h : height
|
||||
this.right = this.parentWidth - this.width - this.left
|
||||
this.bottom = this.parentHeight - this.height - this.top
|
||||
this.sizeAdaptor()
|
||||
|
||||
// 绑定data-*属性
|
||||
this.settingAttribute()
|
||||
|
Loading…
Reference in New Issue
Block a user