data数据结构
formData: {
risk: '28817873',
stakeList: [
{ startTime: '10:00:00', endTime: '12:00:00'' },
{ startTime: '12:00:00', endTime: '15:00:00' },
{ startTime: '15:00:00', endTime: '23:00:00' }
]
}
var form = _this.formData;
var answer = {};
if(form.stakeList.length > 0){
for(var i = 0; i < form.stakeList.length; i++){
answer['stakeList['+ i +'].startTime'] = form.stakeList[i].startTime;
answer['stakeList['+ i +'].endTime'] = form.stakeList[i].endTime;
}
}
ps: formData处理数据会把复杂list封装成stakeList[startTime]这种,需要转为上述格式,才能被实体类接收