var $url="/cms/create/createSpecial",data=utils.init({siteId:utils.getQueryInt("siteId"),isAllChecked:!1,allSpecials:null,specials:null,checkedSpecialIds:[],filterText:""}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId}}).then(function(e){var i=e.data;t.allSpecials=t.specials=i.specials}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiCreate:function(){var t=this;utils.loading(this,!0),$api.post($url,{siteId:this.siteId,specialIds:this.checkedSpecialIds}).then(function(e){location.href=utils.getCmsUrl("createStatus",{siteId:t.siteId})}).catch(function(t){utils.error(t)})},filterNode:function(t,e){return!t||(!t.text||-1!==e.label.indexOf(t.text))},selectAll:function(t){this.checkedSpecialIds=t?_.map(this.specials,function(t){return t.id}):[]},btnCreateClick:function(){this.apiCreate()},getLabel:function(t){return t.title+"("+t.url.replace("@","")+")"},handleCheckedSpecialsChange:function(t){var e=t.length;this.isAllChecked=e===this.specials.length}},$vue=new Vue({el:"#main",data:data,methods:methods,watch:{filterText:function(t){this.specials=t?_.filter(this.allSpecials,function(e){return-1!==e.url.indexOf(t)}):this.allSpecials}},created:function(){this.apiGet()}});