123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- (function() {
- Vue.component('disease-crowd', {
- template: '<div v-if="data" class="left-panel-img">\
- <div class="div-disease-item" @click="diseaseClick(0)" :class="{active: activeIndex == 0}" @mouseout="diseaseMouseOut" @mouseover="diseaseMouseOver">\
- <h4 class="c-b5e1fc c-f16 c-t-center div-disease-title">高血压人群</h4>\
- <img src="../images/icon.png" class="icon-img" @click="detailClick(0)">\
- <div class="c-row">\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">总人数</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data1.totalNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">上月新增</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data1.addNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">环比</span>\
- </p>\
- <img v-if="data1.ringRatio<0" src="../images/xiajiang.png" class="zengzhang-img"/>\
- <img v-if="data1.ringRatio>=0" src="../images/zengzhang.png" class="zengzhang-img"/>\
- <span class="c-b5e1fc c-f26 ml20 c-bold">{{data1.ringRatio}}%</span>\
- </div>\
- </div>\
- </div>\
- </div>\
- <div class="div-disease-item mt10" @click="diseaseClick(1)" :class="{active: activeIndex == 1}" @mouseout="diseaseMouseOut" @mouseover="diseaseMouseOver">\
- <h4 class="c-b5e1fc c-f16 c-t-center div-disease-title">糖尿病人群</h4>\
- <img src="../images/icon.png" class="icon-img" @click="detailClick(1)">\
- <div class="c-row">\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">总人数</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data2.totalNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">上月新增</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data2.addNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">环比</span>\
- </p>\
- <img v-if="data2.ringRatio<0" src="../images/xiajiang.png" class="zengzhang-img"/>\
- <img v-if="data2.ringRatio>=0" src="../images/zengzhang.png" class="zengzhang-img"/>\
- <span class="c-b5e1fc c-f26 ml20 c-bold">{{data2.ringRatio}}%</span>\
- </div>\
- </div>\
- </div>\
- </div>\
- <div class="div-disease-item mt10" @click="diseaseClick(2)" :class="{active: activeIndex == 2}" @mouseout="diseaseMouseOut" @mouseover="diseaseMouseOver">\
- <h4 class="c-b5e1fc c-f16 c-t-center div-disease-title">孕产妇人群</h4>\
- <img src="../images/icon.png" class="icon-img" @click="detailClick(2)">\
- <div class="c-row">\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">总人数</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data3.totalNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">上月新增</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data3.addNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">环比</span>\
- </p>\
- <img v-if="data3.ringRatio<0" src="../images/xiajiang.png" class="zengzhang-img"/>\
- <img v-if="data3.ringRatio>=0" src="../images/zengzhang.png" class="zengzhang-img"/>\
- <span class="c-b5e1fc c-f26 ml20 c-bold">{{data3.ringRatio}}%</span>\
- </div>\
- </div>\
- </div>\
- </div>\
- <div class="div-disease-item mt10" @click="diseaseClick(3)" :class="{active: activeIndex == 3}" @mouseout="diseaseMouseOut" @mouseover="diseaseMouseOver">\
- <h4 class="c-b5e1fc c-f16 c-t-center div-disease-title">65岁以上老年人人数</h4>\
- <img src="../images/icon.png" class="icon-img" @click="detailClick(3)">\
- <div class="c-row">\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">总人数</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data4.totalNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">上月新增</span>\
- </p>\
- <span class="c-fff71a c-f26 c-bold">{{data4.addNumber}}</span>\
- <span class="c-b5e1fc c-f16">人</span>\
- </div>\
- </div>\
- <div class="c-33 bg-icon">\
- <div class="absolute-content">\
- <p class="c-b5e1fc c-f12">\
- <span class="c-b5e1fc c-f16">环比</span>\
- </p>\
- <img v-if="data4.ringRatio<0" src="../images/xiajiang.png" class="zengzhang-img"/>\
- <img v-if="data4.ringRatio>=0" src="../images/zengzhang.png" class="zengzhang-img"/>\
- <span class="c-b5e1fc c-f26 ml20 c-bold">{{data4.ringRatio}}%</span>\
- </div>\
- </div>\
- </div>\
- </div>\
- </div>',
- props: ["data","town"],
- data: function() {
- return {
- activeIndex:0,
- cacheActiveIndex:0,
- data1:{},//高血压
- data2:{},//糖尿病
- data3:{},//孕产妇人群
- data4:{},//65岁以上老年人人数
- }
- },
- mounted: function() {
-
- },
- filters:{
- formatData:function(value){
- return toThousands(value)
- }
- },
- methods: {
- initData:function(){
- var data1 = this.data[0].successFlg?this.data[0].detailModelList:[];
- var data2 = this.data[1].successFlg?this.data[1].detailModelList:[];
- var data3 = this.data[2].successFlg?this.data[2].detailModelList:[];
- var data4 = this.data[3].successFlg?this.data[3].detailModelList:[];
- this.gxyformatData(data1);
- this.tnbformatData(data2);
- this.ycfformatData(data3);
- this.lnrformatData(data4);
- },
- gxyformatData:function(data){//高血压数据
- var vm = this,idx;
- _.map(data[0].VIEW_13_0013,function(item,index){
- if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
- idx = index;
- }else if(item.firstColumn==vm.town){
- idx = index;
- }
- })
- 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 || "--")};
- },
- tnbformatData:function(data){//糖尿病数据
- var vm = this,idx;
- _.map(data[0].VIEW_13_0026 || [],function(item,index){
- if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
- idx = index;
- }else if(item.firstColumn==vm.town){
- idx = index;
- }
- })
- 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 || "--")};
- },
- ycfformatData:function(data){//孕产妇数据
- var vm = this,idx;
- _.map(data[0].VIEW_16_0009,function(item,index){
- if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
- idx = index;
- }else if(item.firstColumn==vm.town){
- idx = index;
- }
- })
- 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 || "--")};
- },
- lnrformatData:function(data){//老年人数据
- var vm = this,idx;
- _.map(data[0].VIEW_15_0001,function(item,index){
- if(vm.town=="上饶市" && item.firstColumn=="合计"){//上饶市
- idx = index;
- }else if(item.firstColumn==vm.town){
- idx = index;
- }
- })
- 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 || "--")};
- },
- diseaseClick:function(type){
- this.activeIndex = type;
- this.cacheActiveIndex = type;
- if($(event.target).hasClass("icon-img")){//点击图片,则不触发重新请求数据
- return false;
- }
- EventBus.$emit('refresh-json-data', {type:type});//触发首页重新请求数据方法
- },
- diseaseMouseOver:function(){
- this.activeIndex = null;
- },
- diseaseMouseOut:function(){
- this.activeIndex = this.cacheActiveIndex;
- },
- detailClick:function(type){//type:0高血压 1糖尿病,2孕产妇3老年人
- var height = (0.42 * window.screen.width) + 'px',url=httpRequest.alertUrl;
- if(type==0){
- url += '/page/bigData/html/alert1.html';
- }else if(type==1){
- url += '/page/bigData/html/alert2.html';
- }else if(type==2){
- url += '/page/bigData/html/alert3.html';
- }else if(type==3){
- url += '/page/bigData/html/alert4.html';
- }
- var width = (0.7604 * window.screen.width) + 'px';
- var height = (0.41875 * window.screen.width) + 'px';
- top.layer.open({
- id: 'LAY_layuipro', //设定一个id,防止重复弹出
- type: 2,
- title: false,
- closeBtn: 0,
- shade: 0.5,
- shadeClose: true,
- area: [width, height],
- content: url
- });
- }
- },
- watch:{
- data:function(data){
- if(data&&data.length>0){
- this.data = data;
- this.initData();
- }
- }
- }
-
- })
- })()
|