From 7ff888d65cc03b3931501b540df898a0dee0abe6 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 27 Apr 2020 17:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E4=BA=AB=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/share/index.vue | 145 ++++++++++++++++++++++---------------- 1 file changed, 83 insertions(+), 62 deletions(-) diff --git a/src/views/share/index.vue b/src/views/share/index.vue index 8c83684..80eca6e 100644 --- a/src/views/share/index.vue +++ b/src/views/share/index.vue @@ -10,16 +10,20 @@ - + - + - {{ scope.row.fileName }} - + - + - + - {{scope.row.createDate}} - + - {{scope.row.expireDate?scope.row.expireDate:'永久有效'}} - + - + + - - + + + + + + + + + + { - this.fileList = res.data - this.fileList.map((item,index) => { - item.index = index - }) - this.clientHeight = document.documentElement.clientHeight - 165 + if(onLoad){ + res.data.forEach((file,number) => { + file['index'] = (this.pagination.pageIndex - 1) * this.pagination.pageSize + number + this.fileList.push(file) + }); + }else{ + this.fileList = res.data + this.fileList.map((item,index) => { + item.index = index + }) + } + // 数据全部加载完成 + if (this.fileList.length >= res.count) { + this.finished = true; + } + this.tableLoading = false + this.clientHeight = document.documentElement.clientHeight - 80 this.pagination['total'] = res.count this.$nextTick(()=>{ this.tableLoading = false }) }).catch(e => {}) }, - currentChange(pageIndex) { - this.pagination.pageIndex = pageIndex - if (this.listModeSearch) { - if(this.listModeSearchOpenDir){ - this.searchFileAndOpenDir(this.listModeSearchOpenDir) - }else{ - this.searchFile(this.searchFileName) + tableBodyScroll(table, e) { + this.fileListScrollTop = e.target.scrollTop + let scrollBottom = e.target.scrollHeight-e.target.clientHeight-e.target.scrollTop; + if(scrollBottom < 200){ + if(!this.finished){ + this.getFileList(true) } - } else { - this.getFileList() } }, sortChange(column) { @@ -346,11 +366,6 @@ itemDate.label = '过期时间' itemDate.sortable = 'custom' } - if(this.indexList.length === this.fileList.length){ - this.allChecked = true - }else{ - this.allChecked = false - } }, // 统计文件和文件夹 getShowSumFileAndFolder(fileList) { @@ -523,5 +538,11 @@ font-size: 16px; visibility: hidden; } + /deep/.plTableBox .el-table .el-table__header th { + background-color: #FFFFFF; + } + /deep/.el-table td { + height: 50px!important; + }