PLC-read/dist/20490957/static/js/0.js

1 line
6.9 KiB
JavaScript
Raw Normal View History

2023-12-18 09:42:27 +08:00
webpackJsonp([0],{"1JAX":function(e,t,a){e.exports=a.p+"static/img/13.5ec8b82.jpg"},E4LH:function(e,t,a){"use strict";t.a=function(e){return/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(e)},t.b=function(e){return/^1[0-9]{10}$/.test(e)},t.c=function(e){return/^http[s]?:\/\/.*/.test(e)}},H2Hk: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("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible,"append-to-body":""},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"100px"},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:"参数ID",prop:"parameterId"}},[a("el-input",{attrs:{placeholder:"参数ID"},model:{value:e.dataForm.parameterId,callback:function(t){e.$set(e.dataForm,"parameterId",t)},expression:"dataForm.parameterId"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"参数名",prop:"parameterName"}},[a("el-input",{attrs:{placeholder:"参数名"},model:{value:e.dataForm.parameterName,callback:function(t){e.$set(e.dataForm,"parameterName",t)},expression:"dataForm.parameterName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"参数类型",prop:"readType"}},[a("el-select",{attrs:{placeholder:"请选择参数类型"},model:{value:e.dataForm.readType,callback:function(t){e.$set(e.dataForm,"readType",t)},expression:"dataForm.readType"}},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:"参数地址",prop:"readAddress"}},[a("el-input",{attrs:{placeholder:"参数地址"},model:{value:e.dataForm.readAddress,callback:function(t){e.$set(e.dataForm,"readAddress",t)},expression:"dataForm.readAddress"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"读取长度",prop:"length"}},[a("el-input",{attrs:{placeholder:"读取长度"},model:{value:e.dataForm.length,callback:function(t){e.$set(e.dataForm,"length",t)},expression:"dataForm.length"}})],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:[]},o=a("VU/8")({data:function(){return{visible:!1,dataForm:{id:"",parameterId:"",parameterName:"",readType:"",length:"",readAddress:""},options:[],dataRule:{parameterId:[{required:!0,message:"参数ID不能为空",trigger:"blur"}],parameterName:[{required:!0,message:"参数名不能为空",trigger:"blur"}],readType:[{required:!0,message:"参数类型不能为空",trigger:"change"}],length:[{required:!0,message:"读取长度不能为空",trigger:"blur"}],readAddress:[{required:!0,message:"参数地址不能为空",trigger:"blur"}]}}},methods:{init:function(e,t){var a=this;e?this.dataForm.id=e:(this.dataForm.id="",this.dataForm.plcId=t),this.visible=!0,this.$http({url:this.$http.adornUrl("api/server/parameter-config/getReadType"),method:"post"}).then(function(e){var t=e.data;t&&0===t.code&&(a.options=t.data)}),this.$nextTick(function(){if(a.$refs.dataForm.resetFields(),a.dataForm.id){var e={current:1,id:a.dataForm.id,size:10};a.$http({url:a.$http.adornUrl("api/server/parameter-config/getParameterById"),method:"post",data:e}).then(function(e){var t=e.data;t&&0===t.code&&(a.dataForm=t.data)})}})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&e.$http({url:e.$http.adornUrl("api/server/parameter-config/"+(e.dataForm.id?"updateParameters":"addParameter")),method:"post",data:e.dataForm}).then(function(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}}):e.$message.error(a.msg)})})}}},r,!1,null,null,null);t.default=o.exports},"cdA+":