var $url="/cms/settings/settingsCreateTrigger",data=utils.init({siteId:utils.getQueryInt("siteId"),channels:[],filterText:"",editPanel:!1,editForm:null}),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.channel],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.put($url,this.editForm).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){var e=this;this.editForm={siteId:this.siteId,channelId:t.value,channelName:t.label,isCreateChannelIfContentChanged:t.isCreateChannelIfContentChanged,createChannelIdsIfContentChanged:t.createChannelIdsIfContentChanged},this.editPanel=!0,setTimeout(function(){e.$refs.channelsTree.setCheckedKeys(e.editForm.createChannelIdsIfContentChanged)},100)},handleTreeChanged:function(){this.editForm.createChannelIdsIfContentChanged=this.$refs.channelsTree.getCheckedKeys()},btnSubmitClick:function(){this.apiSubmit()}},$vue=new Vue({el:"#main",data:data,methods:methods,watch:{filterText:function(t){this.$refs.tree.filter({filterText:t})}},created:function(){this.apiList()}});