1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
|
webpackJsonp([5,32,33,34],{"6VOP":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={data:function(){return{visible:!1,gridData:[],PLCID:"",parameterEdit:!1,pageIndex:1,pageSize:10,totalPage:0,headers:{"Content-Type":"multipart/form-data;charset=UTF-8"},value:""}},components:{parameterEdit:a("H2Hk").default},methods:{init:function(t){var e=this;this.PLCID=t,this.visible=!0,this.$nextTick(function(){e.getList()})},getList:function(){var t=this,e={id:this.PLCID,current:this.pageIndex,size:this.pageSize};this.$http({url:this.$http.adornUrl("api/server/parameter-config/page"),method:"post",data:e}).then(function(e){var a=e.data;a&&0===a.code?(t.gridData=a.data.records,t.totalPage=a.data.total):(t.gridData=[],t.totalPage=0)})},Edit:function(t){var e=this;this.parameterEdit=!0,this.$nextTick(function(){e.$refs.parameterEdit.init(t,e.PLCID)})},handleCloseReview:function(){this.value="",document.body.click()},Write:function(t){var e=this;if(this.value||0===this.value){var a={id:t,value:this.value};this.$http({url:this.$http.adornUrl("api/server/parameter-config/writeParameters"),method:"post",data:a}).then(function(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.getList()}}):e.$message.error(a.msg)}),document.body.click()}else this.$message("参数值不能为空");this.value=""},Read:function(t){var e=this,a={current:1,id:t.id,size:10};this.$http({url:this.$http.adornUrl("api/server/parameter-config/readParameters"),method:"post",data:a}).then(function(a){var r=a.data;e.$message({message:r.msg,duration:1500,onClose:function(){t.value=r.data.value}})})},sizeChangeHandle:function(t){this.pageSize=t,this.pageIndex=1,this.getList()},currentChangeHandle:function(t){this.pageIndex=t,this.getList()},deleteHandle:function(t,e){var a=this,r={current:1,id:t,size:10};this.$confirm("确定对[参数名:"+e+"]进行删除操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.$http({url:a.$http.adornUrl("api/server/parameter-config/deleteParameters"),method:"post",data:r}).then(function(t){var e=t.data;e&&0===e.code?a.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){a.getList()}}):a.$message.error(e.msg)})})},handleExcel:function(t){var e=this,a=new FormData;a.append("excle",t.raw),a.append("plcId",this.PLCID),this.$http({url:this.$http.adornUrl("api/server/parameter-config/importParameter"),method:"post",data:a}).then(function(t){var a=t.data;a&&0===a.code?(e.$message.success("导入成功"),e.getList()):e.$message.error(a.msg)}).catch(function(t){console.log(t),e.$message.error("导入失败")})}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:"PLC参数配置",visible:t.visible,width:"70%","show-close":!1},on:{"update:visible":function(e){t.visible=e}}},[a("div",{staticStyle:{"margin-top":"-40px",float:"right"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){t.Edit()}}},[t._v("新增")]),t._v(" "),a("el-upload",{staticClass:"upload",staticStyle:{float:"right","margin-left":"10px"},attrs:{action:"","show-file-list":!1,"on-change":t.handleExcel,accept:"'.xlsx','xls'","auto-upload":!1,headers:t.headers}},[a("el-button",{attrs:{size:"mini",type:"success"}},[t._v("导入")])],1)],1),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.gridData,stripe:!0,"header-cell-style":{background:"#eef1f6",color:"#606266",height:"56px"},border:""}},[a("el-table-column",{attrs:{prop:"parameterId",label:"参数ID"}}),t._v(" "),a("el-table-column",{attrs:{prop:"parameterName",label:"参数名"}}),t._v(" "),a("el-table-column",{attrs:{prop:"readType",label:"参数类型"}}),t._v(" "),a("el-table-column",{attrs:{prop:"readAddress",label:"参数地址"}}),t._v(" "),a("el-table-column",{attrs:{prop:"length",label:"读取长度"}}),t._v(" "),a("el-table-column",{attrs:{prop:"value",label:"参数值"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-popover",{ref:"popover-"+e.$
|