let saveObj={"formData":{"fields":[{"__config__":{"label":"一级标题#{医生完成率}","tag":"firstTitle","changeTag":true,"tagIcon":"firstTitle","layout":"colFormItem","showLabel":true,"span":24,"formId":"5ac54add-b1f9-4476-9e62-41de941fda69","renderKey":1670317487012},"style":{"width":"100%"},"__vModel__":"field5ac54add-b1f9-4476-9e62-41de941fda69"},{"__config__":{"label":"二级标题#{病种完成率}","tag":"secondTitle","changeTag":true,"tagIcon":"secondTitle","layout":"colFormItem","showLabel":true,"span":24,"formId":"9c849979-feab-4f77-848e-f12dc523918d","renderKey":1670317487502},"style":{"width":"100%"},"__vModel__":"field9c849979-feab-4f77-848e-f12dc523918d"},{"__config__":{"label":"三级标题#{年份}","tag":"thirdTitle","changeTag":true,"tagIcon":"thirdTitle","layout":"colFormItem","showLabel":true,"span":24,"formId":"e6a5e311-555a-4431-89c5-8c0569c9d39a","renderKey":1670317488494},"style":{"width":"100%"},"__vModel__":"fielde6a5e311-555a-4431-89c5-8c0569c9d39a"},{"__config__":{"label":"柱状图","tag":"echartBar","changeTag":true,"tagIcon":"echartBar","layout":"colFormItem","showLabel":true,"span":24,"chart":{"type":"bar","name":"各科室填报工作情况统计-医生分组"},"formId":"3fb5b7cd-4e3b-4ef0-8987-7bcba095d7e9","renderKey":1670317504814},"style":{"width":"100%"},"__vModel__":"field3fb5b7cd-4e3b-4ef0-8987-7bcba095d7e9"}],"formRef":"elForm","formModel":"formData","size":"medium","labelPosition":"right","labelWidth":100,"formRules":"rules","gutter":15,"disabled":false,"span":24,"formBtns":true},"formName":"123"}
let over= {
"type": "title",
"chartTitle": "",
"textContent": "质控报告标题",
"echarList": null
};
let list=[];
saveObj.formData.fields.map(res=>{
list.push(ceaterItem(res))
})
console.log(list);
function ceaterItem(item){
let obj={
"type": "",
"chartTitle": "",
"textContent": "",
"echarList": null
}
if(['firstTitle','secondTitle','thirdTitle','text'].includes(item.tag)){
obj.type=item.tag;
obj.textContent=item.label;
}else if(['bar'].includes(item.tag)){
obj.type=item.tag;
}
return obj;
}
console