var $url="/settings/analysisUser",now=new Date,data=utils.init({form:{dateFrom:utils.getQueryString("dateFrom")||utils.formatDate(new Date(now.setMonth(now.getMonth()-1))),dateTo:utils.getQueryString("dateTo")||utils.formatDate(new Date)},chartData:null}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.post($url,this.form).then(function(a){var e=a.data;t.chartData={labels:e.days,datasets:[{label:"用户注册数",backgroundColor:"#409EFF",data:e.registerCount},{label:"用户登录数",backgroundColor:"#67C23A",data:e.loginCount}]}}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},btnSearchClick(){location.href="?dateFrom="+this.form.dateFrom+"&dateTo="+this.form.dateTo}};Vue.component("line-chart",{extends:VueChartJs.Line,mounted:function(){this.renderChart(this.$root.chartData,{responsive:!0,maintainAspectRatio:!1,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}})}});var $vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});