Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-067d245a.c5dab2b3.js

1 line
8.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-067d245a"],{"6e9f":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-card",{staticClass:"aui-card--fill",attrs:{shadow:"never"}},[r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{span:4}},[r("div",{staticClass:"left"},[r("dormitory-tree",{ref:"dormitoryTree",attrs:{type:"electric"},on:{treeFun:e.treeFun}})],1)]),r("el-col",{attrs:{span:20}},[r("div",{staticClass:"right"},[r("el-date-picker",{attrs:{type:"datetimerange","value-format":"yyyy/MM/dd HH:mm:ss","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",clearable:!1},model:{value:e.dateTime,callback:function(t){e.dateTime=t},expression:"dateTime"}}),r("el-button",{staticStyle:{"margin-left":"20px"},on:{click:e.clickSearch}},[e._v("查询")]),r("hr"),""==e.floorName?r("div",{staticStyle:{"font-size":"20px","text-align":"center","margin-top":"24px"}},[e._v("301房间")]):r("div",{staticStyle:{"font-size":"20px","text-align":"center","margin-top":"24px"}},[e._v(e._s(e.floorName)+"房间")]),r("div",{attrs:{id:"electric_echarts"}})],1)])],1)],1)},i=[],o=(r("a481"),r("c7bb")),c={data:function(){return{dateTime:[(new Date).toLocaleString("zh",{year:"numeric",month:"2-digit",day:"2-digit"}).substr(0,10)+" 00:00:00",(new Date).toLocaleString("zh",{year:"numeric",month:"2-digit",day:"2-digit"}).substr(0,10)+" 23:59:59"],treeValue:{df_floorid:"",df_type:"",df_floorname:""},dataForm:{startDate:"",endDate:""},xAxisData:[],ydata:[],floorName:""}},components:{dormitoryTree:o["a"]},activated:function(){var e=this,t=setInterval((function(){e.clickSearch()}),3e4);this.$once("hook:deactivated",(function(){clearInterval(t)})),this.$once("hook:destroyed",(function(){clearInterval(t)}))},watch:{"$store.state.user.defaultCheckedKeys":{handler:function(e){e&&this.clickSearchs(e)},deep:!0,immediate:!0}},methods:{treeFun:function(e){if(this.treeValue=e,"2"!=e.df_type)return this.$message.info("请选择房间查看宿舍电流");this.floorName=e.df_floorname,this.clickSearch()},clickSearch:function(){var e=this;if(!this.dateTime||"0"==this.dateTime.length)return this.$message.error("请选择时间范围");if(!this.$store.state.user.defaultCheckedKeys)return this.$message.error("暂无楼栋数据,无法查询");var t=this.dateTime[0].replace(/\//g,"-"),r=this.dateTime[1].replace(/\//g,"-"),a="";a=""==this.treeValue.df_floorid?this.$store.state.user.defaultCheckedKeys:this.treeValue.df_floorid,this.$http.get("/system/sccurrenthistory/".concat(a,"/").concat(t,"/").concat(r)).then((function(t){var r=t.data;if(0!=r.code)return e.$message.error(r.msg);var a=r.data,i=[],o=[];e.xAxisData=[],i=a.map((function(e){return e.chColltime.slice(11,19)})),o=a.map((function(e){return e.chEcurrent})),e.ydata=o.map((function(e){return e.toFixed(2)})),e.xAxisData=i,e.electricFun()}))},clickSearchs:function(e){var t=this,r=this.dateTime[0].replace(/\//g,"-"),a=this.dateTime[1].replace(/\//g,"-");this.$http.get("/system/sccurrenthistory/".concat(e,"/").concat(r,"/").concat(a)).then((function(e){var r=e.data;if(0!=r.code)return t.$message.error(r.msg);var a=r.data,i=[],o=[];t.xAxisData=[],i=a.map((function(e){return e.chColltime.slice(11,19)})),o=a.map((function(e){return e.chEcurrent})),t.ydata=o.map((function(e){return e.toFixed(2)})),t.xAxisData=i,t.electricFun()}))},electricFun:function(){var e=this.$echarts.init(document.getElementById("electric_echarts"));window.onresize=e.resize;var t={dataZoom:[{type:"inside",start:this.xAxisData.length<10?0:(this.xAxisData.length-10)/this.xAxisData.length*100,end:100,filterMode:"empty"}],title:{},tooltip:{trigger:"axis",itemStyle:{normal:{label:{show:!0}}}},toolbox:{show:!1,feature:{magicType:{type:["line","bar"]}}},xAxis:{type:"category",axisLine:{lineStyle:{color:"#fff"}},data:this.xAxisData},yAxis:{type:"value",name:"电流A",axisLine:{lineStyle:{color:"#fff"}},splitLine:{lineStyle:{type:"dashed"},show:!0}},series:[{name:"电流",type:"line",data:this.ydata,label:{normal:{show:!0,position:"top",textStyle:{color:"white"}}},markPoint:{itemStyle:{normal:{borderColor:"#fab60c",borderWidth:5,label:{show:!0}},emphasis:{borderColor:"#fab60c",borderWidth:5,label:{show:!0}}},data:20},markLine:{symbol:"none",label:{position:"end",formatter:"阈值线"+this.$getDictLabel("electricValue",0)},data:[{silent:!0,lineStyle:{type:"dashes",color:"rgba(238, 99, 99)"},name:"阈值线",yAxis:this.$getDictLabel("electricValue",0)}]},smooth:!0}]};e.setOption(t)}}},n=c,s=(r("ccd2"),r("2877")),l=Object(s["a"])(n,a,i,!1,null,"077f45fc",null);t["default"]=l.exports},"994a":function(e,t,r){},a7fa:function(e,t,r){"use strict";r("994a")},c7bb:function(e,t,r){"use strict";var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",["goout"!=e.type?r("el-input",{attrs:{placeholder:"请输入",clearable:""},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}},[r("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"suffix"},slot:"suffix"})]):e._e(),r("p",{staticClass:"title"}),"room"==e.type?r("el-tree",{ref:"tree",attrs:{data:e.dataList,props:{label:"df_floorname",children:"children"},"highlight-current":"",accordion:"","node-key":"df_floorid","check-on-click-node":"","default-expanded-keys":e.defaultCheckedKeysRoom,"default-checked-keys":e.defaultCheckedKeysRoom,"filter-node-method":e.filterNode},on:{check:e.handleNodeClick}}):"electric"==e.type?r("el-tree",{ref:"tree",attrs:{data:e.dataList,props:{label:"df_floorname",children:"children"},accordion:"","highlight-current":"","node-key":"df_floorid","check-on-click-node":"","default-expanded-keys":e.defaultCheckedKeysElectric,"default-checked-keys":e.defaultCheckedKeysElectric,"filter-node-method":e.filterNode},on:{check:e.handleNodeClick}}):"goout"==e.type?r("el-tree",{ref:"tree",staticClass:"gooutTree",attrs:{data:e.dataList,props:{label:"df_floorname",children:"children"},accordion:"","highlight-current":"","node-key":"df_floorid","check-on-click-node":"","default-expanded-keys":e.defaultCheckedKeysGoout,"default-checked-keys":e.defaultCheckedKeysGoout,"filter-node-method":e.filterNode},on:{check:e.handleNodeClick}}):e._e()],1)},i=[],o=(r("8e6e"),r("ac6a"),r("456d"),r("7f7f"),r("ade3")),c=r("ed08");function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){Object(o["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={props:{type:String},data:function(){return{filterText:"",dataList:[],defaultCheckedKeysElectric:[],defaultCheckedKeysGoout:[],defaultCheckedKeysRoom:[],keyElectric:"",keyGoout:""}},watch:{filterText:function(e){this.$refs.tree.filter(e)}},mounted:function(){this.initTree()},methods:{initTree:function(){var e=this;this.$http.get("/system/scdormitoryfloor/roomTree/0").then((function(t){var r=t.data;if(0==r.code){var a=r.data.map((function(e){return s(s({},e),{},{name:e.df_floorname,id:e.df_floorid,pid:e.df_parentid})}));e.dataList=Object(c["j"])(a),e.keyElectric=e.dataList[0]["children"][0]["children"][0].id,e.keyGoout=e.dataList[0]["children"][0].id;var i=e.dataList[0]["children"][0].df_type,o={df_floorid:e.keyGoout,df_type:i};e.keyRoom=e.dataList[0].id;var n=e.dataList[0].df_type,l={df_floorid:e.keyRoom,df_type:n};e.defaultCheckedKeysElectric.push(e.keyElectric),e.defaultCheckedKeysGoout.push(e.keyGoout),e.defaultCheckedKeysRoom.push(e.keyRoom),e.$store.state.user.defaultCheckedKeys=e.keyElectric,e.$store.state.user.valGoout=o,e.$store.state.user.valRoom=l,e.$nextTick((function(){"electric"==e.type?e.$refs.tree.setCurrentKey(e.keyElectric):"goout"==e.type?e.$refs.tree.setCurrentKey(e.keyGoout):"room"==e.type&&e.$refs.tree.setCurrentKey(e.keyRoom)}))}else e.dataList=[],e.$message.error(data.msg)}))},handleNodeClick:function(e){var t=JSON.parse(JSON.stringify(e)),r={df_floorid:t.df_floorid,df_type:t.df_type,df_floorname:t.df_floorname};this.$emit("treeFun",r)},filterNode:function(e,t){return!e||-1!==t.name.indexOf(e)}}},d=l,f=(r("a7fa"),r("2877")),u=Object(f["a"])(d,a,i,!1,null,"5179f768",null);t["a"]=u.exports},ccd2:function(e,t,r){"use strict";r("f2f3")},f2f3:function(e,t,r){}}]);