var $url="/cms/settings/settingsCreateRuleLayerSet",data=utils.init({siteId:utils.getQueryInt("siteId"),isChannel:utils.getQueryBoolean("isChannel"),channelId:utils.getQueryInt("channelId"),form:{rule:utils.getQueryString("rule")},dict:null}),methods={apiConfig:function(){var t=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.siteId,isChannel:this.isChannel,channelId:this.channelId}}).then(function(e){var n=e.data;t.dict=n.value}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},copyToClipboard:function(t){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",t);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var e=document.createElement("textarea");e.textContent=t,e.style.position="fixed",document.body.appendChild(e),e.select();try{return document.execCommand("copy")}catch(t){return!1}finally{document.body.removeChild(e)}}},btnCopyClick:function(t){this.copyToClipboard(t)&&utils.success("文本复制成功!")},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(e){e&&(parent.$vue.setRuleText(t.form.rule,t.isChannel),utils.closeLayer())})},btnCancelClick:function(){utils.closeLayer()}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiConfig()}});