var $url="/wx/reply",data=utils.init({success:!1,errorMessage:null,rules:null,count:null,multipleSelection:[],form:{siteId:utils.getQueryInt("siteId"),keyword:null,page:1,perPage:20}}),methods={apiGet:function(t){this.form.page=t;var e=this;utils.loading(this,!0),$api.get($url,{params:this.form}).then(function(t){var i=t.data;e.success=i.success,e.errorMessage=i.errorMessage,e.rules=i.rules,e.count=i.count}).catch(function(t){utils.error(t)}).then(function(){utils.loading(e,!1)})},apiDelete:function(t){var e=this;utils.loading(this,!0),$api.delete($url,{data:Object.assign({ruleId:t},this.form)}).then(function(t){var i=t.data;e.rules=i.rules,e.count=i.count}).catch(function(t){utils.error(t)}).then(function(){utils.loading(e,!1)})},btnSearchClick:function(){this.apiGet(1)},btnPageClick:function(t){this.apiGet(t)},btnEditClick:function(t){utils.addTab("编辑回复",utils.getWxUrl("replyAdd",{siteId:this.form.siteId,ruleId:t.id,tabName:utils.getTabName()}))},btnAddClick:function(){utils.addTab("添加回复",utils.getWxUrl("replyAdd",{siteId:this.form.siteId,tabName:utils.getTabName()}))},btnDeleteClick:function(t){var e=this;utils.alertDelete({title:"删除关键词回复",text:"此操作将删除关键词回复，确定吗？",callback:function(){e.apiDelete(t.id)}})},getMaterialType:function(t){return"Message"===t?"图文消息":"Image"===t?"图片":"Audio"===t?"音频":"Video"===t?"视频":"Text"===t?"文字":""},getKeywords:function(t){return t?t.map(function(t){return t.text}).join(", "):""},getMessages:function(t){var e=this;return t?t.map(function(t){return e.getMaterialType(t.materialType)}).join(", "):""}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet(1)}});