feat: There is no way the, 56672 编辑 文件过多 再次编辑时 上传的多个文件丢失大部分
This commit is contained in:
@@ -314,9 +314,9 @@
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action="/api/att/attFile/uploadNew"
|
||||
:before-upload="beginImportFile"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
:before-remove="beforeRemove"
|
||||
multiple
|
||||
:limit="50"
|
||||
:on-exceed="handleExceed"
|
||||
@@ -644,15 +644,42 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
beginImportFile (file) {
|
||||
var filename = file.name
|
||||
var index1 = filename.lastIndexOf('.')
|
||||
var index2 = filename.length
|
||||
var fileSuffix = filename.substring(index1, index2)
|
||||
// const fileSuffix = file.name.split('.')[1] // 后缀名
|
||||
// 判断上传文件格式
|
||||
if (fileSuffix === '.pdf' || fileSuffix === '.PDF' || fileSuffix === '.ppt'|| fileSuffix === '.PPT' || fileSuffix === '.pptx'|| fileSuffix === '.PPTX'|| fileSuffix === '.doc' || fileSuffix === '.DOC' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.xls' || fileSuffix === '.xlsx') {
|
||||
return true
|
||||
} else {
|
||||
this.spinShow = false
|
||||
this.$message.error('文件' + file.name + '格式不正确,请上传PDF/PPT/PPTX/DOC/DOCX或XLS文件')
|
||||
return false
|
||||
}
|
||||
// 判断文件上传大小
|
||||
// eslint-disable-next-line no-unreachable
|
||||
if (file.size / 1024 / 1024 <= 200) {
|
||||
return true
|
||||
} else {
|
||||
this.$message.error('文件' + file.name + '大小不超过200M')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
uploadSuccess(response, file, fileList) {
|
||||
const fileIdList = fileList.map(item => {
|
||||
if (item.response){
|
||||
return item.response.data.attId
|
||||
}else {
|
||||
return item.id
|
||||
}
|
||||
})
|
||||
this.attributeEO.attachFileId = fileIdList.join(',')
|
||||
|
||||
if(response.ok){
|
||||
const fileIdList = fileList.map(item => {
|
||||
if (item.response){
|
||||
return item.response.data.attId
|
||||
}else {
|
||||
return item.id
|
||||
}
|
||||
})
|
||||
this.attributeEO.attachFileId = fileIdList.join(',')
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
const fileIdList = fileList.map(item => {
|
||||
|
||||
Reference in New Issue
Block a user