|
@ -31,24 +31,75 @@
|
|
|
data: function() {
|
|
|
return {
|
|
|
index1:0,
|
|
|
index2:0
|
|
|
index2:0,
|
|
|
gaoBingFaData:null
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {
|
|
|
var vm = this;
|
|
|
setTimeout(function(){
|
|
|
vm.gaoBingFaData = vm.data["本月高并发疾病"].全部.本月;
|
|
|
vm.initData();
|
|
|
},50)
|
|
|
},
|
|
|
watch:{
|
|
|
data:function(data){
|
|
|
this.data = data;
|
|
|
this.refreshData();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
btnClick1:function(idx){
|
|
|
this.index1 = idx;
|
|
|
this.refreshData();
|
|
|
},
|
|
|
btnClick2:function(idx){
|
|
|
this.index2 = idx;
|
|
|
this.refreshData();
|
|
|
},
|
|
|
refreshData:function(){
|
|
|
if(this.index1==0){//全部
|
|
|
if(this.index2==0){//本月
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].全部.本月;
|
|
|
}else if(this.index2==1){//本季
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].全部.本季;
|
|
|
}else if(this.index2==2){//本年
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].全部.本年;
|
|
|
}
|
|
|
}else if(this.index1==1){//住院
|
|
|
if(this.index2==0){//本月
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].住院[0].本月;
|
|
|
}else if(this.index2==1){//本季
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].住院[1].本季;
|
|
|
}else if(this.index2==2){//本年
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].住院[2].本年;
|
|
|
}
|
|
|
}else if(this.index1==2){//门诊
|
|
|
if(this.index2==0){//本月
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].门诊[0].本月;
|
|
|
}else if(this.index2==1){//本季
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].门诊[1].本季;
|
|
|
}else if(this.index2==2){//本年
|
|
|
this.gaoBingFaData = this.data["本月高并发疾病"].门诊[2].本年;
|
|
|
}
|
|
|
}
|
|
|
this.initData();
|
|
|
},
|
|
|
initData:function(){//高发疾病
|
|
|
var zhuYuanData = [],zhuYuanTitle = "";
|
|
|
var xAxisData = this.gaoBingFaData.xAxis[0].data;
|
|
|
var menZhenData = this.gaoBingFaData.series[0].data;
|
|
|
var menZhenTitle = this.gaoBingFaData.series[0].name;
|
|
|
if(this.index1==0){//全部,显示门诊/住院数据叠加
|
|
|
zhuYuanData = this.gaoBingFaData.series[1].data;
|
|
|
zhuYuanTitle = this.gaoBingFaData.series[1].name;
|
|
|
this.geoFaMainFun(xAxisData,menZhenData,zhuYuanData,menZhenTitle,zhuYuanTitle)
|
|
|
}
|
|
|
else if(this.index1==1 || this.index1==2){//住院或门诊时,显示单个柱状图
|
|
|
this.geoFaMainFun(xAxisData,menZhenData,zhuYuanData,menZhenTitle,zhuYuanTitle)
|
|
|
}
|
|
|
},
|
|
|
initData:function(){
|
|
|
//高发疾病
|
|
|
geoFaMainFun:function(xAxisData,menZhenData,zhuYuanData,menZhenTitle,zhuYuanTitle){
|
|
|
var gaoFaChart = echarts.init(document.getElementById('div-gaofa-disease-chart'));
|
|
|
var gaofaOption = {
|
|
|
"tooltip": {
|
|
@ -58,18 +109,7 @@
|
|
|
"yAxis": [{
|
|
|
"type": "category",
|
|
|
"name": "人次",
|
|
|
"data": [
|
|
|
"大肠杆菌性肠炎",
|
|
|
"感染性腹泻",
|
|
|
"胃肠炎",
|
|
|
"糖尿病",
|
|
|
"高血压病",
|
|
|
"脑结核瘤",
|
|
|
"骨结核",
|
|
|
"肾结核",
|
|
|
"心脏病",
|
|
|
"急性脑膜炎球菌血症"
|
|
|
],
|
|
|
"data": xAxisData,
|
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
|
},
|
|
@ -108,45 +148,48 @@
|
|
|
}],
|
|
|
"series": [{
|
|
|
"smooth": true,
|
|
|
"name": "住院情况",
|
|
|
"name": menZhenTitle,
|
|
|
"type": "bar",
|
|
|
stack: '高发疾病',
|
|
|
barWidth: 20,
|
|
|
"label": {
|
|
|
show: false,
|
|
|
position: "right"
|
|
|
show: true,
|
|
|
position: "right",
|
|
|
color: '#00e6f3'
|
|
|
},
|
|
|
"itemStyle": {
|
|
|
"normal": {
|
|
|
"lineStyle": {
|
|
|
"shadowColor": "rgba(0,0,0,0.4)"
|
|
|
},
|
|
|
color: '#6576e0'
|
|
|
color: '#00e6f3',
|
|
|
barBorderRadius: [0, 8, 8, 0],
|
|
|
}
|
|
|
},
|
|
|
"data": [
|
|
|
"100",
|
|
|
"2435",
|
|
|
"1102",
|
|
|
"544",
|
|
|
"520",
|
|
|
"446",
|
|
|
"408",
|
|
|
"315",
|
|
|
"225",
|
|
|
"101"
|
|
|
]
|
|
|
"data": menZhenData
|
|
|
},
|
|
|
{
|
|
|
]
|
|
|
}
|
|
|
if(zhuYuanData.length>0){
|
|
|
gaofaOption.series[0].label.show = false;
|
|
|
gaofaOption.series[0].itemStyle.normal.color = "#6576e0";
|
|
|
delete gaofaOption.series[0].itemStyle.normal.barBorderRadius;
|
|
|
gaofaOption.series[1] = {
|
|
|
"smooth": true,
|
|
|
"name": "门诊情况",
|
|
|
"name": zhuYuanTitle,
|
|
|
"type": "bar",
|
|
|
stack: '高发疾病',
|
|
|
"label": {
|
|
|
show: true,
|
|
|
position: "right",
|
|
|
formatter:function(param){
|
|
|
return "100+100";
|
|
|
var dataIndex = param.dataIndex,menZhenVal;
|
|
|
_.map(menZhenData,function(item,idx){
|
|
|
if(idx==dataIndex){
|
|
|
menZhenVal = item
|
|
|
}
|
|
|
})
|
|
|
return menZhenVal+"+"+param.value;
|
|
|
},
|
|
|
},
|
|
|
"itemStyle": {
|
|
@ -158,20 +201,13 @@
|
|
|
color: '#00e6f3'
|
|
|
}
|
|
|
},
|
|
|
"data": [
|
|
|
"200",
|
|
|
"3435",
|
|
|
"1302",
|
|
|
"684",
|
|
|
"600",
|
|
|
"546",
|
|
|
"521",
|
|
|
"463",
|
|
|
"325",
|
|
|
"301"
|
|
|
]
|
|
|
"data": zhuYuanData
|
|
|
}
|
|
|
]
|
|
|
}else{
|
|
|
gaofaOption.series = gaofaOption.series[0];
|
|
|
}
|
|
|
if(gaoFaChart){
|
|
|
gaoFaChart.clear();
|
|
|
}
|
|
|
gaoFaChart.setOption(gaofaOption);
|
|
|
}
|