fix:修改新增的问题
This commit is contained in:
@@ -86,7 +86,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import VueGridLayout from 'vue-grid-layout'
|
import VueGridLayout from 'vue-grid-layout'
|
||||||
import { fromRoute } from '@/components/common/js/constants'
|
import { fromRoute } from '@/components/common/js/constants'
|
||||||
import { getGroupHeight, getLayoutPosition } from './chart/tools'
|
import {getGroupHeight, getLayoutPosition, isGroup} from './chart/tools'
|
||||||
import panelChart from '@/components/chart/panelChart'
|
import panelChart from '@/components/chart/panelChart'
|
||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
import groupData from '@/components/chart/tempGroup'
|
import groupData from '@/components/chart/tempGroup'
|
||||||
@@ -289,8 +289,10 @@ export default {
|
|||||||
this.firstInit = true
|
this.firstInit = true
|
||||||
this.gridLayoutLoading = true
|
this.gridLayoutLoading = true
|
||||||
this.noData = !n || n.length < 1
|
this.noData = !n || n.length < 1
|
||||||
const position = getLayoutPosition(n)
|
if (!this.isGroup) {
|
||||||
this.$store.commit('setChartLastPosition', position)
|
const position = getLayoutPosition(n)
|
||||||
|
this.$store.commit('setChartLastPosition', position)
|
||||||
|
}
|
||||||
const tempList = n.map(item => {
|
const tempList = n.map(item => {
|
||||||
let param = ''
|
let param = ''
|
||||||
let height = ''
|
let height = ''
|
||||||
|
|||||||
@@ -174,10 +174,14 @@ export default {
|
|||||||
if (!params.groupId) {
|
if (!params.groupId) {
|
||||||
params.groupId = 0
|
params.groupId = 0
|
||||||
}
|
}
|
||||||
if (!params.x || !params.y) {
|
if (!params.x && !params.y) {
|
||||||
params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x
|
params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x
|
||||||
params.y = this.chartLastPosition.y + 12
|
params.y = this.chartLastPosition.y + 12
|
||||||
}
|
}
|
||||||
|
if (!params.x && !params.y && params.groupId) { // group 内的坐标需要单独计算
|
||||||
|
params.x = 0
|
||||||
|
params.y = 999
|
||||||
|
}
|
||||||
delete params.panel
|
delete params.panel
|
||||||
if (params.type === 'table') {
|
if (params.type === 'table') {
|
||||||
delete params.param.tags
|
delete params.param.tags
|
||||||
|
|||||||
Reference in New Issue
Block a user