|
@@ -55,6 +55,7 @@
|
|
:limit="1"
|
|
:limit="1"
|
|
:on-preview="handlePreview"
|
|
:on-preview="handlePreview"
|
|
:on-remove="handleRemove"
|
|
:on-remove="handleRemove"
|
|
|
|
+ :before-upload="handleBeforeUpLoad"
|
|
:before-remove="beforeRemove"
|
|
:before-remove="beforeRemove"
|
|
:on-change="handleChange"
|
|
:on-change="handleChange"
|
|
:on-success="handleSuccess"
|
|
:on-success="handleSuccess"
|
|
@@ -134,6 +135,7 @@
|
|
showUpLoad:true,
|
|
showUpLoad:true,
|
|
showFileList: false,
|
|
showFileList: false,
|
|
upload: false,
|
|
upload: false,
|
|
|
|
+ showConfirm: true,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/*watch:{
|
|
/*watch:{
|
|
@@ -400,11 +402,25 @@
|
|
this.showUpLoad = true
|
|
this.showUpLoad = true
|
|
this.form.fileList=[]
|
|
this.form.fileList=[]
|
|
},
|
|
},
|
|
|
|
+ handleBeforeUpLoad(file){
|
|
|
|
+ console.log('aaaaaaaaaa',file);
|
|
|
|
+ if(file.size/1024/1024 >= 500){
|
|
|
|
+ this.warning('文件上传失败,超出大小限制500MB')
|
|
|
|
+ this.form.fileList=[]
|
|
|
|
+ this.showConfirm = false
|
|
|
|
+ return false
|
|
|
|
+ }else{
|
|
|
|
+ this.showConfirm = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handlePreview(file) {
|
|
handlePreview(file) {
|
|
- console.log(file);
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
beforeRemove(file, fileList) {
|
|
beforeRemove(file, fileList) {
|
|
- return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
|
|
+ if(this.showConfirm ){
|
|
|
|
+ return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|