(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c7a92"],{5221:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"app-form margin-top"},[a("div",{staticClass:"app-form-group"},[a("div",{staticClass:"app-form-ti"},[t._v("编辑奖励")]),a("form-generator",{ref:"basicForm",attrs:{"form-config":t.formConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:t.handleBasicSubmit,cancel:t.handleCancel},scopedSlots:t._u([{key:"min",fn:function(e){e.form;return[a("el-form-item",{attrs:{label:"最小金额",prop:"min"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"number",min:0,step:.01,placeholder:"请输入最小金额"},model:{value:t.formData.min,callback:function(e){t.$set(t.formData,"min",e)},expression:"formData.min"}})],1)]}},{key:"max",fn:function(e){e.form;return[a("el-form-item",{attrs:{label:"最大金额",prop:"max"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"number",min:0,step:.01,placeholder:"请输入最大金额"},model:{value:t.formData.max,callback:function(e){t.$set(t.formData,"max",e)},expression:"formData.max"}})],1)]}}]),model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1)])])},r=[],o=(a("baf6"),{name:"CashlotteryAwardPost",data:function(){return{id:"",formData:{title:"",type:0,money:"",probability:"",min:"",max:"",sort:""}}},computed:{formConfig:function(){var t=[{type:"input",label:"标题",prop:"title",required:!0,width:"400px"},{type:"integer",label:"概率",prop:"probability",required:!0,width:"400px",tip:"抽奖概率值越大，中奖概率越大，概率分母是所有档位概率之和。"},{type:"radio",label:"类型",prop:"type",required:!0,width:"400px",options:[{label:"固定奖励",value:0},{label:"随机奖励",value:1}]},{type:"integer",label:"排序",prop:"sort",width:"400px"}];return 0==this.formData.type?t.splice(2,0,{type:"number",label:"奖励金额",prop:"money",required:!0,width:"400px"}):(t.splice(2,0,{type:"number",label:"最小金额",prop:"min",step:.01,required:!0,width:"400px",slot:"min"}),t.splice(3,0,{type:"number",label:"最大金额",prop:"max",required:!0,width:"400px",slot:"max"})),t}},created:function(){this.$route.params.id&&"0"!=this.$route.params.id&&(this.id=this.$route.params.id),this.id&&this.init()},methods:{init:function(){var t=this;this.api.get("cashlottery/reward/detail",{id:this.id}).then((function(e){1==e.code?t.formData=e.data:t.$util.error(e.message)}))},handleBasicSubmit:function(t){var e=this;this.id&&(t.id=this.id),this.api.post("cashlottery/reward/post",t).then((function(t){1==t.code?(e.$util.success(t.message),e.handleCancel()):e.$util.error(t.message)}))},handleCancel:function(){this.$router.back()}}}),n=o,s=a("3d7a"),l=Object(s["a"])(n,i,r,!1,null,"6ab44fb8",null);e["default"]=l.exports}}]);