1 line
7.2 KiB
JavaScript
1 line
7.2 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-eab9238c"],{2668:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"dormitory-electricity-warning"},[r("div",{staticClass:"title",on:{click:function(e){return t.$router.push({path:"warningData-electric"})}}},[t._v("\n\t\t宿舍楼环境预警\n\t\t"),r("div",{staticClass:"angle-border left-top-border"}),r("div",{staticClass:"angle-border right-top-border"}),r("div",{staticClass:"angle-border left-bottom-border"}),r("div",{staticClass:"angle-border right-bottom-border"})]),r("div",{staticClass:"tables"},[r("el-table",{staticStyle:{width:"95%"},attrs:{data:t.electricArr,height:t.isFullScreen?"440":"300"}},[r("el-table-column",{attrs:{prop:"drNum",label:"预警位置",align:"center"}}),r("el-table-column",{attrs:{label:"预警值",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.tfDevicetype?r("span",[e.row.tfaEcurrent>=t.$getDictLabel("thermalImaging","0")?r("span",{staticStyle:{color:"red"}},[t._v(t._s((1*e.row.tfaEcurrent).toFixed(2))+"℃")]):r("span",{staticStyle:{color:"orange"}},[t._v(t._s((1*e.row.tfaEcurrent).toFixed(2))+"℃")])]):r("span",{staticStyle:{color:"red"}},[t._v(t._s(e.row.tfaEcurrent)+"A")])]}}])}),r("el-table-column",{attrs:{prop:"tfaAlarmtime",label:"预警时间",align:"center"}})],1)],1)])},n=[],c=(r("8e6e"),r("ac6a"),r("456d"),r("ade3")),i=r("9b82"),o=r("2f62");function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){Object(c["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var u={mixins:[i["a"]],data:function(){return{}},computed:s({},Object(o["b"])(["isFullScreen"])),activated:function(){localStorage.getItem("electricData")&&(this.electricArr=JSON.parse(localStorage.getItem("electricData"))),this.electricArr=this.electricArr},methods:{}},f=u,d=(r("a5aa"),r("2877")),p=Object(d["a"])(f,a,n,!1,null,"89d5802a",null);e["default"]=p.exports},"28a5":function(t,e,r){"use strict";var a=r("aae3"),n=r("cb7c"),c=r("ebd6"),i=r("0390"),o=r("9def"),l=r("5f1b"),s=r("520a"),u=r("79e5"),f=Math.min,d=[].push,p="split",m="length",b="lastIndex",g=4294967295,h=!u((function(){RegExp(g,"y")}));r("214f")("split",2,(function(t,e,r,u){var y;return y="c"=="abbc"[p](/(b)*/)[1]||4!="test"[p](/(?:)/,-1)[m]||2!="ab"[p](/(?:ab)*/)[m]||4!="."[p](/(.?)(.?)/)[m]||"."[p](/()()/)[m]>1||""[p](/.?/)[m]?function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!a(t))return r.call(n,t,e);var c,i,o,l=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,p=void 0===e?g:e>>>0,h=new RegExp(t.source,u+"g");while(c=s.call(h,n)){if(i=h[b],i>f&&(l.push(n.slice(f,c.index)),c[m]>1&&c.index<n[m]&&d.apply(l,c.slice(1)),o=c[0][m],f=i,l[m]>=p))break;h[b]===c.index&&h[b]++}return f===n[m]?!o&&h.test("")||l.push(""):l.push(n.slice(f)),l[m]>p?l.slice(0,p):l}:"0"[p](void 0,0)[m]?function(t,e){return void 0===t&&0===e?[]:r.call(this,t,e)}:r,[function(r,a){var n=t(this),c=void 0==r?void 0:r[e];return void 0!==c?c.call(r,n,a):y.call(String(n),r,a)},function(t,e){var a=u(y,t,this,e,y!==r);if(a.done)return a.value;var s=n(t),d=String(this),p=c(s,RegExp),m=s.unicode,b=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(h?"y":"g"),v=new p(h?s:"^(?:"+s.source+")",b),O=void 0===e?g:e>>>0;if(0===O)return[];if(0===d.length)return null===l(v,d)?[d]:[];var S=0,w=0,A=[];while(w<d.length){v.lastIndex=h?w:0;var D,j=l(v,h?d:d.slice(w));if(null===j||(D=f(o(v.lastIndex+(h?0:w)),d.length))===S)w=i(d,w,m);else{if(A.push(d.slice(S,w)),A.length===O)return A;for(var I=1;I<=j.length-1;I++)if(A.push(j[I]),A.length===O)return A;w=S=D}}return A.push(d.slice(S)),A}]}))},"4c0c":function(t,e,r){},"9b82":function(t,e,r){"use strict";r("8e6e"),r("ac6a"),r("456d"),r("28a5");var a=r("ade3");function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){Object(a["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}e["a"]={data:function(){return{systemCount:0,electricData:{},electricArr:[],thermaArr:[],temp:{pm:0,temperature:0,humidity:0}}},created:function(){this.systemCount=0,this.initSystemWebsocket()},methods:{initSystemWebsocket:function(){var t=this,e=this;try{var r=new WebSocket(window.GLOBAL_CONFIG["socketURL"]);r.onopen=function(){console.log("websocket连接成功")},r.onclose=function(){console.log("websocket连接已关闭")},r.onerror=function(){console.log("websocket连接失败")},r.onmessage=function(r){var a=JSON.parse(r.data);1==a.type?e.$store.commit("system/UPDATE_ENVIRONMENT_LIST",a.data.map((function(e){return"20103"==e.mbdDevicesn&&(t.temp={pm:e.pm,temperature:e.temperature,humidity:e.humidity}),c(c({},e),{},{coordinate:e.coordinate.split(","),floorAddr:e.floorAddr.split(",")})}))):2==a.type||4==a.type&&a.data.tfDevicetype<4?(console.log(a.type),a.data.tfaEcurrent=(1*a.data.tfaEcurrent).toFixed(2),!localStorage.getItem("electricData")&&a.data.isAlarm?(e.electricArr.unshift(a.data),localStorage.setItem("electricData",JSON.stringify(e.electricArr))):(e.electricArr=JSON.parse(localStorage.getItem("electricData")),e.electricArr=e.electricArr.filter((function(t){return 4==a.type?t.IP!=a.data.IP:t.drNum!=a.data.drNum})),a.data.isAlarm&&e.electricArr.unshift(a.data),0===e.electricArr.length?localStorage.setItem("electricData",JSON.stringify([])):localStorage.setItem("electricData",JSON.stringify(e.electricArr)))):4==a.type&&a.data.tfDevicetype>3&&(a.data.tfaEcurrent=(1*a.data.tfaEcurrent).toFixed(2),!localStorage.getItem("thermaData")&&a.data.isAlarm?(e.thermaArr.unshift(a.data),localStorage.setItem("thermaData",JSON.stringify(e.thermaArr))):(e.thermaArr=JSON.parse(localStorage.getItem("thermaData")),e.thermaArr=e.thermaArr.filter((function(t){return t.IP!=a.data.IP})),a.data.isAlarm&&e.thermaArr.unshift(a.data),0===e.thermaArr.length?localStorage.setItem("thermaData",JSON.stringify([])):localStorage.setItem("thermaData",JSON.stringify(e.thermaArr))))},e.$once("hook:beforeDestroy",(function(){r.close()})),window.addEventListener("beforeunload",(function(){r.close()}))}catch(a){console.error("链接websocket失败:",a),e.systemCount++,e.systemCount<5?e.initSystemWebsocket():e.$confirm("建立websocket连接失败,环境传感器数据无法实时更新!是否重试?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.systemCount=0,e.initSystemWebsocket()})).catch((function(){}))}}}}},a5aa:function(t,e,r){"use strict";r("4c0c")}}]); |