|
@@ -13,7 +13,8 @@
|
|
|
@close="closeDialog"
|
|
@close="closeDialog"
|
|
|
>
|
|
>
|
|
|
<el-alert
|
|
<el-alert
|
|
|
- title="提示:请先下载导入模板填写设备信息;相关附件可打包为 ZIP 一并上传(非必填),每个类型仅支持上传 1 个文件。"
|
|
|
|
|
|
|
+ title="提示:请先下载导入模板填写设备信息;相关附件可打包为 ZIP 一并上传(非必填),每个类型仅支持上传 1 个文件且单个文件大小不超过
|
|
|
|
|
+ 200M。"
|
|
|
type="info"
|
|
type="info"
|
|
|
:closable="false"
|
|
:closable="false"
|
|
|
show-icon
|
|
show-icon
|
|
@@ -135,6 +136,8 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
formLabelWidth: '100px',
|
|
formLabelWidth: '100px',
|
|
|
level: '',
|
|
level: '',
|
|
|
|
|
+ // 单个上传文件最大 200M
|
|
|
|
|
+ maxFileSize: 200 * 1024 * 1024,
|
|
|
paramForm: {
|
|
paramForm: {
|
|
|
zipFile: null,
|
|
zipFile: null,
|
|
|
zipFileList: [],
|
|
zipFileList: [],
|
|
@@ -205,6 +208,11 @@ export default {
|
|
|
this.clearZipData()
|
|
this.clearZipData()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ if (file.size > this.maxFileSize) {
|
|
|
|
|
+ this.$message.warning('上传文件大小不能超过 200M!')
|
|
|
|
|
+ this.clearZipData()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const latest = fileList.slice(-1)
|
|
const latest = fileList.slice(-1)
|
|
|
this.paramForm.zipFileList = latest
|
|
this.paramForm.zipFileList = latest
|
|
|
this.paramForm.zipFile = latest[0] ? latest[0].raw : null
|
|
this.paramForm.zipFile = latest[0] ? latest[0].raw : null
|
|
@@ -261,6 +269,11 @@ export default {
|
|
|
this.clearXlsxData()
|
|
this.clearXlsxData()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ if (file.size > this.maxFileSize) {
|
|
|
|
|
+ this.$message.warning('上传文件大小不能超过 200M!')
|
|
|
|
|
+ this.clearXlsxData()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const latest = fileList.slice(-1)
|
|
const latest = fileList.slice(-1)
|
|
|
this.paramForm.xlsxFileList = latest
|
|
this.paramForm.xlsxFileList = latest
|
|
|
this.paramForm.xlsxFile = latest[0] ? latest[0].raw : null
|
|
this.paramForm.xlsxFile = latest[0] ? latest[0].raw : null
|