|
@@ -7,8 +7,6 @@
|
|
|
class="upload-demo"
|
|
|
:action="url"
|
|
|
:on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :before-remove="beforeRemove"
|
|
|
multiple
|
|
|
:limit="filleNumber ? filleNumber : 1"
|
|
|
:before-upload="handlebeforeUplaod"
|
|
@@ -123,6 +121,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handlebeforeUplaod(file) {
|
|
|
+ if(this.uploadType=='image'){
|
|
|
+ if (file.size > 2 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传图片大小不能超过2M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ }else if(this.uploadType=='mp4'){
|
|
|
+ if (file.size > 500 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传视频大小不能超过500M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (file.size > 20 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传文件大小不能超过20M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ }
|
|
|
this.loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: "Loading",
|
|
@@ -130,13 +144,13 @@ export default {
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
});
|
|
|
},
|
|
|
- handleRemove(file, fileList) {
|
|
|
- this.changeFillId(fileList, "", this.index);
|
|
|
- this.$message.success("移除成功");
|
|
|
- },
|
|
|
- beforeRemove(file, fileList) {
|
|
|
- return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
- },
|
|
|
+ // handleRemove(file, fileList) {
|
|
|
+ // this.changeFillId(fileList, "", this.index);
|
|
|
+ // this.$message.success("移除成功");
|
|
|
+ // },
|
|
|
+ // beforeRemove(file, fileList) {
|
|
|
+ // return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
+ // },
|
|
|
handlePreview(file) {},
|
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.warning(
|