diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue index 7de28c1e..30126167 100644 --- a/src/views/charts/Panel.vue +++ b/src/views/charts/Panel.vue @@ -45,7 +45,7 @@ import { ref } from 'vue' import { panelTypeAndRouteMapping } from '@/utils/constants' import { api, getPanelList, getChartList } from '@/utils/api' import { getNowTime } from '@/utils/date-util' -import {getGroupHeight, getTypeCategory} from "@/views/charts/charts/tools"; +import { getGroupHeight, getTypeCategory } from '@/views/charts/charts/tools' export default { name: 'Panel', @@ -119,13 +119,19 @@ export default { chart.params = { collpase: false } - chart.h = getGroupHeight(chart.children) + 2 + chart.h = getGroupHeight(chart.children) + 1.5 if (chart.params.collpase) { chart.h = 1 } } if (chart.type === 95) { - chart.h += 0 + let sumGroup = 0 + chart.children.forEach(item => { + if (item.type === 94) { + sumGroup++ + } + }) + chart.h += sumGroup * 0.5 } if (!this.$_.isEmpty(chart.children)) { chart.children.forEach(c => { diff --git a/src/views/charts/PanelChartList.vue b/src/views/charts/PanelChartList.vue index 61241b1f..67e2c004 100644 --- a/src/views/charts/PanelChartList.vue +++ b/src/views/charts/PanelChartList.vue @@ -121,7 +121,7 @@ export default { if (item.params.collpase) { item.h = 1 } else { - item.h = getGroupHeight(item.children) + 1 + item.h = getGroupHeight(item.children) + 1.5 } } }) @@ -129,12 +129,19 @@ 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) children.h = chart.h children.params = chart.params - parent.h = getGroupHeight(childrenList) + 2 + let sumGroup = 0 + childrenList.forEach(item => { + if (item.type === 94) { + sumGroup++ + } + }) + parent.h = getGroupHeight(childrenList) + sumGroup * 0.5 this.copyDataList = [...this.copyDataList] }, 100) } diff --git a/src/views/charts/charts/ChartBlock.vue b/src/views/charts/charts/ChartBlock.vue index 56d6f7e0..2a7d4307 100644 --- a/src/views/charts/charts/ChartBlock.vue +++ b/src/views/charts/charts/ChartBlock.vue @@ -24,16 +24,16 @@ export default { } }, watch: { - 'chartInfo.children': { - immediate: true, - deep: true, - handle (n) { - if (!this.firstShow) { - this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children)) - this.firstShow = true - } - } - } + // 'chartInfo.children': { + // immediate: true, + // deep: true, + // handle (n) { + // if (!this.firstShow) { + // this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children)) + // this.firstShow = true + // } + // } + // } }, mounted () { this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children))