1 line
4.4 KiB
JavaScript
1 line
4.4 KiB
JavaScript
|
webpackJsonp([12],{"5nv+":function(e,t,a){var r=a("nYeb");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);a("rjj0")("a204b102",r,!0)},Ev5x:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bg mod-config"},[a("el-card",{staticClass:"box-card"},[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:"plcName"}},[a("el-input",{attrs:{placeholder:"设备名称",clearable:""},model:{value:e.dataForm.plcName,callback:function(t){e.$set(e.dataForm,"plcName",t)},expression:"dataForm.plcName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"设备型号",prop:"plcType"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择设备型号"},model:{value:e.dataForm.plcType,callback:function(t){e.$set(e.dataForm,"plcType",t)},expression:"dataForm.plcType"}},e._l(e.options,function(e){return a("el-option",{key:e,attrs:{label:e,value:e}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"IP",prop:"address"}},[a("el-input",{attrs:{placeholder:"IP",clearable:""},model:{value:e.dataForm.address,callback:function(t){e.$set(e.dataForm,"address",t)},expression:"dataForm.address"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"端口号",prop:"port"}},[a("el-input",{attrs:{placeholder:"端口号",clearable:""},model:{value:e.dataForm.port,callback:function(t){e.$set(e.dataForm,"port",t)},expression:"dataForm.port"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"读取频率",prop:"frequence"}},[a("el-select",{attrs:{placeholder:"请选择读取频率"},model:{value:e.dataForm.frequence,callback:function(t){e.$set(e.dataForm,"frequence",t)},expression:"dataForm.frequence"}},e._l(e.options1,function(e){return a("el-option",{key:e,attrs:{label:e,value:e}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"自动连接",prop:"autoConnect"}},[a("el-switch",{model:{value:e.dataForm.autoConnect,callback:function(t){e.$set(e.dataForm,"autoConnect",t)},expression:"dataForm.autoConnect"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"自动读取",prop:"autoRead"}},[a("el-switch",{model:{value:e.dataForm.autoRead,callback:function(t){e.$set(e.dataForm,"autoRead",t)},expression:"dataForm.autoRead"}})],1)],1),e._v(" "),a("span",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)],1)},staticRenderFns:[]};var o=a("VU/8")({data:function(){return{dataForm:{plcName:"",port:"",address:"",frequence:"",autoConnect:!0,autoRead:!0,plcType:""},options:[],options1:[],dataRule:{plcName:[{required:!0,message:"设备名称不能为空",trigger:"blur"}],port:[{required:!0,message:"端口号不能为空",trigger:"blur"}],address:[{required:!0,message:"IP不能为空",trigger:"blur"}],frequence:[{required:!0,message:"读取频率不能为空",trigger:"blur"}],plcType:[{required:!0,message:"设备型号不能为空",trigger:"change"}]}}},created:function(){this.init()},methods:{init:function(){var e=this;this.$http({url:this.$http.adornUrl("api/server/plcCreate/list-frequence"),method:"post"}).then(function(t){var a=t.data;a&&0===a.code&&(e.options1=a.data)}),this.$http({url:this.$http.adornUrl("api/server/plcCreate/list-siemensType"),method:"post"}).then(function(t){var a=t.data;a&&0===a.code&&(e.options=a.data)}),this.$nextTick(function(){e.$refs.dataForm.resetFields()})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&e.$http({url:e.$http.adornUrl("api/server/plcCreate/create-siemensPlc"),method:"post",data:e.$http.adornData(e.dataForm)}).then(function(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.init()}}):e.$message.error(a.msg)})})}}},r,!1,function(e){a("5nv+")},"data-v-ca2eef96",null);t.default=o.exports},nYe
|