fix:【仪表板】排版整齐后,通过新建视图,向仪表板中添加,位置有些错乱

This commit is contained in:
wangjiahao 2021-11-09 18:08:18 +08:00
parent 18854ffa68
commit bc82edafd1
2 changed files with 13 additions and 3 deletions

View File

@ -187,7 +187,7 @@ const list = [
borderRadius: ''
},
x: 1,
y: 1,
y: 36,
sizex: 10,
sizey: 6,
auxiliaryMatrix: true

View File

@ -798,9 +798,19 @@ export default {
}
})
component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix
// position = absolution
component.style.top = 0
component.style.left = 600
if (this.canvasStyleData.auxiliaryMatrix) {
component.style.left = (component.x - 1) * this.curCanvasScale.matrixStyleOriginWidth
component.style.top = (component.y - 1) * this.curCanvasScale.matrixStyleOriginHeight
component.style.width = component.sizex * this.curCanvasScale.matrixStyleOriginWidth
component.style.height = component.sizey * this.curCanvasScale.matrixStyleOriginHeight
} else {
component.style.left = 0
component.style.top = 0
component.x = 1
component.y = 1
}
component.id = newComponentId
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot', 'newViewInfo')