webpackJsonp([51],{YPGx:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,name:"",type:"",code:"",value:"",orderNum:0,remark:""},dataRule:{name:[{required:!0,message:"必填项不能为空",trigger:"blur"}],type:[{required:!0,message:"必填项不能为空",trigger:"blur"}],code:[{required:!0,message:"必填项不能为空",trigger:"blur"}],value:[{required:!0,message:"必填项不能为空",trigger:"blur"}]}}},methods:{init:function(){var e=this;this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.id&&e.getDictInfo()})},getDictInfo:function(){var e=this;this.$http.get(window.SITE_CONFIG.baseURL+"/sys/dict/info/"+this.dataForm.id).then(function(t){t&&0===t.code&&(e.dataForm.name=t.dict.name,e.dataForm.type=t.dict.type,e.dataForm.code=t.dict.code,e.dataForm.value=t.dict.value,e.dataForm.orderNum=t.dict.orderNum,e.dataForm.remark=t.dict.remark)})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&e.$http.post(window.SITE_CONFIG.baseURL+"/sys/dict/"+(e.dataForm.id?"update":"save"),{id:e.dataForm.id||void 0,name:e.dataForm.name,type:e.dataForm.type,code:e.dataForm.code,value:e.dataForm.value,orderNum:e.dataForm.orderNum,remark:e.dataForm.remark}).then(function(t){t&&0===t.code&&e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}})})})}}},o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"80px"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"字典名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"字典名称"},model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name",t)},expression:"dataForm.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"字典类型",prop:"type"}},[a("el-input",{attrs:{placeholder:"字典类型"},model:{value:e.dataForm.type,callback:function(t){e.$set(e.dataForm,"type",t)},expression:"dataForm.type"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"字典码",prop:"code"}},[a("el-input",{attrs:{placeholder:"字典码"},model:{value:e.dataForm.code,callback:function(t){e.$set(e.dataForm,"code",t)},expression:"dataForm.code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"字典值",prop:"value"}},[a("el-input",{attrs:{placeholder:"字典值"},model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"排序号",prop:"orderNum"}},[a("el-input-number",{attrs:{"controls-position":"right",min:0,label:"排序号"},model:{value:e.dataForm.orderNum,callback:function(t){e.$set(e.dataForm,"orderNum",t)},expression:"dataForm.orderNum"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{placeholder:"备注"},model:{value:e.dataForm.remark,callback:function(t){e.$set(e.dataForm,"remark",t)},expression:"dataForm.remark"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},i=a("C7Lr")(r,o,!1,null,null,null);t.default=i.exports}});