1 line
2.9 KiB
JavaScript
1 line
2.9 KiB
JavaScript
webpackJsonp([43],{"3Jec":function(a,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,dictTypeId:"",typeCode:"",dataCode:"",dataName:"",remark:""},dataRule:{dataCode:[{required:!0,message:"字典编码不能为空",trigger:"blur"}],dataName:[{required:!0,message:"字典名称不能为空",trigger:"blur"}]}}},methods:{init:function(a,t,e){var r=this;this.dataForm.id=a||"",this.dataForm.dictTypeId=t,this.dataForm.typeCode=e,this.visible=!0,this.$nextTick(function(){r.$refs.dataForm.resetFields(),r.dataForm.id&&r.$http({url:r.$http.adornUrl("/work/mtsysdictdata/info/"+r.dataForm.id),method:"get",params:r.$http.adornParams()}).then(function(a){var t=a.data;t&&0===t.code&&(r.dataForm=t.mtSysDictData)})})},dataFormSubmit:function(){var a=this;this.$refs.dataForm.validate(function(t){t&&a.$http({url:a.$http.adornUrl("/work/mtsysdictdata/"+(a.dataForm.id?"update":"save")),method:"post",data:a.$http.adornData({id:a.dataForm.id||void 0,dictTypeId:a.dataForm.dictTypeId,typeCode:a.dataForm.typeCode,dataCode:a.dataForm.dataCode,dataName:a.dataForm.dataName,remark:a.dataForm.remark})}).then(function(t){var e=t.data;e&&0===e.code?a.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){a.visible=!1,a.$emit("refreshDataList")}}):a.$message.error(e.msg)})})}}},d={render:function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("el-dialog",{attrs:{title:a.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:a.visible},on:{"update:visible":function(t){a.visible=t}}},[e("el-form",{ref:"dataForm",attrs:{model:a.dataForm,rules:a.dataRule,"label-width":"80px"},nativeOn:{keyup:function(t){if(!("button"in t)&&a._k(t.keyCode,"enter",13,t.key,"Enter"))return null;a.dataFormSubmit()}}},[e("el-form-item",{attrs:{label:"字典编码",prop:"dataCode"}},[e("el-input",{attrs:{placeholder:"字典编码",clearable:""},model:{value:a.dataForm.dataCode,callback:function(t){a.$set(a.dataForm,"dataCode",t)},expression:"dataForm.dataCode"}})],1),a._v(" "),e("el-form-item",{attrs:{label:"字典名称",prop:"dataName"}},[e("el-input",{attrs:{placeholder:"字典名称",clearable:""},model:{value:a.dataForm.dataName,callback:function(t){a.$set(a.dataForm,"dataName",t)},expression:"dataForm.dataName"}})],1),a._v(" "),e("el-form-item",{attrs:{label:"备注",prop:"remark"}},[e("el-input",{attrs:{placeholder:"备注",clearable:""},model:{value:a.dataForm.remark,callback:function(t){a.$set(a.dataForm,"remark",t)},expression:"dataForm.remark"}})],1)],1),a._v(" "),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(t){a.visible=!1}}},[a._v("取消")]),a._v(" "),e("el-button",{attrs:{type:"primary"},on:{click:function(t){a.dataFormSubmit()}}},[a._v("确定")])],1)],1)},staticRenderFns:[]},o=e("VU/8")(r,d,!1,null,null,null);t.default=o.exports}}); |