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

1 line
4.9 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 s})),i.d(e,"b",(function(){return r}));var a=i("b775");function s(t){return Object(a["a"])({url:"/iot/deviceLog/list",method:"get",params:t})}function r(t){return Object(a["a"])({url:"/iot/deviceLog/history",method:"get",params:t})}},f14e:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{"padding-left":"20px"}},[i("el-row",[i("el-col",{attrs:{span:24}},[i("el-form",{ref:"queryForm",attrs:{model:t.queryParams,inline:!0,"label-width":"75px"}},[t.isSubDev?i("el-form-item",{attrs:{label:"请选择设备从机:","label-width":"120px"}},[i("el-select",{attrs:{placeholder:"请选择设备从机"},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",{attrs:{label:"时间范围"}},[i("el-date-picker",{staticStyle:{width:"240px"},attrs:{size:"small","value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},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",size:"mini"},on:{click:t.getListHistory}},[t._v("查询")])],1)],1)],1),i("el-col",{attrs:{span:23}},t._l(t.staticList,(function(e,a){return i("div",{key:a,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)})),0)],1)],1)},s=[],r=(i("4de4"),i("d3b7"),i("14d9"),i("b0c0"),i("a035")),n={name:"device-statistic",props:{device:{type:Object,default:null}},watch:{device:function(t,e){var i=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==i.queryParams.slaveId})):this.staticList=this.deviceInfo.staticList,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(){},methods:{getTime:function(){var t=new Date,e=t.getFullYear(),i=t.getMonth()+1,a=t.getDate();return i=i<10?"0"+i:i,a=a<10?"0"+a:a,e+"-"+i+"-"+a},getListHistory:function(){var t=this;this.loading=!0,this.queryParams.serialNumber=this.queryParams.slaveId?this.deviceInfo.serialNumber+"_"+this.queryParams.slaveId:this.deviceInfo.serialNumber,null!=this.daterangeTime&&""!=this.daterangeTime&&(this.queryParams.beginTime=this.daterangeTime[0],this.queryParams.endTime=this.daterangeTime[1]+" 23:59"),Object(r["b"])(this.queryParams).then((function(e){for(var i in e.data)for(var a=0;a<t.staticList.length;a++)if(i==t.staticList[a].id){for(var s=[],r=0;r<e.data[i].length;r++){var n=[];n[0]=e.data[i][r].time,n[1]=e.data[i][r].value,s.push(n)}t.chart[a].setOption({series:[{data:s}]})}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-510+"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:"无")+""},grid:{top:"80px",left:"40px",right:"20px",bottom:"60px",containLabel:!0},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}}},xAxis:{type:"time"},yAxis:{type:"value"},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()}))}}},l=n,o=i("2877"),c=Object(o["a"])(l,a,s,!1,null,null,null);e["default"]=c.exports}}]);