Commit 7bc80462 authored by zhengke's avatar zhengke

修复行程初始化

parent f2a7de83
......@@ -54,7 +54,7 @@ export default () => {
FeatureImgStore.setFeatureImg(JSON.parse(JSON.stringify(FeatureImg.value)))
}).catch(() => {
message.error('导出图片失败')
// message.error('导出图片失败')
})
}, 200)
......
......@@ -170,15 +170,12 @@ const GetTripFiledData = async () =>{
const travel = dataRes.data.data
const cursors = [] as Array<any>
slidesData.forEach((x,index)=>{
let imageList = x.elements.filter(y=>{
return y.type=='image'
})
let imgIndex = imageList.length
x.elements.forEach(y=>{
if(y.TemplateDataSource && y.TemplateDataSource.Content){
let dataPath = y.TemplateDataSource.Content.split('.')
let value=JSON.parse(JSON.stringify(travel));
dataPath.forEach((oo,i)=>{
if(value && value[oo]){
if(i==0 && Array.isArray(value[oo])){
let temp = cursors.find(item=>item.key==oo)
......@@ -203,7 +200,9 @@ const GetTripFiledData = async () =>{
y.content= y.content.replace(getHtmlPlainText(y.content),value)
}else if(value && Array.isArray(value)){
//替换
if(value[imgIndex--]) y.src=value[imgIndex--]
if(y.type=='image'){
y.src = value[0]
}
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment