var $url="/settings/analysisSiteContent",now=new Date,data=utils.init({form:{siteId:utils.getQueryInt("siteId"),dateFrom:utils.getQueryString("dateFrom")||utils.formatDate(new Date(now.setMonth(now.getMonth()-1))),dateTo:utils.getQueryString("dateTo")||utils.formatDate(new Date)},sites:null,chartData:null,siteIds:[utils.getQueryInt("siteId")]}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.post($url,this.form).then(function(e){var a=e.data;t.sites=a.sites,t.chartData={labels:a.days,datasets:[{label:"新增内容数",backgroundColor:"#409EFF",data:a.addCount},{label:"修改内容数",backgroundColor:"#67C23A",data:a.editCount}]}}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},btnSearchClick(){var t=this.siteIds&&this.siteIds.length>0?this.siteIds[this.siteIds.length-1]:0;location.href="?dateFrom="+this.form.dateFrom+"&dateTo="+this.form.dateTo+"&siteId="+t}};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()}});