|
|
@@ -148,7 +148,7 @@
|
|
|
<!-- 上传提示 -->
|
|
|
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
|
|
文件
|
|
|
- <template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
|
|
+ <template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}GB</b></template>
|
|
|
<template v-if="fileType"> 格式为<b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
|
|
|
的文件
|
|
|
</div>
|
|
|
@@ -180,7 +180,7 @@ export default {
|
|
|
dicts: [],
|
|
|
data() {
|
|
|
return {
|
|
|
- fileSize: 1000,
|
|
|
+ fileSize: 2,
|
|
|
fileType: ['zip'],
|
|
|
isShowTip: true,
|
|
|
// 遮罩层
|
|
|
@@ -342,9 +342,10 @@ export default {
|
|
|
}
|
|
|
// 校检文件大小
|
|
|
if (this.fileSize) {
|
|
|
- const isLt = file.size / 1024 / 1024 < this.fileSize;
|
|
|
+ const maxSize = this.fileSize * 1024 * 1024 * 1024;
|
|
|
+ const isLt = file.size < maxSize;
|
|
|
if (!isLt) {
|
|
|
- this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
|
|
|
+ this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} GB!`);
|
|
|
return false;
|
|
|
}
|
|
|
}
|