diff --git a/frontend/dist.rar b/frontend/dist.rar deleted file mode 100644 index 7ae4661..0000000 Binary files a/frontend/dist.rar and /dev/null differ diff --git a/frontend/src/components/BasicTable/index.vue b/frontend/src/components/BasicTable/index.vue index 5fc6919..aaedb59 100644 --- a/frontend/src/components/BasicTable/index.vue +++ b/frontend/src/components/BasicTable/index.vue @@ -6,7 +6,7 @@ :data-source="tableData" :columns="columns" :pagination="paginationConfig" - :scroll="{ x: '100%' }" + :scroll="scrollConfig " :row-key="rowKey" @change="handleTableChange" > @@ -23,6 +23,8 @@ import { ref, computed, onMounted, watch } from "vue"; // --- Types --- interface Props { columns: any[]; + + scrollY?: string | number; // 请求数据的函数,由父组件传入 listUrl: (params: any) => Promise; // 是否开启行选择 @@ -62,6 +64,12 @@ const size = ref(props.defaultPageSize); const selectedRowKeys = ref([]); const selectedRows = ref([]); +// 计算表格滚动高度 +const scrollConfig = computed(() => ({ + x: 'max-content', + y: props.scrollY, // 注意:如果 scrollY 是 undefined,则不会启用垂直滚动 +})) + // --- Row Selection --- const rowSelection = computed(() => ({ selectedRowKeys: selectedRowKeys.value, @@ -192,5 +200,26 @@ onMounted(() => { + +:deep(.ant-table-wrapper) { + height: 100%; /* 让表格容器填满父级 */ + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + display: flex; + flex-direction: column; + } + .ant-table { + flex: 1; /* 表格主体区域自动撑满剩余空间 */ + overflow: hidden; /* 防止内容溢出 */ + } + .ant-table-container { + height: 100%; + display: flex; + flex-direction: column; + } + .ant-table-body { + flex: 1; /* 表体部分撑满,实现固定表头 + 滚动内容 */ + overflow: auto !important; /* 出现滚动条的关键 */ + } +} + \ No newline at end of file diff --git a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/guoYuSheShiShuJuTianBaoSearch.vue b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/guoYuSheShiShuJuTianBaoSearch.vue index 7d4b81f..dea9a80 100644 --- a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/guoYuSheShiShuJuTianBaoSearch.vue +++ b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/guoYuSheShiShuJuTianBaoSearch.vue @@ -204,8 +204,7 @@ const onValuesChange = (changedValues: any, allValues: any) => { // 下载模板 const downloadTemplate = () => { - // 20260429090252740092641634938251 - downloadFileByUrl(import.meta.env.VITE_APP_PREVIEW_URL + "/?20260429090252740092641634938251", "过鱼设施数据填报模板", "zip"); + downloadFileByUrl(import.meta.env.VITE_APP_PREVIEW_URL + "/?20260429090252740092641634938251", "过鱼设施数据填报模板"); }; const handleReset = () => { diff --git a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue index 621d1db..63eae33 100644 --- a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue +++ b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue @@ -2,6 +2,7 @@
- - -