let data = [{
    title: '体重',
    showCon: false,
    key: 'weight',
    dw: 'kg',
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    color: "#ff4239",
    desc: "反映和衡量一个人健康状况的重要标志之一",
  },
  {
    title: 'BMI',
    color: "#ff4239",
    showCon: false,
    key: 'bmi',
    level: "bmilevel",
    dw: '',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: 'BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准。',
  }, {
    title: '脂肪率',
    showCon: false,
    color: "#ff4239",
    key: 'fat_r',
    level: "fat_rlevel",
    dw: '%',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '体脂率是指身体成分中，脂肪组织所占的比率。测量体脂率比单纯的只测量体重更能反映我们身体的脂肪水平（肥胖程度）。',
  },
  // 
  {
    title: '脂肪量',
    key: 'fat_w',
    color: "#ff4239",
    scope: '',
    showCon: false,
    level: "fat_wlevel",
    dw: 'kg',
    leftval: 0,
    desc: '人体脂肪的重量',
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '肌肉率',
    key: 'muscle',
    showCon: false,
    color: "#ff4239",
    level: "musclelevel",
    dw: '%',
    slist: [],
    leftval: 0,
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '根据人体肌肉总量和人体体重、身高等相结合得到的人体的一个比例值，这个值的范围决定一个人的身体健康状况以及力量的多少。',
  },
  {
    title: '肌肉量',
    color: "#ff4239",
    key: 'muscleval',
    level: "musclelevel",
    showCon: false,
    dw: 'kg',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '肌肉量=实际体重*肌肉率',
  },
  {
    title: '水分',
    key: 'water',
    color: "#ff4239",
    level: "waterlevel",
    showCon: false,
    dw: '%',
    desc: '指人体内水分比例。',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '蛋白量',
    color: "#ff4239",
    level: "proteinlevel",
    key: 'proteinval',
    showCon: false,
    dw: 'kg',
    desc: '蛋白量=实际体重*蛋白率',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '骨重',
    color: "#ff4239",
    key: 'bone',
    showCon: false,
    level: "bonelevel",
    dw: '',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '单位体积内，骨组织、骨矿物质（钙、磷等）和骨基质（骨胶原、蛋白率、无机盐等等）]含量，骨量代表它们骨骼健康的情况。',
  },
  {
    title: '蛋白率',
    color: "#ff4239",
    key: 'protein',
    level: "proteinlevel",
    showCon: false,
    dw: '%',
    desc: '人体内蛋白率含量。',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '基础代谢',
    key: 'kcal',
    color: "#ff4239",
    level: "kcallevel",
    showCon: false,
    dw: 'kcal',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '指人体在清醒而又极端安静的状态下，不受肌肉活动、环境温度、食物及精神紧张等影响时的能量代谢率',
  },
  // 

  {
    title: '内脏指数',
    color: "#ff4239",
    key: 'visceral',
    showCon: false,
    level: "viscerallevel",
    dw: '',
    desc: '内脏脂肪指数',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '皮下脂肪',
    key: 'sfr',
    color: "#ff4239",
    showCon: false,
    level: "sfrlevel",
    dw: '%',
    desc: '皮下脂脂肪就是贮存于皮下的脂肪组织，人体的脂肪大约有2/3贮存在皮下组织',
    slist: [],
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '肥胖等级',
    key: 'fatlevel',
    level: "fatlevel",
    showCon: false,
    leftval: 0,
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
    desc: '肥胖的程度,表现实际体重与理想体重的差距。肥胖等级是判定肥胖症的一个指标。',
  },
  // 
  {
    title: '去脂体重',
    key: 'lbm',
    showCon: false,
    dw: 'kg',
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '体龄',
    key: 'bodyage',
    showCon: false,
    dw: '岁',
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
  {
    title: '体型',
    key: 'body',
    level: "bodylevel",
    showCon: false,
    fvalue: null,
    svalue: null,
    fevaluation: null,
    sevaluation: null,
    vs: 0,
    num: 0,
  },
]

function infoList(str) {
  let listStr = [...data];
  let leftval = 0
  if (!str) return
  for (var i = 0; i < listStr.length; i++) {
    listStr[i].fvalue = str[listStr[i].key];
    listStr[i].fevaluation = str[listStr[i].level];
    if (str.list && str.list.length) {
      for (var k = 0; k < str.list.length; k++) {
        if (listStr[i].key == str.list[k].name) {
          listStr[i].slist = str.list[k].list
          listStr[i].color = str.list[k].color
          listStr[i].fvalue = str.list[k].value
          listStr[i].fevaluation = str.list[k].level
        }
      }
      for (let j in listStr[i].slist) {
        if (listStr[i].fevaluation == listStr[i].slist[j].text) {
          if (listStr[i].slist.length < 4) {
            listStr[i].leftval = (listStr[i].fvalue - listStr[i].slist[j].minvalue) / (listStr[i].slist[j]
              .maxvalue - listStr[i].slist[j].minvalue) * 6.5
          } else {
            listStr[i].leftval = (listStr[i].fvalue - listStr[i].slist[j].minvalue) / (listStr[i].slist[j]
              .maxvalue - listStr[i].slist[j].minvalue) * 4.2
          }

        }
      }
    } else {
      listStr[i].slist = null
    }
  }
  return listStr
}

export default {
  data,
  infoList,
}
