feat: 新增 添加时 计算最后元素的位置

This commit is contained in:
zhangyu
2021-12-17 14:28:49 +08:00
parent e13fc996a8
commit 8cec356014
6 changed files with 33 additions and 9 deletions

View File

@@ -126,6 +126,11 @@ export default {
systemChartConfig,
otherChartConfig
},
computed: {
chartLastPosition () {
return this.$store.getters.getChartLastPosition
}
},
data () {
return {
fromRoute,
@@ -169,6 +174,10 @@ export default {
if (!params.groupId) {
params.groupId = 0
}
if (!params.x || !params.y) {
params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x
params.y = this.chartLastPosition.y + 12
}
delete params.panel
if (params.type === 'table') {
delete params.param.tags