qy-renren-qt/dist/2209300913/static/js/46.js

1 line
4.0 KiB
JavaScript
Raw Normal View History

2022-09-30 09:18:17 +08:00
webpackJsonp([46],{"MQn/":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,code:"SB"+(new Date).getTime(),name:"",alias:"",type:"",description:"",note:""},typeArr:[],dataRule:{code:[{required:!0,message:"编码,系统自动生成可修改不能为空",trigger:"blur"}],name:[{required:!0,message:"名称不能为空",trigger:"blur"}],type:[{required:!0,message:"设备类型,存储数据字典编码不能为空",trigger:"blur"}]}}},methods:{init:function(t){var e=this;this.dataForm.id=t||"",this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.id&&e.$http({url:e.$http.adornUrl("/work/mtequipmentinfo/info/"+e.dataForm.id),method:"get",params:e.$http.adornParams()}).then(function(t){var a=t.data;a&&0===a.code&&(e.dataForm=a.mtEquipmentInfo)}),e.$http({url:e.$http.adornUrl("/work/mtsysdictdata/list"),method:"get",params:e.$http.adornParams({page:1,limit:500,dictTypeId:1})}).then(function(t){var a=t.data;a&&0===a.code?e.typeArr=a.page.list:e.typeArr=[]})})},dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(e){e&&t.$http({url:t.$http.adornUrl("/work/mtequipmentinfo/"+(t.dataForm.id?"update":"save")),method:"post",data:t.$http.adornData({id:t.dataForm.id||void 0,code:t.dataForm.code,name:t.dataForm.name,alias:t.dataForm.alias,type:t.dataForm.type,description:t.dataForm.description,note:t.dataForm.note})}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}}):t.$message.error(a.msg)})})}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"编码",prop:"code"}},[a("el-input",{attrs:{placeholder:"编码,系统自动生成可修改",clearable:""},model:{value:t.dataForm.code,callback:function(e){t.$set(t.dataForm,"code",e)},expression:"dataForm.code"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"名称",clearable:""},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"别名",prop:"alias"}},[a("el-input",{attrs:{placeholder:"别名",clearable:""},model:{value:t.dataForm.alias,callback:function(e){t.$set(t.dataForm,"alias",e)},expression:"dataForm.alias"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"设备类型",prop:"type"}},[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"设备类型"},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.typeArr,function(t){return a("el-option",{key:t.id,attrs:{label:t.dataName,value:t.id}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"描述信息",prop:"description"}},[a("el-input",{attrs:{placeholder:"描述信息",clearable:""},model:{value:t.dataForm.description,callback:function(e){t.$set(t.dataForm,"description",e)},expression:"dataForm.description"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"note"}},[a("el-input",{attrs:{placeholder:"备注",clearable:""},model:{value:t.dataForm.note,callback:function(e){t.$set(t.dataForm,"note",e)},expression:"dataForm.note"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},staticRenderFns:[]},l=a("VU/8")(r,o,!1,null,null,null);e.default=l.exports}});