/*!
 *  build: vue-admin-beautiful 
 *  vue-admin-beautiful author: chuzhixin 1204505056@qq.com 
 *  vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 
 *  time: 2024-10-10 11:14:28
 */
/*!
 *  build: vue-admin-beautiful 
 *  vue-admin-beautiful author: chuzhixin 1204505056@qq.com 
 *  vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 
 *  time: 2024-10-10 11:14:28
 */
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3f9d2274","chunk-3f9d2274","chunk-7b89f47a"],{"49de":function(e,t,a){"use strict";a.r(t),a.d(t,"getList",(function(){return o})),a.d(t,"doAdd",(function(){return c})),a.d(t,"doDelete",(function(){return r}));var l=a("b775");a("7d92");function o(e){let t="?page="+e.page+"&size="+e.size;return""!=e.name&&(t+="&name="+e.name),Object(l["default"])({url:"/material/icon/list"+t,method:"get",data:e})}function c(e){return Object(l["default"])({url:"/material/icon/insert",method:"post",data:e})}function r(e){return Object(l["default"])({url:"/material/icon/remove",method:"post",data:e})}},"4f61":function(e,t,a){"use strict";a("90bf")},"669c":function(e,t,a){"use strict";a.r(t),a.d(t,"getList",(function(){return o})),a.d(t,"doEdit",(function(){return c})),a.d(t,"doDelete",(function(){return r})),a.d(t,"doAdd",(function(){return d})),a.d(t,"getDictData",(function(){return n})),a.d(t,"selectAttribute",(function(){return i})),a.d(t,"selectSensorType",(function(){return s})),a.d(t,"selectSensorUnit",(function(){return u})),a.d(t,"selectStoreStrategy",(function(){return b})),a.d(t,"selectFunctionCode",(function(){return m})),a.d(t,"selectDataFormat",(function(){return f})),a.d(t,"selectReadWrite",(function(){return j}));var l=a("b775");function o(e){let t="?page="+e.page+"&size="+e.size;return""!=e.deviceId&&(t+="&deviceId="+e.deviceId),""!=e.sensorName&&(t+="&sensorName="+e.sensorName),Object(l["default"])({url:"/iot/sensor/select"+t,method:"get",data:e})}function c(e){return Object(l["default"])({url:"/iot/sensor/update",method:"post",data:e})}function r(e){return Object(l["default"])({url:"/iot/sensor/remove",method:"post",data:e})}function d(e){return Object(l["default"])({url:"/iot/sensor/insert",method:"post",data:e})}function n(e){return Object(l["default"])({url:"/iot/sensor/dict",method:"get",data:e})}function i(e){return Object(l["default"])({url:"/iot/sensor/selectAttribute",method:"get",data:e})}function s(e){return Object(l["default"])({url:"/iot/sensor/selectSensorType",method:"get",data:e})}function u(e){return Object(l["default"])({url:"/iot/sensor/selectSensorUnit",method:"get",data:e})}function b(e){return Object(l["default"])({url:"/iot/sensor/selectStoreStrategy",method:"get",data:e})}function m(e){return Object(l["default"])({url:"/iot/sensor/selectFunctionCode",method:"get",data:e})}function f(e){return Object(l["default"])({url:"/iot/sensor/selectDataFormat",method:"get",data:e})}function j(e){return Object(l["default"])({url:"/iot/sensor/selectReadWrite",method:"get",data:e})}},"7a86":function(e,t,a){"use strict";a.r(t);var l=a("f2bf");const o={class:"manage-container"},c=["src"];function r(e,t,a,r,d,n){const i=Object(l["resolveComponent"])("el-input"),s=Object(l["resolveComponent"])("el-form-item"),u=Object(l["resolveComponent"])("el-option"),b=Object(l["resolveComponent"])("el-select"),m=Object(l["resolveComponent"])("el-form"),f=Object(l["resolveComponent"])("el-button"),j=Object(l["resolveComponent"])("vab-query-form"),h=Object(l["resolveComponent"])("el-dialog"),O=Object(l["resolveComponent"])("parameter-show");return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createVNode"])(h,{modelValue:d.dialogFormVisible,"onUpdate:modelValue":t[15]||(t[15]=e=>d.dialogFormVisible=e),title:d.title,width:"500px",onClose:n.close},{default:Object(l["withCtx"])(()=>[Object(l["createElementVNode"])("div",o,[Object(l["createVNode"])(m,{ref:"form",model:d.form,"label-width":"100px","label-position":"left"},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(s,{label:e.$t("sensor.cgqmc")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.form.name,"onUpdate:modelValue":t[0]||(t[0]=e=>d.form.name=e),placeholder:e.$t("sensor.qsrcgqmc")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.cgqtp")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{ref:"select",modelValue:d.form.img,"onUpdate:modelValue":t[1]||(t[1]=e=>d.form.img=e),style:{width:"100%"},placeholder:e.$t("defalult.qxz"),onChange:n.changeSelection},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.iconData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.icon,label:e.name,value:e.icon},{default:Object(l["withCtx"])(()=>[Object(l["createElementVNode"])("img",{src:d.fileUrl+e.icon,style:{width:"50px",height:"50px"}},null,8,c)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("defalult.px")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.form.sort,"onUpdate:modelValue":t[2]||(t[2]=e=>d.form.sort=e),placeholder:"1"},null,8,["modelValue"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.dzh")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.form.addressId,"onUpdate:modelValue":t[3]||(t[3]=e=>d.form.addressId=e),placeholder:e.$t("sensor.srdzj")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.jcqh")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.form.offset,"onUpdate:modelValue":t[4]||(t[4]=e=>d.form.offset=e),placeholder:e.$t("sensor.jcqh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.sjjd")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.accuracy,"onUpdate:modelValue":t[5]||(t[5]=e=>d.form.accuracy=e),placeholder:e.$t("sensor.qsrsjjd")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.accuracy,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),d.isNumber?(Object(l["openBlock"])(),Object(l["createBlock"])(s,{key:0,label:e.$t("sensor.sxmrz")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.data.value,"onUpdate:modelValue":t[6]||(t[6]=e=>d.data.value=e),placeholder:"0"},null,8,["modelValue"])]),_:1},8,["label"])):Object(l["createCommentVNode"])("",!0),d.isNumber?(Object(l["openBlock"])(),Object(l["createBlock"])(s,{key:1,label:e.$t("sensor.sxdaw")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.data.unit,"onUpdate:modelValue":t[7]||(t[7]=e=>d.data.unit=e),placeholder:"1"},null,8,["modelValue"])]),_:1},8,["label"])):Object(l["createCommentVNode"])("",!0),d.isNumber?(Object(l["openBlock"])(),Object(l["createBlock"])(s,{key:2,label:e.$t("sensor.csbz")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{modelValue:d.data.remark,"onUpdate:modelValue":t[8]||(t[8]=e=>d.data.remark=e),placeholder:"1"},null,8,["modelValue"])]),_:1},8,["label"])):Object(l["createCommentVNode"])("",!0),d.isConfig?(Object(l["openBlock"])(),Object(l["createBlock"])(s,{key:3,label:e.$t("sensor.cgdlx")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.data.type,"onUpdate:modelValue":t[9]||(t[9]=e=>d.data.type=e),placeholder:e.$t("sensor.qsrcgdlx")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.typeData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])):Object(l["createCommentVNode"])("",!0),Object(l["createVNode"])(s,{label:e.$t("sensor.cgqdw")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.unit,"onUpdate:modelValue":t[10]||(t[10]=e=>d.form.unit=e),placeholder:e.$t("sensor.qxzcgqdw")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.unitData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.dxcx")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.readWrite,"onUpdate:modelValue":t[11]||(t[11]=e=>d.form.readWrite=e),placeholder:e.$t("sensor.qxzdxqx")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.writeData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.dtxs")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.homeShowFlag,"onUpdate:modelValue":t[12]||(t[12]=e=>d.form.homeShowFlag=e),placeholder:e.$t("sensor.sfdtxs")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.homeShowFlagData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.dwzh")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.convertFlag,"onUpdate:modelValue":t[13]||(t[13]=e=>d.form.convertFlag=e),placeholder:e.$t("sensor.sfxygjddwzh")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.convertFlagData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(l["createVNode"])(s,{label:e.$t("sensor.sjgs")},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{modelValue:d.form.dataFormat,"onUpdate:modelValue":t[14]||(t[14]=e=>d.form.dataFormat=e),placeholder:e.$t("sensor.qxzsjgs")},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(d.formatData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(u,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),Object(l["createVNode"])(j,null,{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(f,{type:"primary",onClick:n.save},{default:Object(l["withCtx"])(()=>[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.$t("defalult.bc")),1)]),_:1},8,["onClick"]),Object(l["createVNode"])(f,{type:"primary",plain:"",onClick:n.close},{default:Object(l["withCtx"])(()=>[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.$t("defalult.fh")),1)]),_:1},8,["onClick"])]),_:1})])]),_:1},8,["modelValue","title","onClose"]),Object(l["createVNode"])(O,{ref:"parameter",onGetParameter:n.getParameter},null,8,["onGetParameter"])],64)}var d=a("669c"),n=a("49de"),i=a("bdc1"),s=a("f121"),u={name:"Sensor",components:{parameterShow:i["default"]},data(){return{attrData:[],typeData:[],unitData:[],strategyData:[],codeData:[],fileUrl:s["baseURL"]+"/static/img/",formatData:[],writeData:[],homeShowFlagData:[{label:"显示",value:1},{label:"不显示",value:0}],convertFlagData:[{label:"是",value:1},{label:"否",value:0}],accuracy:[1,2,3,4,5,6,7,8,9],form:{id:"",name:"",projectId:"",deviceId:"",addressId:"",offset:"",storeStrategy:"",functionCode:"",dataFormat:"",sort:"",readWrite:"",homeShowFlag:"",img:"",convertFlag:"",unit:""},data:{value:"",unit:"",remark:"",type:""},config:"",isNumber:!1,isConfig:!1,dialogFormVisible:!1,title:"",diffData:{},iconData:[]}},created(){},methods:{changeSelection(e){for(var t in this.iconData){const a=this.iconData[t];a.icon==e&&this.$refs["select"].$el.children[0].children[0].setAttribute("style","background:url("+this.fileUrl+a.icon+") no-repeat;color:#fff;text-indent: -9999px;background-position: center center")}},async getIconData(){const{data:e}=await Object(n["getList"])({page:1,size:100,name:""});this.iconData=e.items},showEdit(e,t){t?(this.title="编辑传感器",this.assignment(e)):(this.title="添加传感器",this.getDeviceData(e)),this.getDictData(),this.getIconData(),this.dialogFormVisible=!0},assignment(e){const t=Object.assign({},e);void 0!=t.attribute&&(this.form.attribute=t.attribute.dataCode),this.form.id=t.id,this.form.name=t.name,this.form.img=t.img,this.form.addressId=t.addressId,this.form.offset=t.offset,this.form.accuracy=t.accuracy,void 0!=t.unit&&(this.form.unit=t.unit.dataCode),void 0!=t.dataFormat&&(this.form.dataFormat=t.dataFormat.dataCode),void 0!=t.readWrite&&(this.form.readWrite=t.readWrite.dataCode),this.form.transferId=t.transferId,this.form.homeShowFlag=isNaN(Number(t.homeShowFlag))?"":Number(t.homeShowFlag),this.form.convertFlag=isNaN(Number(t.convertFlag))?"":Number(t.convertFlag),this.form.sort=t.sort},getType(e){0==e?(this.isNumber=!1,this.isConfig=!0):(this.isNumber=!0,this.isConfig=!1),this.data.unit="",this.data.value="",this.data.remark="",this.data.type=""},parameter(){this.$refs["parameter"].showEdit()},async getDeviceData(e){this.form.projectId=sessionStorage.getItem("projectId"),this.form.deviceId=e},getParameter(e){this.config=JSON.stringify(e),this.form.functionCode=e.functionCode,this.form.dataFormat=e.dataFormat},async getDictData(){const{data:e}=await Object(d["getDictData"])();this.attrData=e.sensorAttribute,this.typeData=e.sensorType,this.unitData=e.sensorUnit,this.strategyData=e.storeStrategy,this.codeData=e.functionCode,this.formatData=e.dataFormat,this.writeData=e.sensorReadWrite},close(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1,this.$emit("fetch-data")},save(){this.$refs["form"].validate(async e=>{if(!e)return!1;if(this.form.attributeParams=JSON.stringify(this.data),this.form.id){const{msg:e}=await Object(d["doEdit"])(this.form);this.$notify({title:e,type:"success"})}else{delete this.form.id;const{msg:e}=await Object(d["doAdd"])(this.form);this.$notify({title:e,type:"success"})}this.$refs["form"].resetFields(),this.$parent.fetchData(),this.dialogFormVisible=!1})}}},b=(a("4f61"),a("d959")),m=a.n(b);const f=m()(u,[["render",r],["__scopeId","data-v-15db829c"]]);t["default"]=f},"90bf":function(e,t,a){},bdc1:function(e,t,a){"use strict";a.r(t);var l=a("f2bf");function o(e,t,a,o,c,r){const d=Object(l["resolveComponent"])("el-option"),n=Object(l["resolveComponent"])("el-select"),i=Object(l["resolveComponent"])("el-form-item"),s=Object(l["resolveComponent"])("el-button"),u=Object(l["resolveComponent"])("vab-query-form"),b=Object(l["resolveComponent"])("el-form"),m=Object(l["resolveComponent"])("el-dialog");return Object(l["openBlock"])(),Object(l["createBlock"])(m,{modelValue:c.dialogFormVisible,"onUpdate:modelValue":t[3]||(t[3]=e=>c.dialogFormVisible=e),title:c.title,width:"500px",onClose:e.close},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(b,{ref:"form",model:c.form,"label-width":"100px","label-position":"left"},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(i,{label:"属性种类"},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(n,{modelValue:c.type,"onUpdate:modelValue":t[0]||(t[0]=e=>c.type=e),placeholder:"请选择属性种类",onChange:r.getType},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(c.typeData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(d,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),c.show?(Object(l["openBlock"])(),Object(l["createBlock"])(i,{key:0,label:"功能码"},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(n,{modelValue:c.form.functionCode,"onUpdate:modelValue":t[1]||(t[1]=e=>c.form.functionCode=e),placeholder:"请选择功能码"},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(c.codeData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(d,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):Object(l["createCommentVNode"])("",!0),c.show?(Object(l["openBlock"])(),Object(l["createBlock"])(i,{key:1,label:"数据格式"},{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(n,{modelValue:c.form.dataFormat,"onUpdate:modelValue":t[2]||(t[2]=e=>c.form.dataFormat=e),placeholder:"请选择数据格式"},{default:Object(l["withCtx"])(()=>[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(c.formatData,e=>(Object(l["openBlock"])(),Object(l["createBlock"])(d,{key:e.dataCode,label:e.dataValue,value:e.dataCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):Object(l["createCommentVNode"])("",!0),Object(l["createVNode"])(u,null,{default:Object(l["withCtx"])(()=>[Object(l["createVNode"])(s,{type:"primary",onClick:r.save},{default:Object(l["withCtx"])(()=>t[4]||(t[4]=[Object(l["createTextVNode"])("保存")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title","onClose"])}var c=a("669c"),r={name:"Parameter",data(){return{type:0,show:!1,dialogFormVisible:!1,title:"",codeData:[],formatData:[],typeData:[{value:0,label:"请选择属性种类"},{value:1,label:"Modbus RTU"},{value:2,label:"请选择属性种类"}],form:{functionCode:"",dataFormat:""}}},created(){},methods:{getType(e){this.show=1==e},showEdit(){this.title="参数配置",this.dialogFormVisible=!0,this.getDictData()},async getDictData(){const{data:e}=await Object(c["getDictData"])();this.codeData=e.functionCode,this.formatData=e.formatData},save(){this.$emit("getParameter",this.form),this.dialogFormVisible=!1}}},d=a("d959"),n=a.n(d);const i=n()(r,[["render",o]]);t["default"]=i}}]);