refactor: 移动端加入新组件默认放到最底端

This commit is contained in:
wangjiahao 2021-12-22 16:36:33 +08:00
parent 4f05002a23
commit d1d156c4dd
4 changed files with 15 additions and 9 deletions

View File

@ -148,7 +148,11 @@ export default {
height: '100%'
}
} else {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
if (this.terminal === 'pc') {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
} else {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate', 'fontSize'])
}
}
},

View File

@ -38,11 +38,11 @@ export default {
this.element.style.width = 1600
this.element.style.height = 300
this.element.style.left = 0
this.element.style.top = 0
this.element.style.top = 6000
this.element.sizex = 6
this.element.sizey = 4
this.element.x = 1
this.element.y = 1
this.element.y = 200
this.element.auxiliaryMatrix = true
this.$store.commit('addComponent', { component: this.element })
} else {

View File

@ -149,11 +149,13 @@ const data = {
}
},
setShapeStyle({ curComponent, canvasStyleData, curCanvasScale }, { top, left, width, height, rotate }) {
if (top || top === 0) curComponent.style.top = (top / curCanvasScale.scalePointHeight) + 0.0000001
if (left || left === 0) curComponent.style.left = (left / curCanvasScale.scalePointWidth) + 0.0000001
if (width || width === 0) curComponent.style.width = (width / curCanvasScale.scalePointWidth + 0.0000001)
if (height || height === 0) curComponent.style.height = (height / curCanvasScale.scalePointHeight) + 0.0000001
if (rotate || rotate === 0) curComponent.style.rotate = rotate
if (curComponent) {
if (top || top === 0) curComponent.style.top = (top / curCanvasScale.scalePointHeight) + 0.0000001
if (left || left === 0) curComponent.style.left = (left / curCanvasScale.scalePointWidth) + 0.0000001
if (width || width === 0) curComponent.style.width = (width / curCanvasScale.scalePointWidth + 0.0000001)
if (height || height === 0) curComponent.style.height = (height / curCanvasScale.scalePointHeight) + 0.0000001
if (rotate || rotate === 0) curComponent.style.rotate = rotate
}
},
setShapeSingleStyle({ curComponent }, { key, value }) {

View File

@ -71,7 +71,7 @@ export default {
return {
padding: '5px',
display: 'inline-block',
width: '33.3333%'
width: '33%'
}
},
...mapState([