index.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. var symptomName = last_month_day();
  2. $(function(){
  3. init();
  4. init2();
  5. $("#el-dialog").addClass("hide");
  6. $(".close").click(function(event) {
  7. $("#el-dialog").addClass("hide");
  8. });
  9. var date = new Date();
  10. var numble = date.getDate();
  11. var today = getFormatMonth(new Date());
  12. $("#date1").html(today);
  13. $("#date2").html(today);
  14. $("#date3").html(today);
  15. $("#date4").html(today);
  16. lay('.demo-input').each(function(){
  17. laydate.render({
  18. type: 'month',
  19. elem: this,
  20. trigger: 'click',
  21. theme: '#95d7fb',
  22. calendar: true,
  23. showBottom: true,
  24. done: function () {
  25. console.log( $("#startDate").val())
  26. }
  27. })
  28. });
  29. })
  30. function init(){
  31. //地图
  32. var mapChart = echarts.init(document.getElementById('mapChart'));
  33. mapChart.setOption({
  34. bmap: {
  35. center: [118.096435,24.485408],
  36. zoom: 12,
  37. roam: true,
  38. },
  39. tooltip : {
  40. trigger: 'item',
  41. formatter:function(params, ticket, callback){
  42. return params.value[2]
  43. }
  44. },
  45. series: [{
  46. type: 'scatter',
  47. coordinateSystem: 'bmap',
  48. data: [
  49. [118.096435, 24.485408, '厦门市'] ,
  50. [118.094564, 24.457358, '厦门第一医院'] ,
  51. [118.104103, 24.477761, '厦门中山医院'],
  52. [118.14748, 24.506295, '厦门中医院'],
  53. [118.254841, 24.665349, '厦门第五医院'],
  54. ]
  55. }]
  56. });
  57. mapChart.on('click', function (params) {
  58. $("#el-dialog").removeClass('hide');
  59. $("#reportTitle").html(params.value[2]);
  60. });
  61. var bmap = mapChart.getModel().getComponent('bmap').getBMap()
  62. bmap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP ]}));
  63. bmap.setMapStyle({style:'midnight'})
  64. var pieChart1 = echarts.init(document.getElementById('pieChart1'));
  65. pieChart1.setOption({
  66. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  67. legend: {
  68. y : '260',
  69. x : 'center',
  70. textStyle : {
  71. color : '#ffffff',
  72. },
  73. data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
  74. },
  75. tooltip : {
  76. trigger: 'item',
  77. formatter: "{a}<br/>{b}<br/>{c}G ({d}%)"
  78. },
  79. calculable : false,
  80. series : [
  81. {
  82. name:'采集数据量',
  83. type:'pie',
  84. radius : ['40%', '70%'],
  85. center : ['50%', '45%'],
  86. itemStyle : {
  87. normal : {
  88. label : {
  89. show : false
  90. },
  91. labelLine : {
  92. show : false
  93. }
  94. },
  95. emphasis : {
  96. label : {
  97. show : true,
  98. position : 'center',
  99. textStyle : {
  100. fontSize : '20',
  101. fontWeight : 'bold'
  102. }
  103. }
  104. }
  105. },
  106. data:[
  107. {value:335, name:'厦门第一医院'},
  108. {value:310, name:'厦门中山医院'},
  109. {value:234, name:'厦门中医院'},
  110. {value:135, name:'厦门第五医院'}
  111. ]
  112. }
  113. ]
  114. });
  115. var lineChart = echarts.init(document.getElementById('lineChart'));
  116. lineChart.setOption({
  117. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  118. legend: {
  119. y : '260',
  120. x : 'center',
  121. textStyle : {
  122. color : '#ffffff',
  123. },
  124. data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
  125. },
  126. calculable : false,
  127. tooltip : {
  128. trigger: 'item',
  129. formatter: "{a}<br/>{b}<br/>{c}条"
  130. },
  131. yAxis: [
  132. {
  133. type: 'value',
  134. axisLine : {onZero: false},
  135. axisLine:{
  136. lineStyle:{
  137. color: '#034c6a'
  138. },
  139. },
  140. axisLabel: {
  141. textStyle: {
  142. color: '#fff'
  143. },
  144. formatter: function (value) {
  145. return value + "k条"
  146. },
  147. },
  148. splitLine:{
  149. lineStyle:{
  150. width:0,
  151. type:'solid'
  152. }
  153. }
  154. }
  155. ],
  156. xAxis: [
  157. {
  158. type: 'category',
  159. data : ['8:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00'],
  160. axisLine:{
  161. lineStyle:{
  162. color: '#034c6a'
  163. },
  164. },
  165. splitLine: {
  166. "show": false
  167. },
  168. axisLabel: {
  169. textStyle: {
  170. color: '#fff'
  171. },
  172. formatter: function (value) {
  173. return value + ""
  174. },
  175. },
  176. splitLine:{
  177. lineStyle:{
  178. width:0,
  179. type:'solid'
  180. }
  181. },
  182. }
  183. ],
  184. grid:{
  185. left: '5%',
  186. right: '5%',
  187. bottom: '20%',
  188. containLabel: true
  189. },
  190. series : [
  191. {
  192. name:'厦门第一医院',
  193. type:'line',
  194. smooth:true,
  195. itemStyle: {
  196. normal: {
  197. lineStyle: {
  198. shadowColor : 'rgba(0,0,0,0.4)'
  199. }
  200. }
  201. },
  202. data:[15, 0, 20, 45, 22.1, 25, 70, 55, 76]
  203. },
  204. {
  205. name:'厦门中山医院',
  206. type:'line',
  207. smooth:true,
  208. itemStyle: {
  209. normal: {
  210. lineStyle: {
  211. shadowColor : 'rgba(0,0,0,0.4)'
  212. }
  213. }
  214. },
  215. data:[25, 10, 30, 55, 32.1, 35, 80, 65, 76]
  216. },
  217. {
  218. name:'厦门中医院',
  219. type:'line',
  220. smooth:true,
  221. itemStyle: {
  222. normal: {
  223. lineStyle: {
  224. shadowColor : 'rgba(0,0,0,0.4)'
  225. }
  226. }
  227. },
  228. data:[35, 20, 40, 65, 42.1, 45, 90, 75, 96]
  229. },
  230. {
  231. name:'厦门第五医院',
  232. type:'line',
  233. smooth:true,
  234. itemStyle: {
  235. normal: {
  236. lineStyle: {
  237. shadowColor : 'rgba(0,0,0,0.4)'
  238. }
  239. }
  240. },
  241. data:[45, 30, 50, 75, 52.1, 55, 100, 85, 106]
  242. }
  243. ]
  244. });
  245. var histogramChart = echarts.init(document.getElementById('histogramChart'));
  246. histogramChart.setOption({
  247. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  248. legend: {
  249. y : '250',
  250. x : 'center',
  251. data:['厦门第一医院', '厦门中山医院','厦门中医院','厦门第五医院'],
  252. textStyle : {
  253. color : '#ffffff',
  254. }
  255. },
  256. calculable :false,
  257. grid:{
  258. left: '5%',
  259. right: '5%',
  260. bottom: '20%',
  261. containLabel: true
  262. },
  263. tooltip : {
  264. trigger: 'axis',
  265. axisPointer : {
  266. type : 'shadow'
  267. }
  268. },
  269. xAxis : [
  270. {
  271. type : 'value',
  272. axisLabel: {
  273. show: true,
  274. textStyle: {
  275. color: '#fff'
  276. }
  277. },
  278. splitLine:{
  279. lineStyle:{
  280. color:['#f2f2f2'],
  281. width:0,
  282. type:'solid'
  283. }
  284. }
  285. }
  286. ],
  287. yAxis : [
  288. {
  289. type : 'category',
  290. data:['门诊人数(人)', '住院人次(人)','人均费用(元)'],
  291. axisLabel: {
  292. show: true,
  293. textStyle: {
  294. color: '#fff'
  295. }
  296. },
  297. splitLine:{
  298. lineStyle:{
  299. width:0,
  300. type:'solid'
  301. }
  302. }
  303. }
  304. ],
  305. series : [
  306. {
  307. name:'厦门第一医院',
  308. type:'bar',
  309. stack: '总量',
  310. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  311. data:[320, 302, 301]
  312. },
  313. {
  314. name:'厦门中山医院',
  315. type:'bar',
  316. stack: '总量',
  317. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  318. data:[120, 132, 101]
  319. },
  320. {
  321. name:'厦门中医院',
  322. type:'bar',
  323. stack: '总量',
  324. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  325. data:[220, 182, 191]
  326. },
  327. {
  328. name:'厦门第五医院',
  329. type:'bar',
  330. stack: '总量',
  331. itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
  332. data:[150, 212, 201]
  333. }
  334. ]
  335. });
  336. var lineChart2 = echarts.init(document.getElementById('lineChart2'));
  337. lineChart2.setOption({
  338. color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
  339. legend: {
  340. y : '260',
  341. x : 'center',
  342. textStyle : {
  343. color : '#ffffff',
  344. },
  345. data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
  346. },
  347. calculable : false,
  348. tooltip : {
  349. trigger: 'item',
  350. formatter: "{a}<br/>{b}<br/>{c}条"
  351. },
  352. yAxis: [
  353. {
  354. type: 'value',
  355. axisLine : {onZero: false},
  356. axisLine:{
  357. lineStyle:{
  358. color: '#034c6a'
  359. },
  360. },
  361. axisLabel: {
  362. textStyle: {
  363. color: '#fff'
  364. },
  365. formatter: function (value) {
  366. return value + "k条"
  367. },
  368. },
  369. splitLine:{
  370. lineStyle:{
  371. width:0,
  372. type:'solid'
  373. }
  374. }
  375. }
  376. ],
  377. xAxis: [
  378. {
  379. type: 'category',
  380. data : ['8:00','10:00','12:00','14:00','16:00','18:00'],
  381. axisLine:{
  382. lineStyle:{
  383. color: '#034c6a'
  384. },
  385. },
  386. splitLine: {
  387. "show": false
  388. },
  389. axisLabel: {
  390. textStyle: {
  391. color: '#fff'
  392. },
  393. formatter: function (value) {
  394. return value + ""
  395. },
  396. },
  397. splitLine:{
  398. lineStyle:{
  399. width:0,
  400. type:'solid'
  401. }
  402. },
  403. }
  404. ],
  405. grid:{
  406. left: '5%',
  407. right: '5%',
  408. bottom: '20%',
  409. containLabel: true
  410. },
  411. series : [
  412. {
  413. name:'厦门第一医院',
  414. type:'line',
  415. smooth:true,
  416. itemStyle: {
  417. normal: {
  418. lineStyle: {
  419. shadowColor : 'rgba(0,0,0,0.4)'
  420. }
  421. }
  422. },
  423. data:[15, 0, 20, 45, 22.1, 25,].reverse()
  424. },
  425. {
  426. name:'厦门中山医院',
  427. type:'line',
  428. smooth:true,
  429. itemStyle: {
  430. normal: {
  431. lineStyle: {
  432. shadowColor : 'rgba(0,0,0,0.4)'
  433. }
  434. }
  435. },
  436. data:[25, 10, 30, 55, 32.1, 35, ].reverse()
  437. },
  438. {
  439. name:'厦门中医院',
  440. type:'line',
  441. smooth:true,
  442. itemStyle: {
  443. normal: {
  444. lineStyle: {
  445. shadowColor : 'rgba(0,0,0,0.4)'
  446. }
  447. }
  448. },
  449. data:[35, 20, 40, 65, 42.1, 45, ].reverse()
  450. },
  451. {
  452. name:'厦门第五医院',
  453. type:'line',
  454. smooth:true,
  455. itemStyle: {
  456. normal: {
  457. lineStyle: {
  458. shadowColor : 'rgba(0,0,0,0.4)'
  459. }
  460. }
  461. },
  462. data:[45, 30, 50, 75, 52.1, 55, 6].reverse()
  463. }
  464. ]
  465. });
  466. }
  467. function init2(){
  468. var lineChart3 = echarts.init(document.getElementById('lineChart3'));
  469. lineChart3.setOption({
  470. color:["#87cefa","#ff7f50",],
  471. legend: {
  472. y : 'top',
  473. x : 'center',
  474. textStyle : {
  475. color : '#ffffff',
  476. },
  477. data : ['门诊人次','住院人次'],
  478. },
  479. calculable : false,
  480. tooltip : {
  481. trigger: 'item',
  482. formatter: "{a}<br/>{b}<br/>{c}人"
  483. },
  484. dataZoom: {
  485. show: true,
  486. realtime : true,
  487. start: 0,
  488. end: 18,
  489. height: 20,
  490. backgroundColor: '#f8f8f8',
  491. dataBackgroundColor: '#e4e4e4',
  492. fillerColor: '#87cefa',
  493. handleColor: '#87cefa',
  494. },
  495. yAxis: [
  496. {
  497. type: 'value',
  498. axisLine : {onZero: false},
  499. axisLine:{
  500. lineStyle:{
  501. color: '#034c6a'
  502. },
  503. },
  504. axisLabel: {
  505. textStyle: {
  506. color: '#fff'
  507. },
  508. formatter: function (value) {
  509. return value + "人"
  510. },
  511. },
  512. splitLine:{
  513. lineStyle:{
  514. width:0,
  515. type:'solid'
  516. }
  517. }
  518. }
  519. ],
  520. xAxis: [
  521. {
  522. type: 'category',
  523. data : symptomName,
  524. boundaryGap : false,
  525. axisLine:{
  526. lineStyle:{
  527. color: '#034c6a'
  528. },
  529. },
  530. splitLine: {
  531. "show": false
  532. },
  533. axisLabel: {
  534. textStyle: {
  535. color: '#fff'
  536. },
  537. formatter: function (value) {
  538. return value + ""
  539. },
  540. },
  541. splitLine:{
  542. lineStyle:{
  543. width:0,
  544. type:'solid'
  545. }
  546. },
  547. }
  548. ],
  549. grid:{
  550. left: '5%',
  551. right: '5%',
  552. bottom: '20%',
  553. containLabel: true
  554. },
  555. series : [
  556. {
  557. name:'门诊费用',
  558. type:'line',
  559. smooth:true,
  560. itemStyle: {
  561. normal: {
  562. lineStyle: {
  563. shadowColor : 'rgba(0,0,0,0.4)'
  564. }
  565. }
  566. },
  567. data:[1150, 180, 2100, 2415, 1212.1, 3125,1510, 810, 2100, 2415, 1122.1, 3215,1510, 801, 2001, 2245, 1232.1, 3245,1520, 830, 2200, 2145, 1223.1, 3225,150, 80, 200, 245, 122.1, 325]
  568. },
  569. {
  570. name:'住院费用',
  571. type:'line',
  572. smooth:true,
  573. itemStyle: {
  574. normal: {
  575. lineStyle: {
  576. shadowColor : 'rgba(0,0,0,0.4)'
  577. }
  578. }
  579. },
  580. data:[2500, 1000, 3000, 5005, 3200.1, 3005, 2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005, 2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005,]
  581. },
  582. ]
  583. });
  584. var lineChart4 = echarts.init(document.getElementById('lineChart4'));
  585. lineChart4.setOption({
  586. color:["#87cefa","#ff7f50",],
  587. calculable : false,
  588. tooltip : {
  589. trigger: 'item',
  590. formatter: "{a}<br/>{b}<br/>{c}元"
  591. },
  592. dataZoom: {
  593. show: true,
  594. realtime : true,
  595. start: 0,
  596. end: 18,
  597. height: 20,
  598. backgroundColor: '#f8f8f8',
  599. dataBackgroundColor: '#e4e4e4',
  600. fillerColor: '#87cefa',
  601. handleColor: '#87cefa',
  602. },
  603. yAxis: [
  604. {
  605. type: 'value',
  606. axisLine : {onZero: false},
  607. axisLine:{
  608. lineStyle:{
  609. color: '#034c6a'
  610. },
  611. },
  612. axisLabel: {
  613. textStyle: {
  614. color: '#fff'
  615. },
  616. formatter: function (value) {
  617. return value + "元"
  618. },
  619. },
  620. splitLine:{
  621. lineStyle:{
  622. width:0,
  623. type:'solid'
  624. }
  625. }
  626. }
  627. ],
  628. xAxis: [
  629. {
  630. type: 'category',
  631. data : symptomName,
  632. boundaryGap : false,
  633. axisLine:{
  634. lineStyle:{
  635. color: '#034c6a'
  636. },
  637. },
  638. splitLine: {
  639. "show": false
  640. },
  641. axisLabel: {
  642. textStyle: {
  643. color: '#fff'
  644. },
  645. formatter: function (value) {
  646. return value + ""
  647. },
  648. },
  649. splitLine:{
  650. lineStyle:{
  651. width:0,
  652. type:'solid'
  653. }
  654. },
  655. }
  656. ],
  657. grid:{
  658. left: '5%',
  659. right: '5%',
  660. bottom: '20%',
  661. containLabel: true
  662. },
  663. series : [
  664. {
  665. name:'医疗费用',
  666. type:'line',
  667. smooth:true,
  668. itemStyle: {
  669. normal: {
  670. lineStyle: {
  671. shadowColor : 'rgba(0,0,0,0.4)'
  672. }
  673. }
  674. },
  675. data:[1500, 800, 1200, 2450, 1122.1, 1325,1150, 180, 1200, 1245, 1122.1, 1325,150, 180, 1200, 2145, 1212.1, 3215,1510, 180, 2100, 2415, 122.1, 325,150, 80, 200, 245, 122.1, 325].reverse()
  676. },
  677. ]
  678. });
  679. //年龄分布
  680. var pieChart2 = echarts.init(document.getElementById('pieChart2'));
  681. pieChart2.setOption({
  682. color:["#32cd32","#ff7f50","#87cefa","#FD6C88","#4b5cc4","#faff72"],
  683. tooltip : {
  684. trigger: 'item',
  685. formatter: "{a}<br/>{b}<br/>{c}人"
  686. },
  687. calculable : true,
  688. series : [
  689. {
  690. name:'发病人数',
  691. type:'pie',
  692. radius : [30, 110],
  693. center : ['50%', '50%'],
  694. roseType : 'area',
  695. x: '50%',
  696. sort : 'ascending',
  697. data:[
  698. {value:10, name:'婴儿(1-3岁)'},
  699. {value:5, name:'少儿(4-10岁)'},
  700. {value:15, name:'少年(10-18岁)'},
  701. {value:25, name:'青年(18-45岁)'},
  702. {value:125, name:'中年(45-60岁)'},
  703. {value:175, name:'老年(60岁以上)'},
  704. ]
  705. }
  706. ]
  707. })
  708. //医疗费用组成
  709. var pieChart3 = echarts.init(document.getElementById('pieChart3'));
  710. pieChart3.setOption({
  711. color:["#32cd32","#ff7f50","#87cefa","#FD6C88","#4b5cc4","#faff72"],
  712. tooltip : {
  713. trigger: 'item',
  714. formatter: "{a}<br/>{b}<br/>{c}元"
  715. },
  716. calculable : true,
  717. series : [
  718. {
  719. name:'发病人数',
  720. type:'pie',
  721. radius : [30, 110],
  722. center : ['50%', '50%'],
  723. roseType : 'area',
  724. x: '50%',
  725. sort : 'ascending',
  726. data:[
  727. {value:10, name:'诊察费用'},
  728. {value:500, name:'检查费用'},
  729. {value:150, name:'检验费用'},
  730. {value:250, name:'西药费用'},
  731. {value:125, name:'中药费用'},
  732. {value:1750, name:'手术费用'},
  733. ]
  734. }
  735. ]
  736. })
  737. }