renew-progress-filter.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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==3}" @click="contentClick(3, \'65岁以上签约\')">\
  15. <a href="#" class="f-fs14">65岁以上签约</a>\
  16. </div>\
  17. <div class="div-btn c-33" :class="{\'active\': lowCode==1}" @click="contentClick(1, \'高血压\')">\
  18. <a href="#" class="f-fs14">高血压</a>\
  19. </div>\
  20. </div>\
  21. <div class="mt20 div-group-btn c-row ml40 mr10">\
  22. <div class="div-btn c-33" :class="{\'active\': lowCode==2}" @click="contentClick(2, \'糖尿病\')">\
  23. <a href="#" class="f-fs14">糖尿病</a>\
  24. </div>\
  25. </div>\
  26. </div>\
  27. <div id="footer">\
  28. <div class="c-row btn-wrap c-border-top fr">\
  29. <div class="div-foot-btn mr20" @click="resetClick">\
  30. <a href="#" class="c-666 f-fs16">重置</a>\
  31. </div>\
  32. <div class="div-foot-btn active" @click="confirmClick">\
  33. <a href="#" class="c-666 f-fs16">保存</a>\
  34. </div>\
  35. </div>\
  36. </div>\
  37. </div>',
  38. props:['chooseYear','analysisType', 'lowCode', 'analysisName'],
  39. data: function(){
  40. return {
  41. years: [],
  42. }
  43. },
  44. mounted: function(){
  45. var now = new Date(),
  46. year = now.getFullYear();
  47. if(now.getMonth() < 6){
  48. year --;
  49. }
  50. for(i=year; i>=2017; i--){
  51. this.years.push(i);
  52. }
  53. },
  54. methods: {
  55. yearClick:function(val){
  56. this.chooseYear = val;
  57. },
  58. contentClick:function(lowCode, name){
  59. this.lowCode = lowCode;
  60. this.analysisName = name;
  61. },
  62. resetClick:function(){
  63. this.lowCode = '';
  64. this.chooseYear=this.years[0]
  65. },
  66. confirmClick:function(){
  67. var vm = this;
  68. //触发刷新
  69. this.$emit('vuedals:close', {
  70. chooseYear: vm.chooseYear,
  71. lowCode: vm.lowCode,
  72. name: vm.analysisName
  73. });
  74. },
  75. }
  76. });
  77. })()