(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3103eea6"],{"298b":function(t,e,a){"use strict";a.r(e);var l=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("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.form,"label-position":"right","label-width":"200px"}},[a("div",{staticClass:"app-form-group margin-top"},[a("div",{staticClass:"app-form-ti"},[t._v("基础配置")]),a("div",{staticClass:"padding-top-lg"},[a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[a("el-radio",{attrs:{label:1}},[t._v("开启")]),a("el-radio",{attrs:{label:0}},[t._v("关闭")])],1)],1),a("el-form-item",{attrs:{label:"表单标题",prop:"title"}},[a("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"banner图",prop:"image"}},[a("uploadImage",{attrs:{modal:!1},model:{value:t.form.image,callback:function(e){t.$set(t.form,"image",e)},expression:"form.image"}})],1),a("el-form-item",{attrs:{label:"表单设置",prop:""}},[t._l(t.form.content,(function(e,l){return a("div",{staticClass:"flex align-center flex-wrap padding-bottom"},[a("el-input",{staticClass:"form-input",model:{value:e.label,callback:function(a){t.$set(e,"label",t._n(a))},expression:"item.label"}},[a("template",{slot:"prepend"},[t._v("字段名称")])],2),a("el-select",{staticClass:"form-input",attrs:{placeholder:"请选择"},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"item.type"}},[a("el-option",{attrs:{label:"文本",value:"text"}}),a("el-option",{attrs:{label:"数字",value:"number"}}),a("el-option",{attrs:{label:"图片",value:"image"}}),a("el-option",{attrs:{label:"多图",value:"images"}}),a("el-option",{attrs:{label:"多选",value:"select"}}),a("el-option",{attrs:{label:"单选",value:"radio"}}),a("el-option",{attrs:{label:"姓名",value:"realname"}}),a("el-option",{attrs:{label:"手机号",value:"mobile"}}),a("el-option",{attrs:{label:"身份证号",value:"idcard"}})],1),a("el-select",{staticClass:"form-input",attrs:{placeholder:"请选择"},model:{value:e.required,callback:function(a){t.$set(e,"required",a)},expression:"item.required"}},[a("el-option",{attrs:{label:"必填",value:!0}}),a("el-option",{attrs:{label:"选填",value:!1}})],1),a("el-input",{staticClass:"form-input",model:{value:e.tips,callback:function(a){t.$set(e,"tips",a)},expression:"item.tips"}},[a("template",{slot:"prepend"},[t._v("提示信息")])],2),"select"==e.type||"radio"==e.type?a("el-input",{staticClass:"form-input",attrs:{type:"text"},model:{value:e.options,callback:function(a){t.$set(e,"options",a)},expression:"item.options"}},[a("template",{slot:"prepend"},[t._v("选项(逗号隔开)")])],2):t._e(),a("el-button",{staticStyle:{"margin-left":"15px","margin-bottom":"15px"},attrs:{type:"danger",icon:"el-icon-delete"},on:{click:function(e){return t.delForm(l)}}})],1)})),a("div",{},[a("el-button",{attrs:{type:"success",size:"mini",icon:"el-icon-plus"},on:{click:t.addForm}},[t._v("添加")])],1)],2),a("el-form-item",{attrs:{label:"重复提交",prop:"is_repeat"}},[a("el-radio-group",{model:{value:t.form.is_repeat,callback:function(e){t.$set(t.form,"is_repeat",e)},expression:"form.is_repeat"}},[a("el-radio",{attrs:{label:1}},[t._v("开启")]),a("el-radio",{attrs:{label:0}},[t._v("关闭")])],1)],1)],1)]),a("div",{staticClass:"padding-lg flex justify-center"},[a("el-button",{on:{click:t.onBack}},[t._v("返回")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submit}},[t._v("提交")])],1)])],1),a("copyright")],1)},o=[],i=a("7f70"),s=(a("e8d6"),a("baf6"),a("c7f0")),r=a("8327"),n={name:"formPost",components:{uploadImage:s["a"]},data:function(){return{rules:{},form:{status:1,is_repeat:0,content:[{label:"",value:"",type:"text",tips:"",required:!1,options:""}],title:"",image:""}}},computed:Object(i["a"])({},Object(r["b"])(["config"])),mounted:function(){this.$route.params.id&&"0"!=this.$route.params.id&&(this.id=this.$route.params.id,this.init())},methods:{onBack:function(){this.$router.go(-1)},submit:function(){var t=this;this.$refs["dataForm"].validate((function(e){e&&t.api.post("form/form/post",t.form).then((function(e){1==e.code?(t.$util.success(e.message),t.onBack()):t.$util.error(e.message)}))}))},init:function(){var t=this;this.api.get("form/form/detail",{id:this.id}).then((function(e){1==e.code?t.form=e.data.info:t.$util.error(e.message)}))},addForm:function(){this.form.content.push({label:"",value:"",type:"text",tips:"",required:!1})},delForm:function(t){this.form.content.splice(t,1)}}},p=n,c=(a("bc5a"),a("3d7a")),u=Object(c["a"])(p,l,o,!1,null,null,null);e["default"]=u.exports},a9ad:function(t,e,a){},bc5a:function(t,e,a){"use strict";a("a9ad")}}]);