tizheng-info.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. (function(){
  2. Vue.component('tizheng-info', {
  3. template: '<div class="panel-box panel-box3">\
  4. <h4 class="c-b5e1fc c-f16 c-t-center">体征信息</h4>\
  5. <!--<div class="sub-title mt20">\
  6. <div class="pre-icon" :class="{active: selectedTab != 2}" @click="pre()"></div>\
  7. <div class="ui-grid tab-box">\
  8. <div class="ui-col-1 c-t-center">\
  9. <span class="data-tab c-f14" :class="{active: selectedTab == 2}" @click="chooseTab(2)">血压</span>\
  10. </div>\
  11. <div class="ui-col-1 c-t-center">\
  12. <span class="data-tab c-f14" :class="{active: selectedTab == 1}" @click="chooseTab(1)">血糖</span>\
  13. </div>\
  14. </div>\
  15. <div class="next-icon" :class="{active: selectedTab != 1}" @click="next()"></div>\
  16. </div>-->\
  17. <div class="ui-grid ui-grid-middle mt10">\
  18. <div class="ui-col-0 c-f14 c-b5e1fc mr30">指标</div>\
  19. <div v-show="selectedTab==2" class="ui-col-1">\
  20. <span class="zb-tab c-f12 active">舒张压</span>\
  21. <span class="zb-tab c-f12 active">收缩压</span>\
  22. </div>\
  23. <div v-show="selectedTab==1" class="ui-col-1 select-div">\
  24. <select class="zb-select" v-model="selectedXT">\
  25. <option v-for="zb in xtzb" :value="zb.value">{{zb.label}}</option>\
  26. </select>\
  27. </div>\
  28. </div>\
  29. <div class="mtb20 ui-grid ui-grid-middle">\
  30. <div class="ui-col-0 c-f14 c-b5e1fc mr30">周期</div>\
  31. <div class="ui-col-1">\
  32. <span class="date-tab c-f12" :class="{active: selectedDateType==1}" @click="changeDateType(1)">一周</span><!--\
  33. --><span class="date-tab c-f12" :class="{active: selectedDateType==2}" @click="changeDateType(2)">一月</span><!--\
  34. --><span class="date-tab c-f12" :class="{active: selectedDateType==3}" @click="changeDateType(3)">一年</span>\
  35. </div>\
  36. </div>\
  37. <div class="c-t-center c-f14 c-ff3803">偏高<span class="mlr30">{{total.high}}</span>次</div>\
  38. <div class="c-t-center c-f14 c-03d95d mt10">正常<span class="mlr30">{{total.normal}}</span>次</div>\
  39. <div class="c-t-center c-f14 c-fd9c0d mt10">偏低<span class="mlr30">{{total.low}}</span>次</div>\
  40. </div>',
  41. props: ['patient'],
  42. data: function() {
  43. return {
  44. selectedTab: 1, // 1-血糖, 2-血压
  45. xtzb: [{
  46. label: '早餐前',
  47. value: '1'
  48. },{
  49. label: '早餐后',
  50. value: '2'
  51. },{
  52. label: '午餐前',
  53. value: '3'
  54. },{
  55. label: '午餐后',
  56. value: '4'
  57. },{
  58. label: '晚餐前',
  59. value: '5'
  60. },{
  61. label: '晚餐后',
  62. value: '6'
  63. },{
  64. label: '睡前',
  65. value: '7'
  66. }],
  67. selectedXT: 1,
  68. selectedDateType: 1,
  69. total: {}
  70. }
  71. },
  72. computed: {
  73. },
  74. watch: {
  75. selectedXT: function(val) {
  76. EventBus.$emit("get-chart-data", {
  77. type: this.selectedTab,
  78. dateType: this.selectedDateType,
  79. gi_type: val
  80. });
  81. }
  82. },
  83. methods: {
  84. pre: function(){
  85. if(this.selectedTab == 2){
  86. return false;
  87. }
  88. this.selectedTab == 2;
  89. },
  90. next: function(){
  91. if(this.selectedTab == 1){
  92. return false;
  93. }
  94. this.selectedTab == 1;
  95. },
  96. chooseTab: function(str){
  97. this.selectedTab = str;
  98. },
  99. changeDateType: function(type){
  100. this.selectedDateType = type;
  101. EventBus.$emit("get-chart-data", {
  102. type: this.selectedTab,
  103. dateType: this.selectedDateType,
  104. gi_type: this.selectedTab == 2 ? 0 : this.selectedXT
  105. });
  106. }
  107. },
  108. mounted: function() {
  109. var vm = this;
  110. //初始化下拉列表
  111. // $('.zb-select').dropkick();
  112. initZBInfo(vm);
  113. },
  114. });
  115. function initZBInfo(vm){
  116. EventBus.$on('show-disease-zhibiao', function(arg){
  117. var type = arg.type; // 2-高血压, 1-糖尿病
  118. vm.selectedTab = type ;
  119. });
  120. EventBus.$on("get-zhibiao-count", function(arg){
  121. vm.total = arg.total;
  122. })
  123. }
  124. })()