【修改】增加加载中
This commit is contained in:
@@ -581,7 +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||
|
||||||
@@ -590,10 +590,18 @@ export default {
|
|||||||
);
|
);
|
||||||
const isSize = file.size / 1024 / 1024 < 200;
|
const isSize = file.size / 1024 / 1024 < 200;
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
this.$message.error('仅能上传 pdf|ppt|pptx 格式文件');
|
setTimeout(()=>{
|
||||||
|
this.$message.error('仅能上传 pdf|ppt|pptx 格式文件');
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
this.$message.error('您最大可上传200M文件');
|
setTimeout(()=> {
|
||||||
|
this.$message.error('您最大可上传200M文件');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(isType && isSize){
|
||||||
|
this.table_loading=true
|
||||||
}
|
}
|
||||||
return isType && isSize;
|
return isType && isSize;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user