feat:关键指标折叠优化
This commit is contained in:
@@ -1394,6 +1394,16 @@ const tableRowConfig = computed(() => {
|
||||
class: selectedRows.value.includes(record.kpiId) ? 'selected-row' : '',
|
||||
});
|
||||
});
|
||||
|
||||
// 动态计算表格滚动配置
|
||||
const tableScrollConfig = computed(() => {
|
||||
// 当图表折叠时,不设置固定高度,让表格完整显示
|
||||
if (!isChartVisible.value) {
|
||||
return undefined;
|
||||
}
|
||||
// 当图表展开时,设置固定高度并启用滚动
|
||||
return { y: 250 };
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="kpi-overview">
|
||||
@@ -1449,7 +1459,7 @@ const tableRowConfig = computed(() => {
|
||||
:columns="statsColumns"
|
||||
:data-source="kpiStats"
|
||||
:pagination="false"
|
||||
:scroll="{ y: 250 }"
|
||||
:scroll="tableScrollConfig"
|
||||
size="small"
|
||||
:loading="tableLoading"
|
||||
:custom-row="tableRowConfig"
|
||||
@@ -1502,10 +1512,35 @@ const tableRowConfig = computed(() => {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 图表隐藏时,表格容器的高度调整 */
|
||||
/* 图表隐藏时,表格容器的高度调整为自动,完整显示所有内容 */
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) .table-container {
|
||||
height: 500px;
|
||||
height: auto;
|
||||
margin-top: 0;
|
||||
overflow: visible;
|
||||
min-height: auto;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
/* 图表隐藏时,禁用所有表格层级的滚动,完整显示内容 */
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) :deep(.ant-table-wrapper),
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) :deep(.ant-table),
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) :deep(.ant-table-container),
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) :deep(.ant-table-content) {
|
||||
overflow: visible !important;
|
||||
flex: none;
|
||||
display: block;
|
||||
height: auto !important;
|
||||
min-height: auto !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
.chart-wrapper:has(.chart-container[style*="display: none"]) :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;
|
||||
}
|
||||
|
||||
/* 表格布局相关样式 */
|
||||
|
||||
Reference in New Issue
Block a user