(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d217754"],{c78b:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"app-form margin-top"},[i("div",{staticClass:"app-form-group"},[i("div",{staticClass:"app-form-ti"},[t._v(t._s(t.id?"编辑消息":"添加消息"))]),i("form-generator",{ref:"basicForm",attrs:{"form-config":t.formConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:t.handleSubmit,cancel:t.handleCancel},model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1)]),i("copyright")],1)},n=[],o=i("7f70"),s={name:"SiteMessagePost",data:function(){return{loading:!1,id:"",formData:{title:"",content:""}}},computed:{formConfig:function(){return[{type:"input",label:"标题",prop:"title",placeholder:"请输入消息标题",required:!0,maxlength:100,width:"600px"},{type:"editor",label:"消息内容",prop:"content",required:!0,height:"400px"}]}},created:function(){this.id=this.$route.query.id||"",this.id&&this.getDetail()},methods:{getDetail:function(){var t=this;this.loading=!0,this.api.get("message/site/detail",{id:this.id}).then((function(e){t.loading=!1,1==e.code?t.formData={title:e.data.title||"",content:e.data.content||""}:t.$util.error(e.message)})).catch((function(){t.loading=!1}))},handleSubmit:function(t){var e=this,i=Object(o["a"])({},t);this.id&&(i.id=this.id),this.loading=!0,this.api.post("message/site/post",i).then((function(t){e.loading=!1,1==t.code?(e.$util.success(t.message),e.$router.back()):e.$util.error(t.message)})).catch((function(){e.loading=!1}))},handleCancel:function(){this.$router.back()}}},r=s,c=i("3d7a"),l=Object(c["a"])(r,a,n,!1,null,"1be7e158",null);e["default"]=l.exports}}]);