好文章要保留:https://www.cnblogs.com/jiangyuzhen/p/11014021.html
参数
const param1 = {
patientId: this.patientId,
points: getPatientProblemvoListData.points,
problem: getPatientProblemvoListData.patientProblemvoList,
problemNo:this.problemNo
};
let problem = new Object();
console.log("参数,", param);
for (let i = 0; i < param.problem.length; i++) {
console.log("i", param.problem[i]);
let key = param.problem[i].problem;
let value = param.problem[i].options;
problem[key] = value;
}
param.problem = problem;
console.log("problem", param);
数据结构
"problem":{"problemNo":"6733785241","problem":"问题","options":"回答1"}括号里面,变成这样"problem":{"问题一":"选项A","问题二":"选项B","问题三":"选项C","问题四":"选项D"}

网友评论