renew-progress-filter.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. (function(){
  2. Vue.component('renew-progress-filter',{
  3. template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
  4. <div class="mt10 ml10 filter-title">统计年份</div>\
  5. <div class="c-row ml40 mr10" id="signYear">\
  6. <div v-for="year in years" class="c-33 mt20" style="margin-left:0;margin-right:3%;" :class="{\'active\': year==chooseYear}" @click="yearClick(year)"><a>{{year}}</a></div>\
  7. </div>\
  8. <div class="ml10 filter-title mt20">统计维度</div>\
  9. <div class="div-content">\
  10. <div class="mt20 div-group-btn c-row ml40 mr10">\
  11. <div class="div-btn c-33" :class="{\'active\': lowCode==\'\'}" @click="contentClick(\'\', \'所有居民\')">\
  12. <a href="#" class="f-fs14">所有居民</a>\
  13. </div>\
  14. <div class="div-btn c-33" :class="{\'active\': lowCode==4}" @click="contentClick(4, \'十大人群签约\')">\
  15. <a href="#" class="f-fs14">十大人群签约</a>\
  16. </div>\
  17. </div>\
  18. <div class="mt20 div-group-btn c-row ml40 mr10">\
  19. <div class="div-btn c-33" :class="{\'active\': lowCode==3}" @click="contentClick(3, \'65岁以上签约\')">\
  20. <a href="#" class="f-fs14">65岁以上签约</a>\
  21. </div>\
  22. <div class="div-btn c-33" :class="{\'active\': lowCode==1}" @click="contentClick(1, \'高血压\')">\
  23. <a href="#" class="f-fs14">高血压</a>\
  24. </div>\
  25. <div class="div-btn c-33" :class="{\'active\': lowCode==2}" @click="contentClick(2, \'糖尿病\')">\
  26. <a href="#" class="f-fs14">糖尿病</a>\
  27. </div>\
  28. </div>\
  29. </div>\
  30. <div id="footer">\
  31. <div class="c-row btn-wrap c-border-top fr">\
  32. <div class="div-foot-btn mr20" @click="resetClick">\
  33. <a href="#" class="c-666 f-fs16">重置</a>\
  34. </div>\
  35. <div class="div-foot-btn active" @click="confirmClick">\
  36. <a href="#" class="c-666 f-fs16">保存</a>\
  37. </div>\
  38. </div>\
  39. </div>\
  40. </div>',
  41. props:['chooseYear','analysisType', 'lowCode', 'analysisName'],
  42. data: function(){
  43. return {
  44. years: [],
  45. }
  46. },
  47. mounted: function(){
  48. var now = new Date(),
  49. year = now.getFullYear();
  50. // if(now.getMonth() < 6){
  51. // year --;
  52. // }
  53. for(i=year; i>=2017; i--){
  54. this.years.push(i);
  55. }
  56. },
  57. methods: {
  58. yearClick:function(val){
  59. this.chooseYear = val;
  60. },
  61. contentClick:function(lowCode, name){
  62. this.lowCode = lowCode;
  63. this.analysisName = name;
  64. },
  65. resetClick:function(){
  66. this.lowCode = '';
  67. this.chooseYear=this.years[0]
  68. },
  69. confirmClick:function(){
  70. var vm = this;
  71. //触发刷新
  72. this.$emit('vuedals:close', {
  73. chooseYear: vm.chooseYear,
  74. lowCode: vm.lowCode,
  75. name: vm.analysisName
  76. });
  77. },
  78. }
  79. });
  80. })()