var $url="/write/select",$defaultWidth=160,data=utils.init({pageType:null,sites:null,root:null,siteId:0,channelIds:[]}),methods={apiGet:function(){var t=this;$api.get($url).then(function(i){var n=i.data;n.unauthorized?t.pageType="Unauthorized":(t.sites=n.sites,t.siteId=n.siteId,t.root=n.root)}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiSubmit:function(){var t=this;utils.loading(this,!0),$api.post($url,{siteId:this.siteId}).then(function(i){var n=i.data;t.channelIds=[],t.root=n.root}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},handleSiteIdChange:function(){this.apiSubmit(this.siteId)},btnAddClick:function(){0!=this.channelId&&(location.href=utils.getRootUrl("write/editor",{siteId:this.siteId,channelId:this.channelId}))},btnImportClick:function(){0!=this.channelId&&utils.openLayer({title:"批量导入Word",name:"Word",url:utils.getRootUrl("write/contentsLayerWord",{siteId:this.siteId,channelId:this.channelId}),full:!0})}},$vue=new Vue({el:"#main",data:data,methods:methods,computed:{channelId:function(){return 0===this.channelIds.length?0:this.channelIds[this.channelIds.length-1]}},created:function(){this.apiGet()}});