(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2dae1426","chunk-2d0b723f"],{"1fc7":function(e,o,t){"use strict";t.r(o);var r=t("c0c3"),a=t("2dd7");o["default"]={name:"CreateForm",props:{typeOptions:{type:Array,required:!0}},components:{AntModal:a["a"]},data:function(){return{loading:!1,formTitle:"",form:{id:void 0,configName:void 0,configKey:void 0,configValue:void 0,configType:"Y",remark:void 0},open:!1,rules:{configName:[{required:!0,message:"参数名称不能为空",trigger:"blur"}],configKey:[{required:!0,message:"参数编码不能为空",trigger:"blur"},{validator:this.checkConfigKeyUnique}],configValue:[{required:!0,message:"参数值不能为空",trigger:"blur"}]}}},filters:{},created:function(){},computed:{},watch:{},methods:{cancel:function(){this.open=!1,this.$emit("close")},reset:function(){void 0!==this.$refs.form&&this.$refs.form.resetFields()},handleAdd:function(){this.open=!0,this.formTitle="添加参数"},handleUpdate:function(e,o){var t=this,a=e?e.id:o;Object(r["d"])(a).then((function(e){t.form=e.data,t.open=!0,t.formTitle="修改参数"}))},submitForm:function(){var e=this;this.$refs.form.validate((function(o){if(!o)return!1;void 0!==e.form.id?Object(r["h"])(e.form).then((function(o){e.$message.success("修改成功",3),e.open=!1,e.$emit("ok")})):Object(r["h"])(e.form).then((function(o){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok")}))}))},checkConfigKeyUnique:function(e,o,t){var a="参数编码已存在";if(""===o)t();else{var i={configKey:o,id:void 0!==this.form.id?this.form.id:""};Object(r["a"])(i).then((function(e){"1"===e.data.code?t():t(a)}))}}}}},5703:function(e,o,t){"use strict";t.r(o);var r=function(){var e=this,o=e._self._c;return o("a-drawer",{attrs:{width:"45%",title:e.formTitle,"label-col":4,"wrapper-col":14,visible:e.open,"body-style":{height:"calc(100vh - 100px)",overflow:"auto"}},on:{close:e.cancel}},[o("a-form-model",{ref:"form",attrs:{model:e.form,rules:e.rules,layout:"vertical"}},[o("a-form-model-item",{attrs:{label:"参数编码",prop:"configKey"}},[o("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.configKey,callback:function(o){e.$set(e.form,"configKey",o)},expression:"form.configKey"}})],1),o("a-form-model-item",{attrs:{label:"参数名称",prop:"configName"}},[o("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.configName,callback:function(o){e.$set(e.form,"configName",o)},expression:"form.configName"}})],1),o("a-form-model-item",{attrs:{label:"参数值",prop:"configValue"}},[o("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.configValue,callback:function(o){e.$set(e.form,"configValue",o)},expression:"form.configValue"}})],1),o("a-form-model-item",{attrs:{label:"是否内置参数",prop:"configType"}},[o("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.configType,callback:function(o){e.$set(e.form,"configType",o)},expression:"form.configType"}},e._l(e.typeOptions,(function(t,r){return o("a-radio-button",{key:r,attrs:{value:t.dictValue}},[e._v(e._s(t.dictLabel))])})),1)],1),o("a-form-model-item",{attrs:{label:"备注",prop:"remark"}},[o("a-input",{attrs:{placeholder:"请输入备注",type:"textarea","allow-clear":""},model:{value:e.form.remark,callback:function(o){e.$set(e.form,"remark",o)},expression:"form.remark"}})],1),o("div",{staticClass:"bottom-control"},[o("a-space",[o("a-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(" 保存 ")]),o("a-button",{on:{click:e.cancel}},[e._v(" 取消 ")])],1)],1)],1)],1)},a=[],i=t("5530"),n=t("1fc7"),c=Object(i["a"])({},n["default"]),l=c,f=t("2877"),s=Object(f["a"])(l,r,a,!1,null,null,null);o["default"]=s.exports}}]);