var $url="/cms/settings/settingsCreateRule",data=utils.init({siteId:utils.getQueryInt("siteId"),channels:[],filterText:"",editPanel:!1,editForm:null,editLinkTypes:[],channelFilePathRule:null,contentFilePathRule:null}),methods={setRuleText:function(t,e){e?this.editForm.channelFilePathRule=t:this.editForm.contentFilePathRule=t},apiList:function(t){var e=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId}}).then(function(i){var n=i.data;e.channels=[n.channel],t&&utils.success(t)}).catch(function(t){utils.error(t)}).then(function(){utils.loading(e,!1)})},apiGet:function(t){var e=this;utils.loading(this,!0),$api.get($url+"/"+this.siteId+"/"+t).then(function(t){var i=t.data;e.editForm={siteId:e.siteId,channelId:i.channel.id,channelName:i.channel.channelName,linkUrl:i.channel.linkUrl,linkType:i.channel.linkType,filePath:i.filePath,channelFilePathRule:i.channelFilePathRule,contentFilePathRule:i.contentFilePathRule},e.editLinkTypes=i.linkTypes,e.editPanel=!0}).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(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},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)||utils.contains(e.filePath,t.filterText)||utils.contains(e.contentFilePathRule,t.filterText))},btnCancelClick:function(){this.editPanel=!1},btnEditClick:function(t){this.editIsEditor=!1,this.apiGet(t.value)},btnSetClick:function(t,e,i){var n=utils.getCmsUrl("settingsCreateRuleLayerSet",{siteId:this.siteId,isChannel:e,channelId:t,rule:i});utils.openLayer({title:"构造",url:n,width:800,height:500})},btnSubmitClick:function(){var t=this;this.$refs.editForm.validate(function(e){e&&t.apiSubmit()})}},$vue=new Vue({el:"#main",data:data,methods:methods,watch:{filterText:function(t){this.$refs.tree.filter({filterText:t})}},created:function(){this.apiList()}});