admin
2025-03-29 9cd0e111d7315074f5574558dab3cae087ff1f68
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e51c2"],{"92a4":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"工位编号",prop:"locationCode"}},[a("el-input",{attrs:{placeholder:"请输入工位编号",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.locationCode,callback:function(t){e.$set(e.queryParams,"locationCode",t)},expression:"queryParams.locationCode"}})],1),a("el-form-item",{attrs:{label:"工位名称",prop:"locationName"}},[a("el-input",{attrs:{placeholder:"请输入工位名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.locationName,callback:function(t){e.$set(e.queryParams,"locationName",t)},expression:"queryParams.locationName"}})],1),a("el-form-item",{attrs:{label:"地址",prop:"node"}},[a("el-input",{attrs:{placeholder:"请输入地址",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.node,callback:function(t){e.$set(e.queryParams,"node",t)},expression:"queryParams.node"}})],1),a("el-form-item",{attrs:{label:"采集类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择订阅状态",clearable:""},model:{value:e.queryParams.type,callback:function(t){e.$set(e.queryParams,"type",t)},expression:"queryParams.type"}},e._l(e.dict.type.collection_type,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"订阅",prop:"subscribe"}},[a("el-select",{attrs:{placeholder:"请选择订阅状态",clearable:""},model:{value:e.queryParams.subscribe,callback:function(t){e.$set(e.queryParams,"subscribe",t)},expression:"queryParams.subscribe"}},e._l(e.dict.type.sys_yes_no,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["sc:opcConf:add"],expression:"['sc:opcConf:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["sc:opcConf:edit"],expression:"['sc:opcConf:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["sc:opcConf:remove"],expression:"['sc:opcConf:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["sc:opcConf:export"],expression:"['sc:opcConf:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{border:"",data:e.opcConfList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:"工位编码",align:"center",prop:"locationCode"}}),a("el-table-column",{attrs:{label:"工位名称",align:"center",prop:"locationName"}}),a("el-table-column",{attrs:{label:"地址",align:"center",prop:"node"}}),a("el-table-column",{attrs:{label:"采集类型",align:"center",prop:"type"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.collection_type,value:t.row.type}})]}}])}),a("el-table-column",{attrs:{label:"是否订阅",align:"center",prop:"subscribe"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.sys_yes_no,value:t.row.subscribe}})]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"工位编码",prop:"locationCode"}},[a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.form.locationCode,callback:function(t){e.$set(e.form,"locationCode",t)},expression:"form.locationCode"}})],1),a("el-form-item",{attrs:{label:"工位名称",prop:"locationName"}},[a("el-input",{attrs:{placeholder:"请输入工位名称"},model:{value:e.form.locationName,callback:function(t){e.$set(e.form,"locationName",t)},expression:"form.locationName"}})],1),a("el-form-item",{attrs:{label:"地址",prop:"node"}},[a("el-input",{attrs:{placeholder:"请输入地址"},model:{value:e.form.node,callback:function(t){e.$set(e.form,"node",t)},expression:"form.node"}})],1),a("el-form-item",{attrs:{label:"采集类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择采集类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.dict.type.collection_type,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"是否订阅",prop:"subscribe"}},[a("el-radio-group",{model:{value:e.form.subscribe,callback:function(t){e.$set(e.form,"subscribe",t)},expression:"form.subscribe"}},e._l(e.dict.type.sys_yes_no,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},o=[],r=(a("0643"),a("a573"),a("b775"));function n(e){return Object(r["a"])({url:"/sc/opcConf/list",method:"get",params:e})}function s(e){return Object(r["a"])({url:"/sc/opcConf/"+e,method:"get"})}function i(e){return Object(r["a"])({url:"/sc/opcConf",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/sc/opcConf",method:"put",data:e})}function u(e){return Object(r["a"])({url:"/sc/opcConf/"+e,method:"delete"})}var p={name:"OpcConf",dicts:["sys_yes_no","collection_type"],data(){return{advancedSearchVisible:!1,loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,opcConfList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,locationCode:null,locationName:null,node:null,type:null,subscribe:null},form:{},rules:{locationCode:[{required:!0,message:"工位编码不能为空",trigger:"blur"},{pattern:/^[a-zA-Z0-9]*$/,message:"总成序列号不能包含中文字符",trigger:"blur"}],locationName:[{required:!0,message:"工位名称不能为空",trigger:"blur"}],subscribe:[{required:!0,message:"订阅不能为空",trigger:"blur"}],node:[{required:!0,message:"地址不能为空",trigger:"blur"}]}}},created(){this.getList()},methods:{toggleAdvancedSearch(){this.advancedSearchVisible=!this.advancedSearchVisible},getList(){this.loading=!0,n(this.queryParams).then(e=>{this.opcConfList=e.rows,this.total=e.total,this.loading=!1})},cancel(){this.open=!1,this.reset()},reset(){this.form={id:null,locationCode:null,locationName:null,node:null,type:null,subscribe:null,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null},this.resetForm("form")},handleQuery(){this.queryParams.pageNum=1,this.getList()},resetQuery(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange(e){this.ids=e.map(e=>e.id),this.single=1!==e.length,this.multiple=!e.length},handleAdd(){this.reset(),this.open=!0,this.title="添加OPC交互配置"},handleUpdate(e){this.reset();const t=e.id||this.ids;s(t).then(e=>{this.form=e.data,this.open=!0,this.title="修改OPC交互配置"})},submitForm(){this.$refs["form"].validate(e=>{e&&(null!=this.form.id?c(this.form).then(e=>{this.$modal.msgSuccess("修改成功"),this.open=!1,this.getList()}):i(this.form).then(e=>{this.$modal.msgSuccess("新增成功"),this.open=!1,this.getList()}))})},handleDelete(e){const t=e.id||this.ids;this.$modal.confirm('是否确认删除OPC交互配置编号为"'+t+'"的数据项?').then((function(){return u(t)})).then(()=>{this.getList(),this.$modal.msgSuccess("删除成功")}).catch(()=>{})},handleExport(){this.download("sc/opcConf/export",{...this.queryParams},`opcConf_${(new Date).getTime()}.xlsx`)}}},m=p,d=a("2877"),h=Object(d["a"])(m,l,o,!1,null,null,null);t["default"]=h.exports}}]);