From 22cab89749308f1fdef7115b353d0776719f59fb Mon Sep 17 00:00:00 2001 From: zhongzm Date: Fri, 10 Oct 2025 19:08:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=BB=84=E9=87=91=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/perfManage/goldTarget/index.vue | 42 +++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/views/perfManage/goldTarget/index.vue b/src/views/perfManage/goldTarget/index.vue index c6a300e3..68a28e60 100644 --- a/src/views/perfManage/goldTarget/index.vue +++ b/src/views/perfManage/goldTarget/index.vue @@ -24,6 +24,7 @@ import { onBeforeUnmount, h, watch, + computed } from 'vue'; import { PageContainer } from 'antdv-pro-layout'; import { message, Modal, TableColumnType } from 'ant-design-vue/es'; @@ -1073,6 +1074,16 @@ function toggleChartVisibility() { } } +// 动态计算表格滚动配置 +const tableScrollConfig = computed(() => { + // 当图表折叠时,不设置固定高度,让表格完整显示 + if (!isChartVisible.value) { + return undefined; + } + // 当图表展开时,设置固定高度并启用滚动 + return { y: 250 }; +}); + /**绘制图表 */ function fnRanderChart() { const container: HTMLElement | undefined = kpiChartDom.value; //获取图表容器DOM元素 @@ -1918,7 +1929,7 @@ onBeforeUnmount(() => { :columns="statsColumns" :data-source="kpiStats" :pagination="false" - :scroll="{ y: 250 }" + :scroll="tableScrollConfig" size="small" :loading="statsTableLoading" :custom-row=" @@ -2013,10 +2024,35 @@ onBeforeUnmount(() => { flex-direction: column; } -/* 图表隐藏时,表格容器的高度调整 */ +/* 图表隐藏时,表格容器的高度调整为自动,完整显示所有内容 */ .chart-container[style*="display: none"] + .table-container { - height: 500px; + height: auto; margin-top: 0; + overflow: visible; + min-height: auto; + max-height: none; +} + +/* 图表隐藏时,禁用所有表格层级的滚动,完整显示内容 */ +.chart-container[style*="display: none"] + .table-container :deep(.ant-table-wrapper), +.chart-container[style*="display: none"] + .table-container :deep(.ant-table), +.chart-container[style*="display: none"] + .table-container :deep(.ant-table-container), +.chart-container[style*="display: none"] + .table-container :deep(.ant-table-content) { + overflow: visible !important; + flex: none; + display: block; + height: auto !important; + min-height: auto !important; + max-height: none !important; +} + +.chart-container[style*="display: none"] + .table-container :deep(.ant-table-body) { + overflow-y: visible !important; + overflow-x: visible !important; + max-height: none !important; + min-height: auto !important; + height: auto !important; + flex: none; } /* 表格布局相关样式 */