PLC-read/dist/20490957/static/js/14.js
2023-12-18 09:42:27 +08:00

1 line
4.6 KiB
JavaScript

webpackJsonp([14],{"4p2+":function(t,a,e){var r=e("gV7b");"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);e("rjj0")("51a234aa",r,!0)},gV7b:function(t,a,e){(t.exports=e("FZ+f")(!1)).push([t.i,"\n.box-card[data-v-329128c5] {\n width: 480px;\n height: 540px;\n position: absolute;\n /* 水平垂直居中 */\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n}\n.bg[data-v-329128c5] {\n background-image: url("+e("1JAX")+");\n background-size: cover;\n position: relative;\n}\n",""])},ibYb:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"bg mod-config"},[e("el-card",{staticClass:"box-card"},[e("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"},nativeOn:{keyup:function(a){if(!("button"in a)&&t._k(a.keyCode,"enter",13,a.key,"Enter"))return null;t.dataFormSubmit()}}},[e("el-form-item",{attrs:{label:"设备名称",prop:"plcName"}},[e("el-input",{attrs:{placeholder:"设备名称",clearable:""},model:{value:t.dataForm.plcName,callback:function(a){t.$set(t.dataForm,"plcName",a)},expression:"dataForm.plcName"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"IP",prop:"address"}},[e("el-input",{attrs:{placeholder:"IP",clearable:""},model:{value:t.dataForm.address,callback:function(a){t.$set(t.dataForm,"address",a)},expression:"dataForm.address"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"端口号",prop:"port"}},[e("el-input",{attrs:{placeholder:"端口号",clearable:""},model:{value:t.dataForm.port,callback:function(a){t.$set(t.dataForm,"port",a)},expression:"dataForm.port"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"站号",prop:"station"}},[e("el-input",{attrs:{placeholder:"站号",clearable:""},model:{value:t.dataForm.station,callback:function(a){t.$set(t.dataForm,"station",a)},expression:"dataForm.station"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"读取格式",prop:"dataFormat"}},[e("el-select",{attrs:{placeholder:"请选择读取格式"},model:{value:t.dataForm.dataFormat,callback:function(a){t.$set(t.dataForm,"dataFormat",a)},expression:"dataForm.dataFormat"}},t._l(t.options2,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}))],1),t._v(" "),e("el-form-item",{attrs:{label:"读取频率",prop:"frequence"}},[e("el-select",{attrs:{placeholder:"请选择读取频率"},model:{value:t.dataForm.frequence,callback:function(a){t.$set(t.dataForm,"frequence",a)},expression:"dataForm.frequence"}},t._l(t.options1,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}))],1),t._v(" "),e("el-form-item",{attrs:{label:"自动连接",prop:"autoConnect"}},[e("el-switch",{model:{value:t.dataForm.autoConnect,callback:function(a){t.$set(t.dataForm,"autoConnect",a)},expression:"dataForm.autoConnect"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"自动读取",prop:"autoRead"}},[e("el-switch",{model:{value:t.dataForm.autoRead,callback:function(a){t.$set(t.dataForm,"autoRead",a)},expression:"dataForm.autoRead"}})],1)],1),t._v(" "),e("span",{staticStyle:{float:"right"}},[e("el-button",{attrs:{type:"primary"},on:{click:function(a){t.dataFormSubmit()}}},[t._v("确定")])],1)],1)],1)},staticRenderFns:[]};var o=e("VU/8")({data:function(){return{dataForm:{plcName:"",port:"",address:"",frequence:"",dataFormat:"",autoConnect:!0,autoRead:!0,station:""},options1:[],options2:[],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"}],station:[{required:!0,message:"站号不能为空",trigger:"blur"}]}}},created:function(){this.init()},methods:{init:function(){var t=this;this.$http({url:this.$http.adornUrl("api/server/plcCreate/list-frequence"),method:"post"}).then(function(a){var e=a.data;e&&0===e.code&&(t.options1=e.data)}),this.$http({url:this.$http.adornUrl("api/server/plcCreate/list-DataFormat"),method:"post"}).then(function(a){var e=a.data;e&&0===e.code&&(t.options2=e.data)}),this.$nextTick(function(){t.$refs.dataForm.resetFields()})},dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(a){a&&t.$http({url:t.$http.adornUrl("api/server/plcCreate/create-Modbus"),method:"post",data:t.$http.adornData(t.dataForm)}).then(function(a){var e=a.data;e&&0===e.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.init()}}):t.$message.error(e.msg)})})}}},r,!1,function(t){e("4p2+")},"data-v-329128c5",null);a.default=o.exports}});