| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6b7c3197"],{"63d3":function(t,e,r){},ab43:function(t,e,r){"use strict";var a=r("23e7"),s=r("d024");a({target:"Iterator",proto:!0,real:!0,forced:r("c430")},{map:s})},c18c:function(t,e,r){"use strict";r.r(e);r("e9f5"),r("ab43");var a=r("9ab4"),s=r("1b40"),o=r("4201"),i=r("f7b7");let n=class extends s.e{constructor(){super(...arguments),this.mode=o.g.ADD,this.identity=null,this.form={reply_type:1,name:"",content_type:1,content:"",status:1,keyword:"",matching_type:1,sort:"",reply_num:1},this.formRules={name:[{required:!0,message:"请输入规则名称",trigger:"blur"}],keyword:[{required:!0,message:"请输入关键词",trigger:"blur"}],sort:[{required:!0,message:"请输入排序值",trigger:"blur"},{type:"number",min:1,message:"请输入大于0的数字值",trigger:"blur"}],matching_type:[{required:!0,message:"请选择匹配方式",trigger:"change"}],content_type:[{required:!0,message:"请选择内容类型",trigger:"change"}],content:[{required:!0,message:"请输入回复内容",trigger:"blur"}]}}onSubmit(){this.$refs.formRef.validate(t=>{if(t)switch(this.mode){case o.g.ADD:return this.handleMpWeChatReplyAdd();case o.g.EDIT:return this.handleMpWeChatReplyEdit()}})}handleMpWeChatReplyAdd(){Object(i.f)(this.form).then(()=>{setTimeout(()=>this.$router.go(-1),500)}).catch(()=>{})}handleMpWeChatReplyEdit(){const t=this.form,e=this.identity;Object(i.i)({...t,id:e}).then(()=>{setTimeout(()=>this.$router.go(-1),500)}).catch(()=>{})}initMpWeChatReplyDetail(){Object(i.h)({id:this.identity}).then(t=>{Object.keys(t).map(e=>{this.$set(this.form,e,t[e])})}).catch(()=>{})}created(){const t=this.$route.query;t.mode&&(this.mode=t.mode),t.replyType&&(this.form.reply_type=1*t.replyType),this.mode===o.g.EDIT&&(this.identity=t.id,this.initMpWeChatReplyDetail())}};n=Object(a.a)([Object(s.a)({components:{}})],n);var l=n,c=(r("fee2"),r("2877")),u=Object(c.a)(l,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"user-tag-edit"},[e("div",{staticClass:"ls-card"},[1==t.form.reply_type?e("el-page-header",{attrs:{content:"add"===t.mode?"新增关注回复":"编辑关注回复"},on:{back:function(e){return t.$router.go(-1)}}}):t._e(),2==t.form.reply_type?e("el-page-header",{attrs:{content:"add"===t.mode?"新增关键字回复":"编辑关键字回复"},on:{back:function(e){return t.$router.go(-1)}}}):t._e(),3==t.form.reply_type?e("el-page-header",{attrs:{content:"add"===t.mode?"新增默认回复":"编辑默认回复"},on:{back:function(e){return t.$router.go(-1)}}}):t._e()],1),e("el-form",{ref:"formRef",attrs:{rules:t.formRules,model:t.form,"label-width":"120px",size:"small"}},[e("div",{staticClass:"ls-card m-t-16"},[e("div",{staticClass:"card-title"},[t._v("关注回复")]),e("div",{staticClass:"card-content m-t-24"},[e("el-form-item",{attrs:{label:"规则名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"请输入规则名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}}),e("div",{staticClass:"muted xs"},[t._v("方便通过名称管理关注回复内容")])],1),2==t.form.reply_type?e("el-form-item",{attrs:{label:"关键词",prop:"keyword"}},[e("el-input",{attrs:{placeholder:"请输入关键词"},model:{value:t.form.keyword,callback:function(e){t.$set(t.form,"keyword",e)},expression:"form.keyword"}})],1):t._e(),2==t.form.reply_type?e("el-form-item",{attrs:{label:"排序值",prop:"sort"}},[e("el-input",{attrs:{placeholder:"请输入排序值"},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort",t._n(e))},expression:"form.sort"}}),e("div",{staticClass:"muted xs"},[t._v("关键词排序值")])],1):t._e(),2==t.form.reply_type?e("el-form-item",{attrs:{label:"匹配方式",prop:"matching_type"}},[e("el-select",{staticClass:"ls-select",attrs:{placeholder:"请选择匹配方式"},model:{value:t.form.matching_type,callback:function(e){t.$set(t.form,"matching_type",e)},expression:"form.matching_type"}},[e("el-option",{attrs:{label:"全匹配",value:1}}),e("el-option",{attrs:{label:"模糊匹配",value:2}})],1),e("div",{staticClass:"muted xs"},[t._v("模糊匹配时,关键词部分匹配用户输入的内容即可")])],1):t._e(),e("el-form-item",{attrs:{label:"内容类型",prop:"content_type"}},[e("el-select",{staticClass:"ls-select",attrs:{placeholder:"请选择内容类型"},model:{value:t.form.content_type,callback:function(e){t.$set(t.form,"content_type",e)},expression:"form.content_type"}},[e("el-option",{attrs:{label:"文本",value:1}})],1),e("div",{staticClass:"muted xs"},[t._v("暂时支持文本类型")])],1),e("el-form-item",{attrs:{label:"回复内容",prop:"content"}},[e("el-input",{staticClass:"ls-input-textarea",attrs:{placeholder:"请输入回复内容",type:"textarea",rows:6},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),2==t.form.reply_type?e("el-form-item",{attrs:{label:"回复数量",prop:"reply_num",required:""}},[e("el-radio-group",{staticClass:"m-r-16",model:{value:t.form.reply_num,callback:function(e){t.$set(t.form,"reply_num",e)},expression:"form.reply_num"}},[e("el-radio",{staticClass:"m-r-16",attrs:{label:1}},[t._v("回复匹配首条")])],1),e("div",{staticClass:"muted xs m-r-16"},[t._v("设置关键词匹配多条时回复的数量,暂时支持回复一条内容")])],1):t._e(),e("el-form-item",{attrs:{label:"启用状态"}},[e("div",{staticClass:"flex"},[e("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":t.styleConfig.primary,"inactive-color":"#f4f4f5"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}}),e("span",{staticClass:"m-l-16"},[t._v(t._s(t.form.status?"开启":"关闭"))])],1)])],1)])]),e("div",{staticClass:"bg-white ls-fixed-footer"},[e("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[e("el-button",{attrs:{size:"small"},on:{click:function(e){return t.$router.go(-1)}}},[t._v("取消")]),e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.onSubmit()}}},[t._v("保存")])],1)])],1)}),[],!1,null,"3744f229",null);e.default=u.exports},d024:function(t,e,r){"use strict";var a=r("c65b"),s=r("59ed"),o=r("825a"),i=r("46c4"),n=r("c5cc"),l=r("9bdd"),c=n((function(){var t=this.iterator,e=o(a(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return o(this),s(t),new c(i(this),{mapper:t})}},f7b7:function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"e",(function(){return n})),r.d(e,"d",(function(){return l})),r.d(e,"f",(function(){return c})),r.d(e,"i",(function(){return u})),r.d(e,"h",(function(){return f})),r.d(e,"g",(function(){return m})),r.d(e,"j",(function(){return p})),r.d(e,"k",(function(){return d}));var a=r("f175");const s=()=>a.a.get("/wechat.official_account_setting/getConfig"),o=t=>a.a.post("/wechat.official_account_setting/setConfig",t),i=()=>a.a.get("/wechat.official_account_menu/detail"),n=t=>a.a.post("/wechat.official_account_menu/save",t),l=t=>a.a.post("/wechat.official_account_menu/saveAndPublish",t),c=t=>a.a.post("/wechat.official_account_reply/add",t),u=t=>a.a.post("/wechat.official_account_reply/edit",t),f=t=>a.a.get("/wechat.official_account_reply/detail",{params:t}),m=t=>a.a.post("/wechat.official_account_reply/delete",t),p=t=>a.a.get("/wechat.official_account_reply/lists",{params:t}),d=t=>a.a.post("/wechat.official_account_reply/status",t)},fee2:function(t,e,r){"use strict";r("63d3")}}]);
|