|
|
@@ -56,6 +56,10 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ item: {
|
|
|
+ type: Object,
|
|
|
+ default: {},
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -193,17 +197,36 @@ export default {
|
|
|
}
|
|
|
addPhotov(form).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- that.imgArr = res.data.url;
|
|
|
+ // that.imgArr = res.data.url;
|
|
|
loind1.clear();
|
|
|
that.$toast('上传成功!');
|
|
|
- that.$emit('newimgarr', {
|
|
|
- fileUrl: res.data.url,
|
|
|
- id: res.data.fileId,
|
|
|
- fileType: res.fileType,
|
|
|
- fileName: res.fileName,
|
|
|
- type: that.type,
|
|
|
- index: that.indexImg,
|
|
|
+ let urlArr = [];
|
|
|
+ let idArr = [];
|
|
|
+ res.data.forEach((val) => {
|
|
|
+ urlArr.push({
|
|
|
+ fileUrl: val.url,
|
|
|
+ id: val.fileId,
|
|
|
+ fileType: val.fileType,
|
|
|
+ fileName: val.fileName,
|
|
|
+ type: that.type,
|
|
|
+ index: that.indexImg,
|
|
|
+ });
|
|
|
+ idArr.push(val.id);
|
|
|
});
|
|
|
+ if (this.item.fileInfoList == null || this.item.fileInfoList == undefined) {
|
|
|
+ this.item.fileInfoList = [];
|
|
|
+ this.item.fileIdList = [];
|
|
|
+ }
|
|
|
+ this.item.fileInfoList.concat(urlArr);
|
|
|
+ this.item.fileIdList.concat(idArr);
|
|
|
+ // that.$emit('newimgarr', {
|
|
|
+ // fileUrl: res.data.url,
|
|
|
+ // id: res.data.fileId,
|
|
|
+ // fileType: res.fileType,
|
|
|
+ // fileName: res.fileName,
|
|
|
+ // type: that.type,
|
|
|
+ // index: that.indexImg,
|
|
|
+ // });
|
|
|
} else {
|
|
|
that.$toast('上传失败!');
|
|
|
}
|