Merge pull request #122 from jamebal/share

perf: 优化窗口大小变化时动态调整分页大小
This commit is contained in:
jmal 2024-05-25 23:19:24 +08:00 committed by GitHub
commit 984fdb03fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

View File

@ -302,6 +302,9 @@ export default {
},
// 切换分享形式
shareFormChange() {
if (!this.shareOption.isPrivacy) {
this.shareOption.operationPermissionList = []
}
this.createShare('shareFormChange')
},
// 取消分享
@ -469,6 +472,7 @@ export default {
.share-filename {
margin: 25px 0 50px 0;
text-align: center;
word-break: break-word;
}
.share-option {

View File

@ -1546,8 +1546,12 @@ export default {
let gridRowNum = Math.round(
this.clientHeight / (clientWidth / this.gridColumnNum)
)
this.pagination.pageSize =
gridRowNum * this.gridColumnNum + this.gridColumnNum
const lastPageSize = this.pagination.pageSize
const thisPageSize = gridRowNum * this.gridColumnNum + this.gridColumnNum
if (thisPageSize !== lastPageSize) {
this.pagination.pageSize = thisPageSize
this.getFileList()
}
// 使列表可拖拽
this.rowDrop()
@ -4061,7 +4065,6 @@ export default {
if (row.isFolder) {
url = fileConfig.packageDownloadUrl(row.id, row.name + '.zip')
}
console.log('url', url)
let clipboard = new Clipboard('.newFileMenu', {
text: function() {
return url

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<share-dialog :file.sync="shareDialogObject" :status.sync="shareDialogVisible" @onUpdateExpireData="onUpdateExpireData" @onUpdateShareForm="onUpdateShareForm"></share-dialog>
<share-dialog :file.sync="shareDialogObject" :status.sync="shareDialogVisible" @onUpdateExpireData="onUpdateExpireData" @onUpdateShareForm="onUpdateShareForm" @onCancelShare="onCancelShare"></share-dialog>
<!--list布局-->
<div v-show="fileList.length > 0" :style="{'width':'100%','height': clientHeight+'px'}">
<pl-table
@ -474,6 +474,9 @@
})
})
},
onCancelShare() {
this.getFileList()
},
// 点击文件或文件夹
fileClick(row) {
this.shareDialogObject = row