(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d225d87"],{e5ab:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-modal",{attrs:{title:e.title,width:800,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-row",{attrs:{gutter:{xs:8,sm:16,md:24,lg:32}}},[a("a-col",{attrs:{span:12}},[a("a-form-item",{staticStyle:{"margin-right":"-35px"},attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"模板CODE"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["templateCode",e.validatorRules.templateCode],expression:"['templateCode', validatorRules.templateCode ]"}],attrs:{disabled:e.disable,placeholder:"请输入模板编码"}})],1)],1),a("a-col",{attrs:{span:12}},[a("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"模板类型"}},[a("j-dict-select-tag",{directives:[{name:"decorator",rawName:"v-decorator",value:["templateType",e.validatorRules.templateType],expression:"['templateType', validatorRules.templateType ]"}],attrs:{triggerChange:!0,dictCode:"msgType",placeholder:"请选择模板类型"},on:{change:e.handleChangeTemplateType}})],1)],1)],1),a("a-row",{staticClass:"form-row",attrs:{gutter:24}},[a("a-col",{attrs:{span:24,pull:"2"}},[a("a-form-item",{staticStyle:{"margin-left":"-15px"},attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"模板标题"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["templateName",e.validatorRules.templateName],expression:"['templateName', validatorRules.templateName]"}],staticStyle:{width:"122%"},attrs:{placeholder:"请输入模板标题"}})],1)],1)],1),a("a-row",{staticClass:"form-row",attrs:{gutter:24}},[a("a-col",{attrs:{span:24,pull:"2"}},[a("a-form-item",{staticStyle:{"margin-left":"-15px"},attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"是否应用"}},[a("j-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["useStatus",e.validatorRules.useStatus],expression:"['useStatus', validatorRules.useStatus]"}],attrs:{options:["1","0"]}})],1)],1)],1),a("a-row",{staticClass:"form-row",attrs:{gutter:24}},[a("a-col",{attrs:{span:24,pull:"4"}},[a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:!e.useEditor,expression:"!useEditor"}],staticStyle:{"margin-left":"4px",width:"126%"},attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"模板内容"}},[a("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["templateContent",e.validatorRules.templateContent],expression:"['templateContent', validatorRules.templateContent ]"}],attrs:{placeholder:"请输入模板内容",autosize:{minRows:8,maxRows:8}}})],1)],1)],1),a("a-row",{staticClass:"form-row",attrs:{gutter:24}},[a("a-col",{attrs:{span:24,pull:"4"}},[a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.useEditor,expression:"useEditor"}],staticStyle:{"margin-left":"4px",width:"126%"},attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"模板内容"}},[a("j-editor",{model:{value:e.templateEditorContent,callback:function(t){e.templateEditorContent=t},expression:"templateEditorContent"}})],1)],1)],1)],1)],1)],1)},s=[],o=a("0fea"),r=a("88bc"),i=a.n(r),n=a("4ec3"),m=a("a061"),d=a("f92c"),p={name:"SysMessageTemplateModal",components:{JEditor:m["default"],JSwitch:d["default"]},data:function(){return{title:"操作",visible:!1,disable:!0,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{templateCode:{rules:[{required:!0,message:"请输入模板CODE!"},{validator:this.validateTemplateCode}]},templateName:{rules:[{required:!0,message:"请输入模板标题!"}]},templateContent:{rules:[]},useStatus:{rules:[]},templateType:{rules:[{required:!0,message:"请输入模板类型!"}]}},url:{add:"/sys/message/sysMessageTemplate/add",edit:"/sys/message/sysMessageTemplate/edit"},useEditor:!1,templateEditorContent:""}},created:function(){},methods:{add:function(){this.disable=!1,this.edit({})},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},e),this.useEditor=2==e.templateType||4==e.templateType,this.useEditor?this.templateEditorContent=e.templateContent:this.templateEditorContent="",this.visible=!0,this.$nextTick((function(){t.useEditor?t.form.setFieldsValue(i()(t.model,"useStatus","templateCode","templateName","templateTestJson","templateType")):t.form.setFieldsValue(i()(t.model,"useStatus","templateCode","templateContent","templateName","templateTestJson","templateType"))}))},close:function(){this.$emit("close"),this.visible=!1,this.disable=!0},handleOk:function(){var e=this;this.model.templateType=this.templateType;var t=this;this.form.validateFields((function(a,l){if(!a){t.confirmLoading=!0;var s="",r="";e.model.id?(s+=e.url.edit,r="put"):(s+=e.url.add,r="post");var i=Object.assign(e.model,l);e.useEditor&&(i.templateContent=e.templateEditorContent),Object(o["h"])(s,i,r).then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},validateTemplateCode:function(e,t,a){var l={tableName:"sys_sms_template",fieldName:"template_code",fieldVal:t,dataId:this.model.id};Object(n["o"])(l).then((function(e){e.success?a():a(e.message)}))},handleCancel:function(){this.close()},handleChangeTemplateType:function(e){this.useEditor=2==e||4==e}}},c=p,u=a("2877"),C=Object(u["a"])(c,l,s,!1,null,"27b39bd9",null);t["default"]=C.exports}}]);
|