Commit c0380aaf6a9eb59f9a2e1cce22c7acd4d6c3cc10

Authored by YunaiV
1 parent eda84187

v3.7.0 复多图组件验证失败被删除问题

yudao-ui-admin/src/components/ImageUpload/index.vue
... ... @@ -117,8 +117,10 @@ export default {
117 117 // 删除图片
118 118 handleRemove(file, fileList) {
119 119 const findex = this.fileList.map(f => f.name).indexOf(file.name);
120   - this.fileList.splice(findex, 1);
121   - this.$emit("input", this.listToString(this.fileList));
  120 + if(findex > -1) {
  121 + this.fileList.splice(findex, 1);
  122 + this.$emit("input", this.listToString(this.fileList));
  123 + }
122 124 },
123 125 // 上传成功回调
124 126 handleUploadSuccess(res) {
... ... @@ -184,7 +186,7 @@ export default {
184 186 let strs = "";
185 187 separator = separator || ",";
186 188 for (let i in list) {
187   - strs += list[i].url + separator;
  189 + strs += list[i].url.replace(this.baseUrl, "") + separator;
188 190 }
189 191 return strs != '' ? strs.substr(0, strs.length - 1) : '';
190 192 }
... ...