123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- (function() {
- Vue.component('device-banding', {
- template: '<div style="position:relative;height:100%;">\
- <div class="sk-spinner sk-spinner-chasing-dots" v-show="!isRequestEnd" style="top: 50%;left:50%;margin-left:-0.1rem;margin-top: -0.1rem;position:absolute;">\
- <div class="sk-dot1"></div>\
- <div class="sk-dot2"></div>\
- </div>\
- <div class="f-tac f-clb div-banding-content" v-show="isRequestEnd">\
- <div class="mt20 div-all-bang-count" v-show="isProduction==0">\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-yujing-name">预警人数(人)</div>\
- <div class="mr60 div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-yujing-count">{{allYJCount}}</div>\
- </div>\
- </div>\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-bangding-name">绑定人数(人)</div>\
- <div class="div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-banding-count">{{allBDCount}}</div>\
- </div>\
- </div>\
- </div>\
- <div class="mt20 div-gxy-bang-count" v-show="isProduction==1">\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-yujing-name">预警人数(人)</div>\
- <div class="mr60 div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-yujing-count">{{xyjYJCount}}</div>\
- </div>\
- </div>\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-bangding-name">绑定人数(人)</div>\
- <div class="div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-banding-count">{{xyjBDCount}}</div>\
- </div>\
- </div>\
- </div>\
- <div class="mt20 div-tnb-bang-count" v-show="isProduction==2">\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-yujing-name">预警人数(人)</div>\
- <div class="mr60 div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-yujing-count">{{xtyYJCount}}</div>\
- </div>\
- </div>\
- <div class="dis-inblock c-pr">\
- <div class="mt20 c-f14 c-B5E1FC div-bangding-name">绑定人数(人)</div>\
- <div class="div-renshu_img">\
- <div class="c-f30 c-B5E1FC div-banding-count">{{xtyBDCount}}</div>\
- </div>\
- </div>\
- </div>\
- </div>\
- </div>',
- props: [],
- data: function() {
- return {
- isProduction: 0,
- allYJCount: null,
- allBDCount: null,
- xtyYJCount: null,
- xtyBDCount: null,
- xyjYJCount: null,
- xyjBDCount: null,
- isRequestEnd: false
- }
- },
- methods: {
- changeProduction: function(num) {
- this.isProduction = num;
- }
- },
- mounted: function() {
- var _self = this;
- EventBus.$on('get-banding-info', function(arg) {
- var type = arg.type;
- if(type == "") { //全部
- _self.changeProduction(0);
- } else if(type == "1") { //血压计
- _self.changeProduction(1);
- } else if(type == "2") { //血糖仪
- _self.changeProduction(2);
- }
- });
- var url = "/svr-iot/wlyy/deviceBinding";
- var reqUrl = [{
- url: url,
- reqType: 'get',
- data: {
- type: ""
- }
- },
- {
- url: url,
- reqType: 'get',
- data: {
- type: "1"
- }
- },
- {
- url: url,
- reqType: 'get',
- data: {
- type: "2"
- }
- }
- ];
- httpRequest.getReqPromises(reqUrl).then(function(datas) {
- var allData = datas[0]; //全部tab数据
- var tangniaobingData = datas[1]; //糖尿病tab数据
- var gaoxueyaData = datas[2]; //高血压tab数据
- if(allData.status == 200) {
- var data = allData.data;
- _self.allYJCount = data[1].num;
- _self.allBDCount = data[0].num;
- }
- if(gaoxueyaData.status == 200) {
- var data = gaoxueyaData.data;
- _self.xyjYJCount = data[1].num;
- _self.xyjBDCount = data[0].num;
- }
- if(tangniaobingData.status == 200) {
- var data = tangniaobingData.data;
- _self.xtyYJCount = data[1].num;
- _self.xtyBDCount = data[0].num;
- }
- _self.isRequestEnd = true;
- })
- }
- })
- })()
|