场景:
单击处理按钮,会调接口拿到返回值,然后返回值给表单回显。但是现在新需求是由于图片的特殊性,必须要经过另一个接口的转换在拿到新的图片地址。就是我点击处理按钮会发两次请求,一次请求是拿数据,另一个是将拿到的图片地址再去发起请求得到新的图片。
getDetailReport(reportId, type){
let params = {
reportId: reportId
}
api.detailReport(params).then(res => {
if(!res.error){
this.detailList = res || []
let str = 'report/'
if(res.pictures && res.pictures.length > 0){
let newPath = res.pictures.toString()
if(newPath.includes(str)){
let params = {
keyList: res.pictures
}
api.getImageUrl(params).then(data => {
if(!data.error){
this.detailList.picShow = data.urlList
this.editForm.picShow = this.detailList.picShow
}
})
}else{
let picShow = []
this.detailList.pictures.forEach(ele => {
picShow.push(this.reportPath + ele)
})
this.detailList.picShow = picShow
this.editForm.picShow = this.detailList.picShow
}
}
现在的结果就是我表单里面的图片为空,但是看了一下返回值是对的,就是渲染不出来
heoght ????