// 血检总人数
let num = 0;
//hp血检阳性数
let num2 = 0;
// 实际精查人数
let num3 = 0;
// /应精查人数
let num4 = 0;
// 高级别上皮内瘤变
let rnum1 = '0%';
// 早期胃癌
let rnum2 = '0%';
// 早期食管癌
let rnum3 = '0%';
// 萎缩性胃炎
let onum1 = 0;
// 胃溃疡
let onum2 = 0;
// 胃息肉
let onum3 = 0;
// 申请医院
let anum1 = 0;
// 开展筛查医院
let anum2 = 0;
// 筛查总人数
let anum3 = 0;
// 认证医院
let anum4 = 0;

// 使用后台返回数据填充
$.getJSON("http://gicc-back-end:2019/data-plat/complex/statistics", function(data) {
    let complex = data.data;
   // console.log(complex);
    obj.count1.lastNumber = complex.serumActualTotal;
    obj.count2.lastNumber = complex.iggPositive;
    obj.count3.lastNumber = complex.gastroscopyDetailActual;
    obj.count4.lastNumber = complex.gastroscopyDetailTotal;
    obj.rate1 = parseInt(((obj.count2.lastNumber / obj.count1.lastNumber)) * 100) - 1.2 + '%';
    obj.rate2 = parseInt(((obj.count3.lastNumber / obj.count4.lastNumber)) * 100) - 2 + '%';
    obj.rate14k = parseInt(((obj.count2.lastNumber / obj.count1.lastNumber)) * 100) - 1 + '%';
    obj.rate24k = parseInt(((obj.count3.lastNumber / obj.count4.lastNumber)) * 100) - 2 + '%';
    obj.rate1pc = parseInt(((obj.count2.lastNumber / obj.count1.lastNumber)) * 100) - 1 + '%';
    obj.rate2pc = parseInt(((obj.count3.lastNumber / obj.count4.lastNumber)) * 100) - 2 + '%';
    obj.rnum1 = complex.highEsophagusTumor;
    obj.rnum2 = complex.earlyEsophagealCancer;
    obj.rnum3 = complex.earlyGastricCancer;
    obj.onum1 = complex.atrophicGastritis;
    obj.onum2 = complex.stomachUlcer;
    obj.onum3 = complex.gastricPolyp;
    obj.anum1 = complex.applyHosp;
    obj.anum2 = complex.screeningHosp;
    obj.anum3 = complex.screeningTotal;
    obj.anum4 = complex.certifiedHosp;
});

let obj = {
    // 血检总人数
    count1: {
        lastNumber: num,
        duration: 3000,
        easing: 'swing', //慢快慢
    },
    //hp血检阳性数
    count2: {
        lastNumber: num2,
        duration: 3000,
        easing: 'swing', //慢快慢
    },
    // 实际精查人数
    count3: {
        lastNumber: num3,
        duration: 3000,
        easing: 'swing', //慢快慢
    },
    // /应精查人数
    count4: {
        lastNumber: num4,
        duration: 3000,
        easing: 'swing', //慢快慢
    },
    //第一组小人的个数Big
    rate1: parseInt(((num2 / num)) * 100) - 1.2 + '%',
    //第二组小人的个数Big
    rate2: parseInt(((num3 / num4)) * 100) - 2 + '%',
    //第一组小人的个数4K
    rate14k: parseInt(((num2 / num)) * 100) - 1 + '%',
    //第二组小人的个数4K
    rate24k: parseInt(((num3 / num4)) * 100) - 2 + '%',
    //第一组小人的个数PC
    rate1pc: parseInt(((num2 / num)) * 100) - 1 + '%',
    //第二组小人的个数PC
    rate2pc: parseInt(((num3 / num4)) * 100) - 2 + '%',
    //诊断结果
    rnum1,
    rnum2,
    rnum3,
    // 其他
    onum1,
    onum2,
    onum3,
    anum1,
    anum2,
    anum3,
    anum4
};






