var $url="/cms/settings/settingsCrossSiteTransChannels",data=utils.init({siteId:utils.getQueryInt("siteId"),channels:[],filterText:"",editPanel:!1,channelId:null,channelName:null,translates:[]}),methods={apiList:function(t){var e=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId}}).then(function(n){var i=n.data;e.channels=[i.channels],t&&utils.success(t)}).catch(function(t){utils.error(t)}).then(function(){utils.loading(e,!1)})},apiSubmit:function(){var t=this;utils.loading(this,!0),$api.post($url,{siteId:this.siteId,channelId:this.channelId,translates:this.translates}).then(function(e){e.data;t.editPanel=!1,t.apiList("跨站转发栏目设置成功!")}).catch(function(e){utils.loading(t,!1),utils.error(e)})},getChannelUrl:function(t){return utils.getRootUrl("redirect",{siteId:this.siteId,channelId:t.value})},filterNode:function(t,e){return!t||!t.filterText||(utils.contains(e.label,t.filterText)||utils.contains(e.indexName,t.filterText))},btnCancelClick:function(){this.editPanel=!1},btnEditClick:function(t){this.channelId=t.value,this.channelName=t.label,this.translates=t.translates,this.editPanel=!0},handleTreeChanged:function(){this.editForm.transChannelIds=this.$refs.channelsTree.getCheckedKeys()},btnSubmitClick:function(){this.apiSubmit()},btnTranslateAddClick:function(){utils.openLayer({title:"选择转移栏目",url:utils.getCmsUrl("editorLayerTranslate",{siteId:this.siteId,channelId:this.channelId}),width:620,height:400})},addTranslation:function(t,e,n,i){this.translates.push({siteId:this.siteId,channelId:this.channelId,targetSiteId:t,targetChannelId:e,translateType:n,summary:i})},handleTranslationClose:function(t){this.translates=_.remove(this.translates,function(e){return t!==e.summary})}},$vue=new Vue({el:"#main",data:data,methods:methods,watch:{filterText:function(t){this.$refs.tree.filter({filterText:t})}},created:function(){this.apiList()}});