fix 修复上传报错导致后续上传数量不正常无法关闭loading问题
Signed-off-by: 疯狂的狮子Li <15040126243@163.com>
This commit is contained in:
parent
f0bfff1ff3
commit
4ec85b5c31
|
|
@ -151,13 +151,19 @@ export default {
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
if (res.code === 200) {
|
||||||
if (this.uploadList.length === this.number) {
|
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
if (this.uploadList.length === this.number) {
|
||||||
this.uploadList = [];
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
this.number = 0;
|
this.uploadList = [];
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.number = 0;
|
||||||
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
|
this.number--;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除文件
|
// 删除文件
|
||||||
|
|
|
||||||
|
|
@ -122,13 +122,19 @@ export default {
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
if (res.code === 200) {
|
||||||
if (this.uploadList.length === this.number) {
|
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
if (this.uploadList.length === this.number) {
|
||||||
this.uploadList = [];
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
this.number = 0;
|
this.uploadList = [];
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.number = 0;
|
||||||
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
|
this.number--;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传前loading加载
|
// 上传前loading加载
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue