提交 b73bf4cc 编写于 作者: bo.dang's avatar bo.dang

背景图回显优化

上级 dce52e59
...@@ -721,15 +721,16 @@ ...@@ -721,15 +721,16 @@
if(res.code == "000000") { if(res.code == "000000") {
let images = res.data; let images = res.data;
// this.backgroundImages = images; // if(images != null){
if(images != null){ // for(let i = 0; i < images.length; i++){
for(let i = 0; i < images.length; i++){ // images[i].backgroundImageId = String(images[i].backgroundImageId);
images[i].backgroundImageId = String(images[i].backgroundImageId); // }
} // }
}
this.backgroundImages = images; this.backgroundImages = images;
// this.$set(this.formData, 'backgroundImages', images); // 设置背景图
// break; if(this.backgroundImageUrl != null || this.backgroundImageUrl != ''){
this.setbgImage();
}
} }
}).catch((error) => { }).catch((error) => {
...@@ -1425,16 +1426,11 @@ ...@@ -1425,16 +1426,11 @@
} }
this.formData.guests.splice(index, 1); this.formData.guests.splice(index, 1);
}, },
// 封装数据
initFormData(){
this.formData.streamType = String(this.formData.streamType);
this.changeStreamType();
// 初始化背景图
setbgImage(){
// 背景图 // 背景图
if(this.formData.backgroundImageId != null){ if((this.formData.backgroundImageId != null || this.formData.backgroundImageId != "") && this.backgroundImages.length > 0){
let selectedImages = this.backgroundImages.filter(function (item) { let selectedImages = this.backgroundImages.filter(function (item) {
return item.backgroundImageId == vm.formData.backgroundImageId; return item.backgroundImageId == vm.formData.backgroundImageId;
}); });
...@@ -1443,6 +1439,17 @@ ...@@ -1443,6 +1439,17 @@
this.backgroundImageUrl = selectedImages[0].imageUrl; this.backgroundImageUrl = selectedImages[0].imageUrl;
} }
} }
},
// 封装数据
initFormData(){
this.formData.streamType = String(this.formData.streamType);
this.changeStreamType();
if(this.backgroundImageUrl != null || this.backgroundImageUrl != ''){
this.setbgImage();
}
this.formData.scope = String(this.formData.scope); this.formData.scope = String(this.formData.scope);
this.formData.countRule = String(this.formData.countRule); this.formData.countRule = String(this.formData.countRule);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册