FastBee/docker/data/nginx/vue/static/js/chunk-03fb653e.28f447ef.js
2025-07-07 09:21:15 +08:00

1 line
6.0 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-03fb653e"],{a035:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return r}));var s=i("b775");function a(t){return Object(s["a"])({url:"/iot/deviceLog/list",method:"get",params:t})}function r(t){return Object(s["a"])({url:"/iot/deviceLog/history",method:"get",params:t})}},f14e:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-form",{ref:"queryForm",attrs:{model:t.queryParams,inline:!0,"label-width":"75px"}},[t.isSubDev?i("el-form-item",{attrs:{"label-width":"120px"}},[i("el-select",{attrs:{placeholder:t.$t("device.device-statistic.932674-1")},on:{change:t.selectSlave},model:{value:t.queryParams.slaveId,callback:function(e){t.$set(t.queryParams,"slaveId",e)},expression:"queryParams.slaveId"}},t._l(t.slaveList,(function(t){return i("el-option",{key:t.slaveId,attrs:{label:t.deviceName+" ("+t.slaveId+")",value:t.slaveId}})})),1)],1):t._e(),i("el-form-item",[i("el-date-picker",{staticStyle:{width:"240px"},attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":t.$t("device.device-statistic.932674-3"),"end-placeholder":t.$t("device.device-statistic.932674-4")},model:{value:t.daterangeTime,callback:function(e){t.daterangeTime=e},expression:"daterangeTime"}})],1),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getListHistory}},[t._v(t._s(t.$t("search")))])],1)],1),t._l(t.staticList,(function(e,s){return i("div",{key:s,staticStyle:{"margin-bottom":"30px"}},[i("el-card",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{shadow:"hover","body-style":{padding:"10px 0px",overflow:"auto"}}},[i("div",{ref:"statisticMap",refInFor:!0,staticStyle:{height:"300px",width:"1080px"}})])],1)}))],2)},a=[],r=(i("4de4"),i("14d9"),i("4e82"),i("b0c0"),i("b680"),i("b64b"),i("d3b7"),i("a035")),n={name:"device-statistic",props:{device:{type:Object,default:null}},watch:{device:{handler:function(t){var e=this;this.deviceInfo=t,this.deviceInfo&&0!=this.deviceInfo.deviceId&&(this.isSubDev=this.deviceInfo.subDeviceList&&this.deviceInfo.subDeviceList.length>0,this.queryParams.slaveId=this.deviceInfo.slaveId,this.queryParams.serialNumber=this.deviceInfo.serialNumber,this.slaveList=t.subDeviceList,this.isSubDev?this.staticList=this.deviceInfo.cacheThingsModel["properties"].filter((function(t){return t.tempSlaveId==e.queryParams.slaveId})):(this.staticList=this.deviceInfo.staticList,this.staticList=this.staticList.sort((function(t,e){return e.order-t.order}))),this.$nextTick((function(){this.getStatistic()})))}}},data:function(){return{loading:!0,deviceInfo:{},staticList:[],chart:[],daterangeTime:[this.getTime(),this.getTime()],queryParams:{serialNumber:null,identity:"",slaveId:void 0},arrayData:[],slaveList:[],isSubDev:!1}},mounted:function(){this.handleDeviceChange(this.device)},methods:{handleDeviceChange:function(t){var e=this;this.deviceInfo=t,this.deviceInfo&&0!=this.deviceInfo.deviceId&&this.staticList.length>0&&(this.isSubDev=this.deviceInfo.subDeviceList&&this.deviceInfo.subDeviceList.length>0,this.queryParams.slaveId=this.deviceInfo.slaveId,this.queryParams.serialNumber=this.deviceInfo.serialNumber,this.slaveList=this.deviceInfo.subDeviceList,this.isSubDev?this.staticList=this.deviceInfo.cacheThingsModel["properties"].filter((function(t){return t.tempSlaveId==e.queryParams.slaveId})):(this.staticList=this.deviceInfo.staticList,this.staticList=this.staticList.sort((function(t,e){return e.order-t.order}))),this.$nextTick((function(){this.getStatistic()})))},getTime:function(){var t=new Date,e=t.getFullYear(),i=t.getMonth()+1,s=t.getDate();return i=i<10?"0"+i:i,s=s<10?"0"+s:s,e+"-"+i+"-"+s},getListHistory:function(){var t=this;this.loading=!0,this.queryParams.serialNumber=this.deviceInfo.serialNumber,null!=this.daterangeTime&&""!=this.daterangeTime?(this.queryParams.beginTime=this.daterangeTime[0]+" 00:00:00",this.queryParams.endTime=this.daterangeTime[1]+" 23:59:59"):(this.queryParams.beginTime=this.getTime()+" 00:00:00",this.queryParams.endTime=this.getTime()+" 23:59:59"),this.queryParams.productId=this.deviceInfo.productId,Object(r["b"])(this.queryParams).then((function(e){if(e.data&&0===Object.keys(e.data).length){for(var i=0;i<t.staticList.length;i++)t.chart[i].setOption({series:[{data:[]}]});t.loading=!1}else for(var s in e.data)for(var a=0;a<t.staticList.length;a++)if(s==t.staticList[a].id){for(var r=[],n=0;n<e.data[s].length;n++){var c=[];c[0]=e.data[s][n].time,c[1]=e.data[s][n].value,r.push(c)}t.chart[a].setOption({series:[{data:r}]})}t.loading=!1}))},getStatistic:function(){for(var t=["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],e=0;e<this.staticList.length;e++){var i;this.$refs.statisticMap[e].style.width=document.documentElement.clientWidth-304+"px",this.chart[e]=this.$echarts.init(this.$refs.statisticMap[e]),i={animationDurationUpdate:3e3,tooltip:{trigger:"axis"},title:{left:"center",text:this.staticList[e].name+"统计 (单位 "+(this.staticList[e].datatype&&void 0!=this.staticList[e].datatype.unit?this.staticList[e].datatype.unit:this.$t("device.device-statistic.932674-7"))+""},grid:{top:"80px",left:"40px",right:"20px",bottom:"60px",containLabel:!0},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}}},xAxis:{type:"time"},yAxis:{type:"value",scale:!0,axisLabel:{formatter:function(t,e){return t.toFixed(2)}}},dataZoom:[{type:"inside",start:0,end:100},{start:0,end:100}],series:[{name:this.staticList[e].name,type:"line",symbol:"none",sampling:"lttb",itemStyle:{color:e>9?t[0]:t[e]},areaStyle:{},data:[]}]},i&&this.chart[e].setOption(i)}},selectSlave:function(){var t=this;this.staticList=this.deviceInfo.cacheThingsModel["properties"].filter((function(e){return e.tempSlaveId==t.queryParams.slaveId})),this.$nextTick((function(){this.getStatistic(),this.getListHistory()}))}}},c=n,o=i("2877"),d=Object(o["a"])(c,s,a,!1,null,null,null);e["default"]=d.exports}}]);