From 310a2c565e3c661c9eddefe90bbfc7ce03d4eaac Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 14 Dec 2021 16:16:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9group=E5=86=85?= =?UTF-8?q?=E6=9C=80=E5=A4=A7y=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BB=A5=E5=8F=8A=20group?= =?UTF-8?q?=E5=86=85=E7=9A=84=E7=A7=BB=E5=8A=A8=E6=9C=AA=E8=A2=AB=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart/tools.js | 2 +- nezha-fronted/src/components/chart/chartList.vue | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/tools.js b/nezha-fronted/src/components/chart/chart/tools.js index 2891944ae..9d2a9b3b1 100644 --- a/nezha-fronted/src/components/chart/chart/tools.js +++ b/nezha-fronted/src/components/chart/chart/tools.js @@ -93,7 +93,7 @@ export function getGroupHeight (arr) { arr.forEach((children, index) => { if (maxY == children.y) { lastItem.push(children) - } else { + } else if (maxY < children.y) { maxY = children.y lastItem = [children] } diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 8832f3d63..3aa6c502f 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -184,12 +184,16 @@ export default { }, changeGroupHeight (copyList, group, flag) { const height = getGroupHeight(copyList) - console.log(copyList, group, flag) + // console.log(height,copyList, group, flag) // console.log(this.$refs.layout) - const groupFind = this.copyDataList.find(item => item.id === group.id) + const groupFind = this.copyDataList.find(item => item.id == group.id) + const groupFindndex = this.copyDataList.find(item => item.id == group.id) + console.log(groupFind) if (group) { groupFind.height = groupFind.h = height + this.headerHPadding + groupFind.children = copyList this.copyDataList = [...this.copyDataList] + console.log(this.copyDataList) } if (flag) { this.copyDataList = [...this.copyDataList] @@ -243,7 +247,7 @@ export default { panelId: this.panelId, charts: charts } - console.log(this.copyDataList) + // console.log(this.copyDataList) this.$put('/visual/panel/chart/weights', params) }, 200) }