FastBee/docker/data/nginx/vue/static/js/chunk-09cb2e28.b40334da.js
2025-07-07 09:21:15 +08:00

1 line
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-09cb2e28"],{"0bc2":function(t,e,a){"use strict";a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){return s})),a.d(e,"b",(function(){return o}));var i=a("b775");function n(t){return Object(i["a"])({url:"/iot/runtime/service/invokeReply",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/iot/runtime/prop/get",method:"get",params:t})}function o(t){return Object(i["a"])({url:"/iot/runtime/service/invoke",method:"post",data:t})}},"4c4c":function(t,e,a){"use strict";a("dcea")},"5daf":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"running-status beautify-scroll-def"},[a("el-main",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"H100",staticStyle:{position:"relative"}},[!t.loading&&t.runningData.length>0?a("el-row",{staticClass:"row-list",attrs:{gutter:12}},t._l(t.runningData,(function(e,i){return a("el-col",{key:i,staticStyle:{"margin-bottom":"10px",height:"110px"},attrs:{span:6}},[a("el-card",{staticClass:"elcard",attrs:{shadow:"hover"}},[a("div",{staticClass:"head"},[a("div",{staticClass:"title"},[t._v(" "+t._s(e.name||"--")+" "),0==e.isReadonly?a("el-tooltip",{staticClass:"title_send",attrs:{content:t.$t("device.realTime-status.845353-0")}},[a("span",{staticClass:"el-icon-s-promotion",on:{click:function(a){return a.stopPropagation(),t.editFunc(e)}}},[a("span",{staticClass:"send_title"},[t._v(t._s(t.$t("device.realTime-status.845353-1")))])])]):t._e()],1),a("div",{staticClass:"name"},[a("span",{staticClass:"value_class"},[t._v(t._s(e.valueName||"-"))]),e.datatype.unit&&"un"!=e.datatype.unit?a("span",[t._v(" "+t._s(e.datatype.unit||e.datatype.unitName)+" ")]):t._e()])]),a("div",{staticClass:"card-bottom"},[t._v(t._s(t.$t("device.realTime-status.845353-2"))+t._s(e.ts||"--"))])])],1)})),1):t._e(),t.loading||0!==t.runningData.length?t._e():a("el-empty",{attrs:{"image-size":200}})],1),a("el-dialog",{attrs:{title:t.$t("device.realTime-status.845353-3"),visible:t.dialogValue,width:"30%"},on:{"update:visible":function(e){t.dialogValue=e}}},[a("el-form",{staticStyle:{height:"100%",padding:"0 20px"},attrs:{size:"mini"}},[t._l(t.opationList,(function(e,i){return a("el-form-item",{key:i,attrs:{label:e.label+"","label-width":"180px"}},["integer"==e.dataTypeName||"decimal"==e.dataTypeName?a("el-input",{staticStyle:{width:"50%"},attrs:{precision:0,controls:!1,type:"number"},on:{input:function(a){return t.justicNumber(e)}},model:{value:t.funVal[e.key],callback:function(a){t.$set(t.funVal,e.key,a)},expression:"funVal[item.key]"}}):t._e(),"enum"==e.dataTypeName||"singleBoolean"==e.dataTypeName||"bool"==e.dataTypeName?a("el-select",{on:{change:function(e){return t.changeSelect()}},model:{value:t.funVal[e.key],callback:function(a){t.$set(t.funVal,e.key,a)},expression:"funVal[item.key]"}},t._l(e.options,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1):t._e(),"integer"!=e.dataTypeName&&"decimal"!=e.dataTypeName||!e.unit||"un"==e.unit||"/"==e.unit?t._e():a("span",[t._v(""+t._s(e.unit)+"")]),"integer"==e.dataTypeName||"decimal"==e.dataTypeName?a("span",{staticClass:"range"},[t._v("("+t._s(e.min)+" ~ "+t._s(e.max)+")")]):t._e()],1)})),a("el-form-item",{staticStyle:{display:"none"}},[a("el-input",{model:{value:t.functionName,callback:function(e){t.functionName=e},expression:"functionName"}})],1)],2),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogValue=!1}}},[t._v(t._s(t.$t("device.realTime-status.845353-4")))]),a("el-button",{attrs:{type:"primary",loading:t.btnLoading,disabled:!t.canSend},on:{click:t.sendService}},[t._v(t._s(t.$t("device.realTime-status.845353-5")))])],1)],1)],1)},n=[],s=(a("4de4"),a("b0c0"),a("a9e3"),a("b64b"),a("d3b7"),a("25f0"),a("8a79"),a("159b"),a("0bc2")),o={props:{device:{type:Object,default:function(){return{}}}},watch:{device:{handler:function(t){var e=this;t&&t.serialNumber&&(this.params.serialNumber=t.serialNumber,this.serialNumber=t.serialNumber,this.params.productId=t.productId,this.params.slaveId=t.slaveId,this.params.deviceId=t.deviceId,this.deviceInfo=t,this.updateDeviceStatus(this.deviceInfo),this.slaveList=t.subDeviceList,this.getSlaveList(this.deviceInfo),this.$busEvent.$on("updateData",(function(t){t.data&&t.data[0].remark&&(e.getDeviceFuncLog(),t.data[0].ts=t.data[0].remark),e.updateData(t)})),this.$busEvent.$on("updateLog",(function(t){e.getDeviceFuncLog()})),this.mqttCallback())}}},data:function(){return{activeGroup:"",groupList:[],runningData:[],loading:!1,dialogValue:!1,canSend:!1,btnLoading:!1,funVal:{},chooseFun:{},opationList:[],functionName:""}},methods:{qosChange:function(t){},payloadTypeChange:function(t){},getTime:function(){var t=new Date,e=t.getFullYear(),a=t.getMonth()+1,i=t.getDate(),n=t.getHours(),s=t.getMinutes(),o=t.getSeconds();return a=a<10?"0"+a:a,i=i<10?"0"+i:i,n=n<10?"0"+n:n,e+"-"+a+"-"+i+" "+n+":"+s+":"+o},getRuntimeStatus:function(){var t=this;getDeviceRunningStatus(this.params).then((function(e){t.runningData=e.data.thingsModels,t.runningData.forEach((function(t){"enum"==t.datatype.type?t.datatype.enumList.forEach((function(e){e.value==t.value&&(t.value=e.text)})):"bool"==t.datatype.type&&(t.value=0==t.value?t.falseText:t.trueText)})),t.functionData=t.runningData.filter((function(t){return 0==t.isReadonly}))}))},getGateway:function(){var t=this;getDeviceRunningStatus(this.params).then((function(e){t.deviceInfo.thingsModels=e.data.thingsModels}))},getSlaveList:function(){this.getRuntimeStatus(),this.getDeviceFuncLog()},selectSlave:function(){this.params.serialNumber=this.serialNumber+"_"+this.params.slaveId,this.getRuntimeStatus()},handleClick:function(){"prop"===this.thingsType?this.params.type=1:"function"===this.thingsType&&(this.params.type=2,this.functionData=this.runningData.filter((function(t){return 0==t.isReadonly})))},runtimeClick:function(){"gateway"===this.runtimeName?(this.params.serialNumber=this.serialNumber,this.slaveId=this.params.slaveId,this.params.slaveId=void 0,this.getGateway()):(this.params.serialNumber=this.serialNumber+"_"+this.slaveId,this.params.slaveId=this.slaveId,this.getRuntimeStatus())},updateParam:function(t){},editFunc:function(t){this.dialogValue=!0,this.canSend=!0,this.funVal={},this.getValueName(t),this.from=t,console.log(this.runningData)},updateDeviceStatus:function(t){3==t.status?(this.statusColor.background="#12d09f",this.title="在线模式"):1==t.isShadow?(this.statusColor.background="#486FF2",this.title="影子模式"):(this.statusColor.background="#909399",this.title="离线模式",this.shadowUnEnable=!0),this.$emit("statusEvent",this.deviceInfo.status)},getValueName:function(t){this.funVal[t.id]=t.value},sendService:function(){var t=this;console.log("下发指令",this.from.shadow);try{this.funVal[this.from.id]=this.from.shadow;var e={serialNumber:this.serialNumber,productId:this.params.productId,remoteCommand:this.funVal,identifier:this.from.id,slaveId:this.params.slaveId,modelName:this.from.name,isShadow:3!=this.device.status,type:this.from.type};Object(s["b"])(e).then((function(e){200==e.code&&(t.$message({type:"success",message:"服务调用成功!"}),t.getDeviceFuncLog())}))}finally{this.dialogValue=!1}},mqttPublish:function(t,e){var a=this,i={};i[e.id]=e.shadow;var n={serialNumber:t.serialNumber,productId:t.productId,remoteCommand:i,identifier:e.id,modelName:e.name,isShadow:3!=t.status,type:e.type};Object(s["b"])(n).then((function(t){200===t.code&&a.$message({type:"success",message:"服务调用成功!"})}))},getShowValue:function(t){var e=this;switch(this.from.datatype.type){case ENUM:var a=this.from.datatype.enumList;a.forEach((function(a){a.value===t&&(e.showValue=a.text)}));break;case INTEGER:case DECIMAL:this.showValue=t;case BOOL:this.showValue=1==t?this.from.datatype.trueText:this.from.datatype.falseText;break}},changeSelect:function(){this.$forceUpdate()},justicNumber:function(){if(this.canSend=!0,this.from.datatype.max<this.funVal[this.from.identity]||this.from.datatype.min>this.funVal[this.from.identity])return this.canSend=!1,!0;this.$forceUpdate()},getDeviceFuncLog:function(){var t=this,e={serialNumber:this.serialNumber};console.log("params --",e),funcLog(e).then((function(e){t.logList=e.rows}))},updateData:function(t){var e=this;t.data&&0!==t.data.length&&t.data.forEach((function(t){e.runningData.some((function(a,i){if(t.slaveId===a.slaveId&&t.id==a.id){var n=e.runningData[i];return n.ts=t.ts,n.value=t.value,"enum"==a.datatype.type?a.datatype.enumList.forEach((function(t){t.value==n.value&&(n.value=t.text)})):"bool"==a.datatype.type&&(n.value=0==n.value?a.datatype.falseText:a.datatype.trueText),e.$set(e.runningData,i,n),!0}}))}))},mqttCallback:function(){var t=this;this.$mqttTool.client.on("message",(function(e,a,i){var n=e.split("/"),s=(n[1],n[2]);if(a=JSON.parse(a.toString()),a&&("status"==n[3]&&(console.log("接收到【设备状态-运行】主题:",e),console.log("接收到【设备状态-运行】内容:",a),t.deviceInfo.serialNumber==s&&(t.deviceInfo.status=a.status,t.deviceInfo.isShadow=a.isShadow,t.deviceInfo.rssi=a.rssi,t.updateDeviceStatus(t.deviceInfo))),"reply"==n[4]&&t.$modal.notifySuccess(a),e.endsWith("ws/service")&&(console.log("接收到【物模型】主题1",e),console.log("接收到【物模型】内容:",a),t.deviceInfo.serialNumber==s)))for(var o=0;o<a.length;o++){for(var r=!1,d=0;d<t.deviceInfo.thingsModels.length&&!r;d++){if(t.deviceInfo.thingsModels[d].id==a[o].id){"decimal"==t.deviceInfo.thingsModels[d].datatype.type||"integer"==t.deviceInfo.thingsModels[d].datatype.type?t.deviceInfo.thingsModels[d].shadow=Number(a[o].value):t.deviceInfo.thingsModels[d].shadow=a[o].value,r=!0;break}if("object"==t.deviceInfo.thingsModels[d].datatype.type){for(var l=0;l<t.deviceInfo.thingsModels[d].datatype.params.length;l++)if(t.deviceInfo.thingsModels[d].datatype.params[l].id==a[o].id){t.deviceInfo.thingsModels[d].datatype.params[l].shadow=a[o].value,r=!0;break}}else if("array"==t.deviceInfo.thingsModels[d].datatype.type)if("object"==t.deviceInfo.thingsModels[d].datatype.arrayType)if(0==String(a[o].id).indexOf("array_"))for(var u=0;u<t.deviceInfo.thingsModels[d].datatype.arrayParams.length;u++){for(var c=0;c<t.deviceInfo.thingsModels[d].datatype.arrayParams[u].length;c++)if(t.deviceInfo.thingsModels[d].datatype.arrayParams[u][c].id==a[o].id){t.deviceInfo.thingsModels[d].datatype.arrayParams[u][c].shadow=a[o].value,r=!0;break}if(r)break}else for(var h=0;h<t.deviceInfo.thingsModels[d].datatype.arrayParams.length;h++){for(var f=0;f<t.deviceInfo.thingsModels[d].datatype.arrayParams[h].length;f++){var v=h>9?String(h):"0"+d,m="array_"+v+"_";t.deviceInfo.thingsModels[d].datatype.arrayParams[h][f].id==m+a[o].id&&(t.deviceInfo.thingsModels[d].datatype.arrayParams[h][f].shadow=a[o].value,r=!0)}if(r)break}else for(var p=0;p<t.deviceInfo.thingsModels[d].datatype.arrayModel.length;p++)if(t.deviceInfo.thingsModels[d].datatype.arrayModel[p].id==a[o].id){t.deviceInfo.thingsModels[d].datatype.arrayModel[p].shadow=a[o].value,r=!0;break}}for(var g=0;g<t.deviceInfo.chartList.length;g++){if(0==t.deviceInfo.chartList[g].id.indexOf("array_")){if(t.deviceInfo.chartList[g].id==a[o].id){t.deviceInfo.chartList[g].shadow=a[o].value;for(var y=0;y<t.monitorChart.length;y++)if(a[o].id==t.monitorChart[y].data.id){var b=[{value:a[o].value,name:t.monitorChart[y].data.name}];t.monitorChart[y].chart.setOption({series:[{data:b}]});break}}}else if(t.deviceInfo.chartList[g].id==a[o].id){t.deviceInfo.chartList[g].shadow=a[o].value;for(var I=0;I<t.monitorChart.length;I++)if(a[o].id==t.monitorChart[I].data.id){r=!0;var N=[{value:a[o].value,name:t.monitorChart[I].data.name}];t.monitorChart[I].chart.setOption({series:[{data:N}]});break}}if(r)break}}}))}}},r=o,d=(a("4c4c"),a("2877")),l=Object(d["a"])(r,i,n,!1,null,"405562f6",null);e["default"]=l.exports},"8a79":function(t,e,a){"use strict";var i=a("23e7"),n=a("e330"),s=a("06cf").f,o=a("50c4"),r=a("577e"),d=a("5a34"),l=a("1d80"),u=a("ab13"),c=a("c430"),h=n("".endsWith),f=n("".slice),v=Math.min,m=u("endsWith"),p=!c&&!m&&!!function(){var t=s(String.prototype,"endsWith");return t&&!t.writable}();i({target:"String",proto:!0,forced:!p&&!m},{endsWith:function(t){var e=r(l(this));d(t);var a=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===a?i:v(o(a),i),s=r(t);return h?h(e,s,n):f(e,n-s.length,n)===s}})},dcea:function(t,e,a){}}]);