var $url="/cms/channels/channelsTranslate",data=utils.init({siteId:utils.getQueryInt("siteId"),returnUrl:utils.getQueryString("returnUrl"),checkedChannelIds:utils.getQueryIntList("channelIds"),channels:null,expandedChannelIds:[],filterText:"",channelIds:utils.getQueryIntList("channelIds"),transSites:null,transChannels:null,translateTypes:null,form:{transSiteId:null,transChannelIds:null,translateType:"Content",isDeleteAfterTranslate:!1}}),methods={apiConfig:function(){var t=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId}}).then(function(n){var e=n.data;t.channels=[e.channels],t.transSites=e.transSites,t.translateTypes=e.translateTypes,t.expandedChannelIds=_.union([t.siteId],t.checkedChannelIds)}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiGetOptions:function(){var t=this;utils.loading(this,!0),$api.post($url+"/actions/options",{siteId:this.siteId,transSiteId:this.form.transSiteId}).then(function(n){var e=n.data;t.transChannels=[e.transChannels]}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiSubmit:function(t){var n=this;utils.loading(this,!0),$api.post($url,t).then(function(t){t.data;utils.success("批量复制成功！"),location.href=n.returnUrl}).catch(function(t){utils.error(t)}).then(function(){utils.loading(n,!1)})},getChannelUrl:function(t){return utils.getRootUrl("redirect",{siteId:this.siteId,channelId:t.value})},filterNode:function(t,n){return!t||(-1!==n.label.indexOf(t)||n.value+""===t)},handleTransSiteIdChange:function(){this.apiGetOptions()},handleCheckChange(){this.channelIds=this.$refs.tree.getCheckedKeys()},btnTranslateClick:function(){var t=this;this.$refs.form.validate(function(n){n&&t.apiSubmit({siteId:t.siteId,channelIds:t.channelIds,transSiteId:t.form.transSiteId,transChannelId:t.form.transChannelIds[t.form.transChannelIds.length-1],translateType:t.form.translateType,isDeleteAfterTranslate:t.form.isDeleteAfterTranslate})})},btnReturnClick:function(){location.href=this.returnUrl}},$vue=new Vue({el:"#main",data:data,methods:methods,watch:{filterText:function(t){this.$refs.tree.filter(t)}},created:function(){this.apiConfig()}});