xgym_1.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*$(document).ready(function () {
  2. var obj = new Object();
  3. $.ajax({
  4. url : prefix + "/queryXinGuanJieZhongShuLiang",
  5. method : 'post',
  6. data : obj,
  7. success : function (e) {
  8. if(e.code == 0){
  9. jieZhongShuLiang(e);
  10. }
  11. }
  12. });
  13. });*/
  14. function jieZhongShuLiang(e){//疫苗接种数量统计
  15. var jieZhongShuLiang = e.jieZhongShuLiang;
  16. var jzAll = 0;
  17. for (var i = 0; i < jieZhongShuLiang.length; i++) {
  18. jzAll += jieZhongShuLiang[i].jzNumber;
  19. }
  20. var container = document.getElementById("ymjzsl");
  21. container.innerHTML = "";
  22. for (var i = 0; i < jieZhongShuLiang.length; i++) {
  23. var box = $("<div class=\"col-sm-3 padding-y-5 flex-c h-30 text-center\"></div>");
  24. $(container).append(box);
  25. var content = $("<div class=\"bg-blue\"></div>");
  26. box.append(content);
  27. content.append("<div class=\"chart-title-s\">"+jieZhongShuLiang[i].jdName.substr(0, 4)+"</div>");
  28. var chart = $("<div class=\"chart-container-s\"></div>");
  29. content.append(chart);
  30. content.append("<div class=\"chart-text c-blue\">"+jieZhongShuLiang[i].rkNumber+"</div>");
  31. content.append("<div class=\"chart-text c-white\">辖区居民总数</div>");
  32. content.append("<div class=\"chart-text c-blue\">"+jieZhongShuLiang[i].jzNumber+"</div>");
  33. content.append("<div class=\"chart-text c-white\">实际接种人数</div>");
  34. var myChart = echarts.init(chart[0]);
  35. myChart.on("click", function (e) {
  36. openDialog_jzsl(e.dataIndex);
  37. });
  38. var option;
  39. option = {
  40. tooltip: {
  41. trigger: 'item',
  42. position:'inside'
  43. },
  44. series: [
  45. {
  46. name: '占全区接种人数百分比',
  47. type: 'pie',
  48. radius: ['60%', '70%'],
  49. selectedOffset:0, //选中块的偏移量
  50. // emphasis: {
  51. // label: {
  52. // show: true,
  53. // fontSize: '15',
  54. // fontWeight: 'bold',
  55. // color:'83bff6'
  56. //
  57. // }
  58. // },
  59. labelLine: {
  60. show: false
  61. },
  62. data: [
  63. {
  64. value: jieZhongShuLiang[i].jzNumber,
  65. name: '本街道接种',
  66. itemStyle: {
  67. color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
  68. offset: 0,
  69. color: '#1270d9'
  70. }, {
  71. offset: 1,
  72. color: '#00ffeb'
  73. }]),
  74. },
  75. selected:true, //默认选中第一块
  76. label: {
  77. normal:{
  78. show: true,
  79. fontSize: '15',
  80. position: 'center',
  81. textStyle:{
  82. color:'#fff',
  83. fontWeight: 'bold',
  84. },
  85. formatter: '{d}%'
  86. }
  87. },
  88. },
  89. {
  90. value: (jzAll - jieZhongShuLiang[i].jzNumber),
  91. name: '其他街道接种',
  92. itemStyle: {
  93. color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
  94. offset: 0,
  95. color: '#ff8404'
  96. }, {
  97. offset: 1,
  98. color: '#ffd904'
  99. }]),
  100. },
  101. label:{
  102. show:false, //默认显示第一块
  103. }
  104. },
  105. ]
  106. }
  107. ]
  108. };
  109. option && myChart.setOption(option);
  110. }
  111. }
  112. function openDialog_jzsl(index) {//弹出对话框
  113. console.log(index+"=index")
  114. var url = prefix + "/xgym/jzsl/" + index;
  115. var title
  116. switch (index){
  117. case 0:
  118. title = '疫苗接种数量统计 - 已接种';
  119. break;
  120. case 1:
  121. title = '疫苗接种数量统计 - 未接种';
  122. break;
  123. }
  124. $.modal.openDetailFull(title, url, 1200);
  125. }