var $url="/settings/logsSite",data=utils.init({items:null,count:null,siteOptions:null,formInline:{siteIds:[],logType:"",dateFrom:"",dateTo:"",userName:"",keyword:"",currentPage:1,offset:0,limit:30}}),methods={apiGet:function(){var t=this;$api.post($url,this.formInline).then(function(i){var e=i.data;t.items=e.items,t.count=e.count,t.siteOptions=e.siteOptions}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiDelete:function(){var t=this;utils.loading(this,!0),$api.delete($url).then(function(i){i.data;t.items=[]}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},btnDeleteClick:function(){var t=this;utils.alertDelete({title:"清空站点日志",text:"此操作将会清空站点日志，且数据无法恢复，请谨慎操作！",callback:function(){t.apiDelete()}})},btnSearchClick(){var t=this;this.formInline.currentPage=1,this.formInline.offset=0,this.formInline.limit=30,this.formInline.siteIds=[];for(var i=this.$refs.sites.getCheckedNodes(),e=0;e<i.length;e++){var n=i[e];this.formInline.siteIds.push(n.value)}utils.loading(this,!0),$api.post($url,this.formInline).then(function(i){var e=i.data;t.items=e.items,t.count=e.count}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},btnAdminClick:function(t){utils.openLayer({title:"管理员查看",url:utils.getCommonUrl("adminLayerView",{userName:t}),full:!0})},handleCurrentChange:function(t){var i=this;this.formInline.currentValue=t,this.formInline.offset=this.formInline.limit*(t-1),this.formInline.siteIds=[];for(var e=this.$refs.sites.getCheckedNodes(),n=0;n<e.length;n++){var s=e[n];this.formInline.siteIds.push(s.value)}utils.loading(this,!0),$api.post($url,this.formInline).then(function(t){var e=t.data;i.items=e.items,i.count=e.count}).catch(function(t){utils.error(t)}).then(function(){utils.loading(i,!1)}),window.scrollTo(0,0)}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});