Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-225827c8.c2d2ab9d.js

1 line
2.4 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-225827c8"],{"5ddf":function(t,e,i){},bfd5:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"electric-current"},[t._m(0),i("div",{ref:"myEchart",staticClass:"chart-map"})])},a=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"title"},[t._v("\n\t\t宿舍今日用电量TOP10\n\t\t"),i("div",{staticClass:"angle-border left-top-border"}),i("div",{staticClass:"angle-border right-top-border"}),i("div",{staticClass:"angle-border left-bottom-border"}),i("div",{staticClass:"angle-border right-bottom-border"})])}],o=(i("ac6a"),i("7f7f"),{data:function(){return{dataList:[],yAxis:[],series:[]}},mounted:function(){this.electricityFun()},activated:function(){var t=this,e=setInterval((function(){t.electricityFun()}),3e4);this.$once("hook:deactivated",(function(){clearInterval(e)})),this.$once("hook:destroyed",(function(){clearInterval(e)}))},methods:{draw:function(){var t=this.$echarts.init(this.$refs.myEchart),e=e={title:{text:"",subtext:""},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{borderWidth:0,top:"10%",left:0,right:"10%",bottom:"3%",containLabel:!0},xAxis:{name:"kW·h",type:"value",boundaryGap:[0,.01],splitLine:{lineStyle:{color:"#FFF"}},axisLine:{show:!0,lineStyle:{color:"#FFF"}},axisLabel:{show:!0,textStyle:{color:"#fff"}}},yAxis:{name:"房间号",type:"category",splitLine:{lineStyle:{color:"#FFF"}},axisLine:{show:!0,lineStyle:{color:"#FFF"}},axisLabel:{show:!0,textStyle:{color:"#fff"}},data:this.yAxis},series:[{name:"",type:"bar",barWidth:"10px",data:this.series,itemStyle:{normal:{color:"#C40",barBorderRadius:30}}}]};t.setOption(e);var i=this;t.on("click",(function(t){var e=t.name,r="";i.dataList.forEach((function(t){e===t.chNum&&(r=t.floorid)})),sessionStorage.setItem("floorId",r),i.$router.push({name:"dormitoryManage-room"})}))},electricityFun:function(){var t=this;this.$http.get("/system/index/roomCurrentAlarm").then((function(e){var i=e.data;if(0!=i.code)return t.$message.error(i.msg);t.yAxis=[],t.series=[],t.dataList=i.data,i.data.forEach((function(e){t.yAxis.unshift(e.chNum),e.chEcurrent&&(e.chEcurrent=220*e.chEcurrent/12e4,t.series.unshift(e.chEcurrent.toFixed(2)))})),t.draw()}))}}}),s=o,n=(i("e581"),i("2877")),c=Object(n["a"])(s,r,a,!1,null,"172aa95f",null);e["default"]=c.exports},e581:function(t,e,i){"use strict";i("5ddf")}}]);