forked from github/dataease
Merge pull request #8034 from dataease/pr@dev-v2@fix_handel-move
refactor(数据大屏): 调整位置属性面板处手动设置宽高逻辑,适配保持宽高比例
This commit is contained in:
commit
16e87c73e6
@ -82,9 +82,19 @@ const onPositionChange = key => {
|
|||||||
if (!positionMounted.value[key]) {
|
if (!positionMounted.value[key]) {
|
||||||
positionMounted.value[key] = 0
|
positionMounted.value[key] = 0
|
||||||
}
|
}
|
||||||
|
const originRadio = curComponent.value.style.width / curComponent.value.style.height
|
||||||
curComponent.value.style[key] = Math.round(
|
curComponent.value.style[key] = Math.round(
|
||||||
(positionMounted.value[key] * canvasStyleData.value.scale) / 100
|
(positionMounted.value[key] * canvasStyleData.value.scale) / 100
|
||||||
)
|
)
|
||||||
|
if (curComponent.value.maintainRadio) {
|
||||||
|
if (key === 'width') {
|
||||||
|
curComponent.value.style['height'] = curComponent.value.style['width'] / originRadio
|
||||||
|
positionMounted.value['height'] = Math.round(positionMounted.value['width'] / originRadio)
|
||||||
|
} else if (key === 'height') {
|
||||||
|
curComponent.value.style['width'] = curComponent.value.style['height'] * originRadio
|
||||||
|
positionMounted.value['width'] = Math.round(positionMounted.value['height'] * originRadio)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (curComponent.value.component === 'Group') {
|
if (curComponent.value.component === 'Group') {
|
||||||
//如果当前组件是Group分组 则要进行内部组件深度计算
|
//如果当前组件是Group分组 则要进行内部组件深度计算
|
||||||
|
Loading…
Reference in New Issue
Block a user