From 0b5531a342910186b4bd6a948a58e26a8bf26870 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 15 Feb 2022 10:39:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E4=BF=AE=E6=94=B9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8A=98=E5=8F=A0=20block=20=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/charts/Panel.vue | 1 + src/views/charts/PanelChartList.vue | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue index 7bae66d5..e2d278df 100644 --- a/src/views/charts/Panel.vue +++ b/src/views/charts/Panel.vue @@ -114,6 +114,7 @@ export default { }, recursionParamsConvert (chart) { chart.params = chart.params ? JSON.parse(chart.params) : {} + chart.firstShow = false if (chart.type === 94) { chart.oldH = chart.h /* chart.params = { diff --git a/src/views/charts/PanelChartList.vue b/src/views/charts/PanelChartList.vue index 8e0f7787..fcf88881 100644 --- a/src/views/charts/PanelChartList.vue +++ b/src/views/charts/PanelChartList.vue @@ -134,7 +134,6 @@ export default { this.emitter.emit('groupParentCalcHeight', { chart, childrenList: this.copyDataList }) }, groupParentCalcHeight (chart, childrenList) { - // console.log(chart, childrenList) setTimeout(() => { const parent = this.copyDataList.find(chartitem => chartitem.id === chart.parent.id) const children = parent.children.find(item => item.id === chart.id) @@ -192,6 +191,26 @@ export default { setTimeout(() => { this.gridLayoutShow = true }) + setTimeout(() => { + this.copyDataList.forEach(item => { + // if (item.type === 95) { + // console.log(item.h, item.name) + // item.children.forEach(children => { + // console.log(children.name, children.h, children.y) + // }) + // let parentH = 1.5 + // parentH += getGroupHeight(item.children) + // if (parentH !== item.h) { + // item.h = parentH + // } + // } + if (item.type === 94 && !item.firstShow) { + item.firstShow = true + this.copyDataList = [...this.copyDataList] + this.emitter.emit('groupParentCalcHeight', { chart: item, childrenList: this.copyDataList }) + } + }) + }, 200) this.gridLayoutLoading = false }) }