(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ce74f"],{6010:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Echart",{ref:"barChart",attrs:{id:t.id,options:t.options,height:t.height,width:t.width},on:{click:t.mapClick}})],1)},r=[],o=(n("d81d"),n("c740"),n("33de")),i={name:"mapechart",props:{id:{type:String,default:"barChartH"},width:{type:String,default:"100%"},height:{type:String,default:"100px"},cdata:{type:Array,default:function(){return[]}},organData:{type:Array,default:function(){return[]}}},data:function(){return{options:{}}},components:{Echart:o["a"]},watch:{cdata:{handler:function(t){this.resetOption(t,this.organData)},immediate:!0,deep:!0},organData:{handler:function(t){this.resetOption(this.cdata,t)},immediate:!0,deep:!0}},methods:{mapClick:function(t){this.$emit("click",t)},resetOption:function(t,e){var n=[],a=[];n=t.length>e.length?t.map((function(t){return t.year})):e.map((function(t){return t.year}));for(var r=function(r){var o={year:n[r],donoatenum:0,organnum:0},i=e.findIndex((function(t){return t.year==n[r]}));i>-1&&(o.organnum=e[i].num);var l=t.findIndex((function(t){return t.year==n[r]}));l>-1&&(o.donoatenum=t[l].num),"2019"==o.year?(o.donoatenum=239,o.organnum=720):"2020"==o.year?(o.donoatenum=281,o.organnum=884):"2021"==o.year&&(o.donoatenum=318,o.organnum=1103),a.push(o)},o=0;o<n.length;o++)r(o);this.options={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!0,top:"-2"},grid:{left:"6%",top:"26%",right:"4%",bottom:"0%",containLabel:!0},xAxis:{type:"category",data:n,axisLabel:{interval:0,color:"#fff",formatter:function(t){return t?t+"年":""}},axisLine:{lineStyle:{color:"#9cf1ff"}}},yAxis:{type:"value",axisLine:{show:!0,lineStyle:{color:"#07dbff",width:1,type:"solid"}},splitLine:{show:!0,lineStyle:{color:["rgba(7,219,255,0.5)"],type:"dashed"}},axisLabel:{color:"#fff"}},animationDurationUpdate:1e3,series:[{name:"历年捐献案例",type:"bar",data:a.map((function(t){return t.donoatenum})),universalTransition:!0,barWidth:"30%",itemStyle:{normal:{label:{show:!0,position:"top",textStyle:{color:"#07dbff"}},color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"#07dbff"},{offset:1,color:"#06455d"}]}}}},{name:"历年捐献器官",type:"line",data:a.map((function(t){return t.organnum})),universalTransition:!0,smooth:!1,itemStyle:{normal:{label:{show:!0,position:"top",textStyle:{color:"#fff"}}}}}]}},startInterval:function(){var t=this,e=2e3;null!==this.intervalId&&clearInterval(this.intervalId),this.intervalId=setInterval((function(){t.reSelectMapRandomArea()}),e)},reSelectMapRandomArea:function(){var t=this,e=9;this.$nextTick((function(){var n=t.$refs.mapChart.chart,a=Math.floor(Math.random()*e);while(a===t.preSelectMapIndex||a>=e)a=Math.floor(Math.random()*e);n.dispatchAction({type:"mapUnSelect",seriesIndex:0,dataIndex:t.preSelectMapIndex}),n.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:a}),n.dispatchAction({type:"mapSelect",seriesIndex:0,dataIndex:a}),t.preSelectMapIndex=a}))},handleMapRandomSelect:function(){var t=this;this.$nextTick((function(){var e=t.$refs.mapChart.chart,n=t;setTimeout((function(){n.reSelectMapRandomArea()}),0),e.on("mouseover",(function(t){clearInterval(n.intervalId),e.dispatchAction({type:"mapUnSelect",seriesIndex:0,dataIndex:n.preSelectMapIndex}),e.dispatchAction({type:"mapSelect",seriesIndex:0,dataIndex:t.dataIndex}),n.preSelectMapIndex=t.dataIndex})),e.on("globalout",(function(){n.reSelectMapRandomArea(),n.startInterval()})),t.startInterval()}))}}},l=i,d=n("2877"),c=Object(d["a"])(l,a,r,!1,null,null,null);e["default"]=c.exports}}]);