var $url="/cms/contents/contentsLayerTranslate",data=utils.init({page:utils.getQueryInt("page"),siteId:utils.getQueryInt("siteId"),channelId:utils.getQueryInt("channelId"),channelContentIds:utils.getQueryString("channelContentIds"),contents:null,transSites:null,transChannels:null,form:{transSiteIds:null,transChannelIds:null}}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId,channelId:this.channelId,channelContentIds:this.channelContentIds}}).then(function(n){var e=n.data;t.contents=e.contents,t.transSites=e.transSites,t.form.transSiteIds=[t.siteId],t.apiGetOptions()}).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,channelId:this.channelId,channelContentIds:this.channelContentIds,transSiteId:this.form.transSiteIds[this.form.transSiteIds.length-1],transChannelId:this.form.transChannelIds[this.form.transChannelIds.length-1]}).then(function(n){n.data;parent.$vue.apiList(t.channelId,t.page,"内容转移成功!",!0),utils.closeLayer()}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiGetOptions:function(){var t=this;$api.post($url+"/actions/options",{siteId:this.siteId,channelId:this.channelId,transSiteId:this.form.transSiteIds[this.form.transSiteIds.length-1]}).then(function(n){var e=n.data;t.transChannels=[e.transChannels],t.form.transChannelIds=null}).catch(function(n){utils.loading(t,!1),utils.error(n)})},getContentUrl:function(t){return t.checked?utils.getRootUrl("redirect",{siteId:t.siteId,channelId:t.channelId,contentId:t.id}):$apiUrl+"/preview/"+t.siteId+"/"+t.channelId+"/"+t.id},handleTransSiteIdChange:function(){this.apiGetOptions()},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(n){n&&t.apiSubmit()})},btnCancelClick:function(){utils.closeLayer()}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});