var myChart51 = echarts.init(document.querySelector('.echart51'))
var option51 = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  grid: {
    top: 0,
    bottom: 0,
  },
  xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01],
    show: false,
    max: 100,
  },
  yAxis: {
    type: 'category',
    data: ['Brazil'],
    show: false,
  },
  series: [
    {
      name: '2011',
      type: 'bar',
      data: [100],
      showBackground: true,
      itemStyle: {
        color: '#269BFF',
        normal: {
          barBorderRadius: 10,
          color: '#269BFF',
        },
      },
      barWidth: '15',
    },
  ],
}
myChart51.setOption(option51)


var taskId2 = '236777353581166592';
var quotaCode2 = 'Q249968345167802368';
var url2 = 'https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=' + quotaCode2 + '&systemName=government';
var url3 = 'https://szzf.nbjs.gov.cn:8050/api/Rural_vitalization/GetProvincialBeautifulTown';
console.log(url2)
$.get(url2, function (data) {
  console.log("测试的data",data)
  //para_value1 
  //para_value2
  var d = unique(data.infoList);
  var mubiao2 = countTotal(d, 'targetValue');
  $("#Smubiao").html(mubiao2);
  $("#Smubiao2").html(mubiao2);
  //d.forEach(function (p) { return $("#tb_shengjishilimeilichengzhen").append('<tr><td>' + ningbo_allareas[p['areaCode']] + '</td><td>' + p['currentValue'] + '</td><td>2021年底</td><td>进行中</td></tr>'); })
});


$.post(url3, function (data) {
  console.log(data)
  var d = data.data;
  var nb_value1 = countTotal(d, 'para_value2');
  var nb_value2 = countTotal(d, 'para_value1');
  $("#Sshiji").html(nb_value1);
  $("#Sshiji2").html(nb_value2);
  d.forEach(function (p){ return $("#tb_shengjishilimeilichengzhen").append('<tr><td>' + p['area_name'] + '</td><td>' + p['para_value1'] + '</td><td>' + p['para_value2'] + '</td><td>2021年底</td><td>已完成</td></tr>'); })
})





/* 建设美丽城镇 */
var myChart52 = echarts.init(document.querySelector('.echart52'))
var option52 = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  grid: {
    top: 0,
    bottom: 0,
  },
  xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01],
    show: false,
    max: 100,
  },
  yAxis: {
    type: 'category',
    data: ['Brazil'],
    show: false,
  },
  series: [
    {
      name: '2011',
      type: 'bar',
      data: [18203],
      showBackground: true,
      itemStyle: {
        color: '#269BFF',
        normal: {
          barBorderRadius: 10,
          color: '#269BFF',
        },
      },
      barWidth: '15',
    },
  ],
}
myChart52.setOption(option52)

var quotaCode2 = 'Q249968345167802368'
var url2 =
  'https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=' +
  quotaCode2 +
  '&systemName=government'

/**
 * @表格数据来源
 */

// $.post(url2, function (data) {
//   var m = data
//   m.infoList.forEach(function (item) {
//     $('.chengzhen .flex .right tbody').append(
//       '<tr><td>' +
//         ningbo_allareas[item.areaCode] +
//         '</td><td>' +
//         item.targetValue +
//         '</td><td>2021年底</td><td>进行中</td></tr>'
//     )
//   })
// })
