【修改】增加加载中

This commit is contained in:
zhoulingpo
2023-05-25 17:15:17 +08:00
parent 9301ed357a
commit 56ec05c8c1
@@ -129,7 +129,7 @@
</el-upload> </el-upload>
<div class="table"> <div class="table">
<vxe-table ref="xTable" :data="fileLists" :empty-render="{name: 'NotData'}" align="center" border stripe <vxe-table ref="xTable" :data="fileLists" :empty-render="{name: 'NotData'}" align="center" border stripe
class="table-over" width="100%" class="table-over" width="100%" :loading="table_loading"
v-table-min-height="'50px'"> v-table-min-height="'50px'">
<vxe-column show-header-overflow field="name" title="文件名称"> <vxe-column show-header-overflow field="name" title="文件名称">
<template #default="{ row, rowIndex }"> <template #default="{ row, rowIndex }">
@@ -190,6 +190,7 @@ export default {
}, },
data() { data() {
return { return {
table_loading:false,
total:0, total:0,
fileLists:[], fileLists:[],
delIds:[], delIds:[],
@@ -338,6 +339,7 @@ export default {
}, },
handleCurrentChange(current){ handleCurrentChange(current){
setTimeout(() => { setTimeout(() => {
current = current ? current : this.q.pageNo current = current ? current : this.q.pageNo
this.q.pageNo = current this.q.pageNo = current
this.fileLists = this.fileList.slice(this.q.pageSize * (current - 1), this.q.pageSize * current) this.fileLists = this.fileList.slice(this.q.pageSize * (current - 1), this.q.pageSize * current)
@@ -347,6 +349,7 @@ export default {
return false return false
} }
this.total = this.fileList.length this.total = this.fileList.length
this.table_loading=false
},500) },500)
}, },
handlePreview(file){ handlePreview(file){
@@ -578,6 +581,7 @@ export default {
}, },
// 上传文件前 // 上传文件前
beforeUploadFile(file) { beforeUploadFile(file) {
this.table_loading=true
let realFileType = file.name.split('.')[file.name.split('.').length - 1]; let realFileType = file.name.split('.')[file.name.split('.').length - 1];
const isType = ( const isType = (
file.type === fileType.pdf || file.type === fileType.ppt || file.type === fileType.pptx || file.type === fileType.xlsx|| file.type === fileType.pdf || file.type === fileType.ppt || file.type === fileType.pptx || file.type === fileType.xlsx||