high-incidence-disease.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. (function() {
  2. //<img src="../images/icon.png" class="icon-img">
  3. Vue.component('high-incidence-disease', {
  4. template: '<div style="height: 100%;">\
  5. <h4 class="c-b5e1fc c-f16 c-t-center div-common-title">本月高发疾病排行</h4>\
  6. <div data-toggle="buttons" class="btn-group">\
  7. <label class="btn btn-default" :class="{active: index1 == 0}" @click="btnClick1(0)">\
  8. <input type="radio">全部\
  9. </label>\
  10. <label class="btn btn-default" :class="{active: index1 == 1}" @click="btnClick1(1)">\
  11. <input type="radio">住院\
  12. </label>\
  13. <label class="btn btn-default" :class="{active: index1 == 2}" @click="btnClick1(2)">\
  14. <input type="radio">门诊\
  15. </label>\
  16. </div>\
  17. <div data-toggle="buttons" class="btn-group fr mr20" style="margin-left: 0;">\
  18. <label class="btn btn-default" :class="{active: index2 == 0}" @click="btnClick2(0)">\
  19. <input type="radio">本月\
  20. </label>\
  21. <label class="btn btn-default" :class="{active: index2 == 1}" @click="btnClick2(1)">\
  22. <input type="radio">本季\
  23. </label>\
  24. <label class="btn btn-default" :class="{active: index2 == 2}" @click="btnClick2(2)">\
  25. <input type="radio">本年\
  26. </label>\
  27. </div>\
  28. <div id="div-gaofa-disease-chart" class="ml30"></div>\
  29. </div>',
  30. props: ["data"],
  31. data: function() {
  32. return {
  33. index1:0,
  34. index2:0
  35. }
  36. },
  37. mounted: function() {
  38. var vm = this;
  39. setTimeout(function(){
  40. vm.initData();
  41. },50)
  42. },
  43. methods: {
  44. btnClick1:function(idx){
  45. this.index1 = idx;
  46. },
  47. btnClick2:function(idx){
  48. this.index2 = idx;
  49. },
  50. initData:function(){
  51. //高发疾病
  52. var gaoFaChart = echarts.init(document.getElementById('div-gaofa-disease-chart'));
  53. var gaofaOption = {
  54. "tooltip": {
  55. "trigger": "axis"
  56. },
  57. grid: {top: 40, bottom: 30, left: 80},
  58. "yAxis": [{
  59. "type": "category",
  60. "name": "人次",
  61. "data": [
  62. "大肠杆菌性肠炎",
  63. "感染性腹泻",
  64. "胃肠炎",
  65. "糖尿病",
  66. "高血压病",
  67. "脑结核瘤",
  68. "骨结核",
  69. "肾结核",
  70. "心脏病",
  71. "急性脑膜炎球菌血症"
  72. ],
  73. axisPointer: {
  74. type: 'shadow'
  75. },
  76. axisTick: {
  77. show: false
  78. },
  79. axisLine: {
  80. lineStyle: {
  81. color: '#095f8e'
  82. }
  83. },
  84. axisLabel: {
  85. color: '#b5e1fc'
  86. },
  87. nameTextStyle:{color: '#b5e1fc'}
  88. }],
  89. "xAxis": [{
  90. "type": "value",
  91. axisPointer: {
  92. type: 'shadow'
  93. },
  94. axisTick: {
  95. show: false
  96. },
  97. axisLine: {
  98. lineStyle: {
  99. color: '#095f8e'
  100. }
  101. },
  102. axisLabel: {
  103. color: '#fff'
  104. },
  105. splitLine: {
  106. show: false // 不显示坐标轴刻度
  107. }
  108. }],
  109. "series": [{
  110. "smooth": true,
  111. "name": "住院情况",
  112. "type": "bar",
  113. stack: '高发疾病',
  114. barWidth: 20,
  115. "label": {
  116. show: false,
  117. position: "right"
  118. },
  119. "itemStyle": {
  120. "normal": {
  121. "lineStyle": {
  122. "shadowColor": "rgba(0,0,0,0.4)"
  123. },
  124. color: '#6576e0'
  125. }
  126. },
  127. "data": [
  128. "100",
  129. "2435",
  130. "1102",
  131. "544",
  132. "520",
  133. "446",
  134. "408",
  135. "315",
  136. "225",
  137. "101"
  138. ]
  139. },
  140. {
  141. "smooth": true,
  142. "name": "门诊情况",
  143. "type": "bar",
  144. stack: '高发疾病',
  145. "label": {
  146. show: true,
  147. position: "right",
  148. formatter:function(param){
  149. return "100+100";
  150. },
  151. },
  152. "itemStyle": {
  153. "normal": {
  154. "lineStyle": {
  155. "shadowColor": "rgba(0,0,0,0.4)"
  156. },
  157. barBorderRadius: [0, 8, 8, 0],
  158. color: '#00e6f3'
  159. }
  160. },
  161. "data": [
  162. "200",
  163. "3435",
  164. "1302",
  165. "684",
  166. "600",
  167. "546",
  168. "521",
  169. "463",
  170. "325",
  171. "301"
  172. ]
  173. }
  174. ]
  175. }
  176. gaoFaChart.setOption(gaofaOption);
  177. }
  178. },
  179. })
  180. })()