Parcourir la source

修改环比值问题

lulihong il y a 6 ans
Parent
commit
5621b64df8
2 fichiers modifiés avec 13 ajouts et 4 suppressions
  1. 12 4
      page/bigData/component/disease-crowd.js
  2. 1 0
      page/bigData/js/home.js

+ 12 - 4
page/bigData/component/disease-crowd.js

@ -171,47 +171,55 @@
			},
			gxyformatData:function(data){//高血压数据
				var vm = this,idx;
				var huanBiIndex = 0;
				_.map(data[0].VIEW_13_0013,function(item,index){
					if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
						idx = index;
					}else if(item.firstColumn==vm.town){
						idx = index;
						huanBiIndex = 1;
					}
				})
				vm.data1 = {totalNumber:(data[0].VIEW_13_0013[idx]&&data[0].VIEW_13_0013[idx].HC_13_0021 || "--"),addNumber:(data[1].VIEW_13_0036[idx]&&data[1].VIEW_13_0036[idx].HC_13_0021 || "--"),ringRatio:(data[2].VIEW_13_0037[idx]&&data[2].VIEW_13_0037[idx].HC_13_0023 || "--")};
				vm.data1 = {totalNumber:(data[0].VIEW_13_0013[idx]&&data[0].VIEW_13_0013[idx].HC_13_0021 || "--"),addNumber:(data[1].VIEW_13_0036[idx]&&data[1].VIEW_13_0036[idx].HC_13_0021 || "--"),ringRatio:(data[2].VIEW_13_0037[huanBiIndex]&&data[2].VIEW_13_0037[huanBiIndex].HC_13_0023 || "--")};
			},
			tnbformatData:function(data){//糖尿病数据
				var vm = this,idx;
				var huanBiIndex = 0;
				_.map(data[0].VIEW_13_0026 || [],function(item,index){
					if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
						idx = index;
					}else if(item.firstColumn==vm.town){
						idx = index;
						huanBiIndex = 1;
					}
				})
				vm.data2 = {totalNumber:(data[0].VIEW_13_0026[idx]&&data[0].VIEW_13_0026[idx].HC_13_0017 || "--"),addNumber:(data[1].VIEW_13_0034[idx]&&data[1].VIEW_13_0034[idx].HC_13_0017 || "--"),ringRatio:(data[2].VIEW_13_0027[idx]&&data[2].VIEW_13_0027[idx].HC_13_0026 || "--")};
				vm.data2 = {totalNumber:(data[0].VIEW_13_0026[idx]&&data[0].VIEW_13_0026[idx].HC_13_0017 || "--"),addNumber:(data[1].VIEW_13_0034[idx]&&data[1].VIEW_13_0034[idx].HC_13_0017 || "--"),ringRatio:(data[2].VIEW_13_0027[huanBiIndex]&&data[2].VIEW_13_0027[huanBiIndex].HC_13_0026 || "--")};
			},
			ycfformatData:function(data){//孕产妇数据
				var vm = this,idx;
				var huanBiIndex = 0;
				_.map(data[0].VIEW_16_0009,function(item,index){
					if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
						idx = index;
					}else if(item.firstColumn==vm.town){
						idx = index;
						huanBiIndex = 1;
					}
				})
				vm.data3 = {totalNumber:(data[0].VIEW_16_0009[idx]&&data[0].VIEW_16_0009[idx].HC_13_0033 || "--"),addNumber:(data[1].VIEW_16_0010[idx]&&data[1].VIEW_16_0010[idx].HC_13_0033 || "--"),ringRatio:(data[2].VIEW_16_0011[idx]&&data[2].VIEW_16_0011[idx].HC_13_0035 || "--")};
				vm.data3 = {totalNumber:(data[0].VIEW_16_0009[idx]&&data[0].VIEW_16_0009[idx].HC_13_0033 || "--"),addNumber:(data[1].VIEW_16_0010[idx]&&data[1].VIEW_16_0010[idx].HC_13_0033 || "--"),ringRatio:(data[2].VIEW_16_0011[huanBiIndex]&&data[2].VIEW_16_0011[huanBiIndex].HC_13_0035 || "--")};
			},
			lnrformatData:function(data){//老年人数据
				var vm = this,idx;
				var huanBiIndex = 0;
				_.map(data[0].VIEW_15_0001,function(item,index){
					if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
						idx = index;
					}else if(item.firstColumn==vm.town){
						idx = index;
						huanBiIndex = 1;
					}
				})
				vm.data4 = {totalNumber:data[0].VIEW_15_0001[idx].HC_15_1006,addNumber:data[1].VIEW_15_0011[idx].HC_15_1006,ringRatio:(data[2].VIEW_15_0008[idx]&&data[2].VIEW_15_0008[idx].HC_15_1009 || "--")};
				vm.data4 = {totalNumber:data[0].VIEW_15_0001[idx].HC_15_1006,addNumber:data[1].VIEW_15_0011[idx].HC_15_1006,ringRatio:(data[2].VIEW_15_0008[huanBiIndex]&&data[2].VIEW_15_0008[huanBiIndex].HC_15_1009 || "--")};
			},
			diseaseClick:function(type){
				this.activeIndex = type;

+ 1 - 0
page/bigData/js/home.js

@ -96,6 +96,7 @@ new Vue({
    		httpRequest.getReqPromises(reqUrl).then(function(datas) {
    			vm.town = [{"name": "上饶市","id": "0"}].concat(datas[0]);
				echarts.registerMap('上饶',datas[1]);
				vm.diseaseData = [];
				vm.diseaseData.push(datas[2]);
				vm.diseaseData.push(datas[3]);
				vm.diseaseData.push(datas[4]);