From 75a8e398bf029fccc297b0e4be5b75592b52dce6 Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 24 Oct 2024 17:26:31 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96gird=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E4=B8=8B=E6=9F=90=E4=BA=9B=E5=88=86=E8=BE=A8=E7=8E=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index e4729e96..fba52cd1 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -465,8 +465,9 @@ :border="false" :style="{ width: '100%', - 'max-height': clientHeight - 25 + 'px', - rowGap: '8px', + maxHeight: clientHeight - 25 + 'px', + minHeight: gridMinHeight + 'px', + rowGap: '10px', overflow: 'auto', 'box-shadow': fileListScrollTop > 0 @@ -1069,6 +1070,7 @@ export default { gridColumnNum: -1, gridPaddingRight: 0, gridItemWidth: 125, + gridMinHeight: 125, allChecked: false, summaries: '', shareDialogVisible: false, @@ -1566,6 +1568,12 @@ export default { let gridRowNum = Math.round( this.clientHeight / (clientWidth / this.gridColumnNum) ) + + if (this.finished) { + let actualRows = Math.ceil(this.fileList.length / this.gridColumnNum) + this.gridMinHeight = actualRows * this.gridItemWidth + (actualRows - 1) * 10 + } + const lastPageSize = this.pagination.pageSize const thisPageSize = gridRowNum * this.gridColumnNum + this.gridColumnNum if (thisPageSize !== lastPageSize) {