feat: 新增 添加时 计算最后元素的位置
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user