bug: 上传上去文件以后清空以便于下次重新上传

This commit is contained in:
fanlin
2021-07-29 09:44:27 +08:00
parent 5123e51408
commit c872b0edb1
@@ -843,6 +843,7 @@
<el-upload <el-upload
multiple multiple
drag drag
:file-list="fileList"
:action="fileUrl" :action="fileUrl"
ref="importfile" ref="importfile"
name="file" name="file"
@@ -1162,6 +1163,7 @@
}, },
data () { data () {
return { return {
fileList: [],
filterText:'', filterText:'',
textStatusMap: {}, // 文本状态id与name对应 textStatusMap: {}, // 文本状态id与name对应
standardDrawer: false, standardDrawer: false,
@@ -1967,10 +1969,11 @@
importFileSuccess (response, file,fileList) { importFileSuccess (response, file,fileList) {
// 上传成功后判断是否是两条数据是的话替换掉旧数据 // 上传成功后判断是否是两条数据是的话替换掉旧数据
if (fileList.length > 1) { if (fileList.length > 1) {
fileList.splice(0, 1) this.fileList = fileList.splice(0, 1)
} }
if (response.ok) { if (response.ok) {
this.fileMadel = false this.fileMadel = false
this.fileList = []
if(this.fileType === 'fbgbjbd'){ if(this.fileType === 'fbgbjbd'){
this.form.fbgbjbd = response.data.id; this.form.fbgbjbd = response.data.id;
this.form.fbgbjbdName = response.data.name; this.form.fbgbjbdName = response.data.name;