update 优化多文件 多图片上传
parent
3f682fc80c
commit
bc72868fc5
|
|
@ -151,6 +151,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
|
if (res.code === 200) {
|
||||||
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
|
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
|
||||||
if (this.uploadList.length === this.number) {
|
if (this.uploadList.length === this.number) {
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
|
|
@ -159,6 +160,10 @@ export default {
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 删除文件
|
// 删除文件
|
||||||
handleDelete(index) {
|
handleDelete(index) {
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
|
if (res.code == 200) {
|
||||||
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
|
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
|
||||||
if (this.uploadList.length === this.number) {
|
if (this.uploadList.length === this.number) {
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
|
|
@ -130,6 +131,10 @@ export default {
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 上传前loading加载
|
// 上传前loading加载
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue