(function(){ Vue.component('sign-progress-filter',{ template:'
', props:['chooseYear','analysisType', 'lowCode', 'analysisName'], data: function(){ return { years: [], } }, mounted: function(){ var now = new Date(), year = now.getFullYear(); if(now.getMonth() < 6){ year --; } for(i=year; i>=2016; i--){ this.years.push(i); } }, methods: { yearClick:function(val){ this.chooseYear = val; }, contentClick:function(type, lowCode, name){ this.analysisType = type; this.lowCode = lowCode; this.analysisName = name; }, resetClick:function(){ this.analysisType = 1; this.lowCode = ''; this.analysisName = '按任务'; this.chooseYear=this.years[0] }, confirmClick:function(){ var vm = this; //触发刷新 this.$emit('vuedals:close', { chooseYear: vm.chooseYear, id: vm.analysisType, lowCode: vm.lowCode, name: vm.analysisName }); }, } }); })()