SOURCE

let obj={"provinceId":[],"provinceName":null,"year":[],"xtitle":["::CAC","::GLI","::VSD","::STK","::TC","::PACG","::AECOPD","::ASD","::Cap","::PD","::CoC","::PIP","::MEN","::STEMI","::DPD","::OIT","::CABG","::HF","::SEP","xxddddd::Hip","产科二区::CS","内科::CS","呼吸与危重症医学科::Cap-Adult","呼吸内科::Cap-Adult","呼吸内科病区::Cap","妇产科::UM","妇科::CS","妇科::DVT","妇科::UM","心胸外科::CS","心胸外科::DVT","心胸外科::SAP","心胸外科::CAC","心胸外科::PIP","心胸外科::VTE","心胸外科::EAR","心胸外科::APTE","心胸外科::ARDS","普通外科::CoC","泌尿外科::PIP","测试科室(fy)::Knee","神经内科::DVT","神经内科::VTE","神经内科::STK","神经内科1111::Knee","神经内科1111::PACG","神经内科1111::Hip","神经外科二区::VTE","综合普外::CS","综合普外::Knee","综合普外::CAC","综合普外::PIP","综合普外::Hip","肾内风湿科::HF","肾科::HD","肿瘤外科::GC","胸外科::LC","胸外科::TIA","胸外科::TC","都是::Hip","骨科::Knee","骨科::ALL","骨科::BC","骨科::DG","骨科::DVT","骨科::PT","骨科::GLI","骨科::VTE","骨科::HBIPS","骨科::MVR","骨科::DDH","骨科::STK","骨科::AECOPD","骨科::ASD","骨科::CSE","骨科::aSAH","骨科::STEMI","骨科::UM","骨科::DKD","骨科::HBV","骨科::CC","骨科::CACC","骨科::CAC","骨科::AF","骨科::VSD","骨科::TIA","骨科::Hip","骨科::ICH","骨科::TC","骨科::CS","骨科::PACG","骨科::PA","骨科::RD","骨科::Cap","骨科::PD","骨科::CoC","骨科::PIP","骨科::LC","骨科::TSCC","骨科::TN","骨科::OIT","骨科::CABG","骨科::APL","骨科::AVR","骨科::Cap-Adult","骨科::HF","骨科::SEP"],"ytitle":["完成率","已上传国家","已作废","已完成","已打回","待填报","手动排除","未完成"],"data":[{"":{"CAC":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":25,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"GLI":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"VSD":{"完成率":0,"未完成":1,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"STK":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":841,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"TC":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":3,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"PACG":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":65,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"AECOPD":{"完成率":1,"已上传国家":33,"已作废":0,"已完成":0,"已打回":0,"待填报":0,"手动排除":0,"未完成":0},"ASD":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":1},"Cap":{"完成率":0,"未完成":1,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"PD":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":15,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"CoC":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":88,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"PIP":{"完成率":0.6666667,"未完成":1,"已打回":0,"已上传国家":2,"已完成":0,"手动排除":0,"待填报":1,"已作废":0},"MEN":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"STEMI":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":209,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"DPD":{"完成率":0.8888889,"未完成":1,"已打回":1,"已上传国家":8,"已完成":0,"手动排除":0,"待填报":0,"已作废":2},"OIT":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":2,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"CABG":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"HF":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":72,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"SEP":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":6,"已完成":1,"手动排除":0,"待填报":0,"已作废":0}}},{"xxddddd":{"Hip":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0}}},{"产科二区":{"CS":{"完成率":0,"未完成":2,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":2,"已作废":0}}},{"内科":{"CS":{"完成率":0,"未完成":208,"已打回":3,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":205,"已作废":2}}},{"呼吸与危重症医学科":{"Cap-Adult":{"完成率":0,"未完成":1,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0}}},{"呼吸内科":{"Cap-Adult":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"呼吸内科病区":{"Cap":{"完成率":0.6666667,"未完成":1,"已打回":0,"已上传国家":1,"已完成":1,"手动排除":0,"待填报":1,"已作废":0}}},{"妇产科":{"UM":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0}}},{"妇科":{"CS":{"完成率":0.027522936,"未完成":106,"已打回":9,"已上传国家":0,"已完成":3,"手动排除":0,"待填报":97,"已作废":1},"DVT":{"完成率":0,"未完成":2,"已打回":2,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"UM":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"心胸外科":{"CS":{"完成率":0,"未完成":1,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"DVT":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":1,"待填报":0,"已作废":0},"SAP":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0},"CAC":{"完成率":0,"未完成":29,"已打回":5,"已上传国家":0,"已完成":0,"手动排除":1,"待填报":24,"已作废":8},"PIP":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0},"VTE":{"完成率":0,"未完成":3,"已打回":2,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0},"EAR":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0},"APTE":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0},"ARDS":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0}}},{"普通外科":{"CoC":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0}}},{"泌尿外科":{"PIP":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0}}},{"测试科室(fy)":{"Knee":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"神经内科":{"DVT":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0},"VTE":{"完成率":0,"未完成":1,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"STK":{"完成率":0.015452539,"未完成":446,"已打回":158,"已上传国家":6,"已完成":1,"手动排除":0,"待填报":288,"已作废":0}}},{"神经内科1111":{"Knee":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0},"PACG":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0},"Hip":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"神经外科二区":{"VTE":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":0,"已完成":1,"手动排除":0,"待填报":0,"已作废":0}}},{"综合普外":{"CS":{"完成率":0.16666667,"未完成":5,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":5,"已作废":0},"Knee":{"完成率":0,"未完成":8,"已打回":2,"已上传国家":0,"已完成":0,"手动排除":1,"待填报":6,"已作废":2},"CAC":{"完成率":0,"未完成":6,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":5,"已作废":1},"PIP":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":1},"Hip":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"肾内风湿科":{"HF":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"肾科":{"HD":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":1}}},{"肿瘤外科":{"GC":{"完成率":0,"未完成":5,"已打回":2,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":3,"已作废":0}}},{"胸外科":{"LC":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"TIA":{"完成率":1,"未完成":0,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"TC":{"完成率":0,"未完成":1,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":1,"已作废":0}}},{"都是":{"Hip":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":3,"待填报":0,"已作废":0}}},{"骨科":{"Knee":{"完成率":0.6,"未完成":18,"已打回":2,"已上传国家":3,"已完成":24,"手动排除":0,"待填报":16,"已作废":5},"ALL":{"完成率":0,"未完成":68,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":68,"已作废":0},"BC":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"DG":{"完成率":0,"未完成":60,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":60,"已作废":0},"DVT":{"完成率":0.15488936,"未完成":1184,"已打回":1109,"已上传国家":205,"已完成":12,"手动排除":0,"待填报":75,"已作废":2},"PT":{"完成率":0,"未完成":50,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":49,"已作废":0},"GLI":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"VTE":{"完成率":0,"未完成":0,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":0,"已作废":0},"HBIPS":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"MVR":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"DDH":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"STK":{"完成率":0,"未完成":30,"已打回":3,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":27,"已作废":0},"AECOPD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"ASD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CSE":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"aSAH":{"完成率":0.032258064,"未完成":30,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"STEMI":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"UM":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"DKD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"HBV":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CC":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CACC":{"完成率":0.03448276,"未完成":28,"已打回":1,"已上传国家":1,"已完成":0,"手动排除":1,"待填报":27,"已作废":0},"CAC":{"完成率":0.033333335,"未完成":29,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":29,"已作废":0},"AF":{"完成率":0,"未完成":30,"已打回":1,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":29,"已作废":0},"VSD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"TIA":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"Hip":{"完成率":0.09714286,"未完成":316,"已打回":41,"已上传国家":25,"已完成":9,"手动排除":1,"待填报":275,"已作废":5},"ICH":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"TC":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CS":{"完成率":0.33333334,"未完成":2,"已打回":1,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":1,"已作废":0},"PACG":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"PA":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"RD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"Cap":{"完成率":0,"未完成":29,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":29,"已作废":0},"PD":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CoC":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"PIP":{"完成率":0,"未完成":29,"已打回":26,"已上传国家":0,"已完成":0,"手动排除":1,"待填报":3,"已作废":0},"LC":{"完成率":0,"未完成":30,"已打回":2,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":28,"已作废":0},"TSCC":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"TN":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"OIT":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"CABG":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"APL":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"AVR":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0},"Cap-Adult":{"完成率":0.03448276,"未完成":28,"已打回":0,"已上传国家":1,"已完成":0,"手动排除":0,"待填报":28,"已作废":1},"HF":{"完成率":0,"未完成":29,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":29,"已作废":1},"SEP":{"完成率":0,"未完成":30,"已打回":0,"已上传国家":0,"已完成":0,"手动排除":0,"待填报":30,"已作废":0}}}],"summary":null,"unit":null}

console.log(obj.data[0]);


// var res = 1;
// function loopGetLevel(obj, level) {
//     var level = level ? level : 1;
//     //console.log(obj,typeof obj)
//     if (typeof obj === 'object') {
//         for (var key in obj) {
//             if (typeof obj[key] === 'object') {
//                 loopGetLevel(obj[key], level + 1);
//             } else {
//                 res = level + 1 > res ? level + 1 : res;
//             }
//         }
//     } else {
//         res = level > res ? level : res;
//     }
// }
// console.log(loopGetLevel(obj),1)
// console.log(res);
// res = 1;
let o={a:1,b:{c:{d:3}}}

// console.log(loopGetLevel(o),2);
// console.log(res);


function getObjectLv(params){
    let res=1;
    let loopGetLevel=(obj,level)=>{
         var level = level ? level : 1;
        //console.log(obj,typeof obj)
        if (typeof obj === 'object') {
            for (var key in obj) {
                if (typeof obj[key] === 'object') {
                    loopGetLevel(obj[key], level + 1);
                } else {
                    res = level + 1 > res ? level + 1 : res;
                }
            }
        } else {
            res = level > res ? level : res;
        }
    }
    loopGetLevel(params)
    return res;
}
console.log(getObjectLv(o),3);
console.log(getObjectLv(obj.data[0]),4);
console 命令行工具 X clear

                    
>
console