Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-6b51c616.44f36b8c.js

1 line
6.7 KiB
JavaScript
Raw Normal View History

2025-03-10 17:41:02 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b51c616"],{"18de":function(t,e,r){"use strict";r("6762"),r("2fdb"),r("6b54"),r("ac6a");e["a"]={data:function(){return{uwbCount:0,keyArr:["1f","2f","3f","4f","5f"],series:[],total:0,uwbLabelTypeList:{},uwbLabel:{studentUwb:"学生",teacherUwb:"教师",visitorUwb:"访客",other:"其它"}}},created:function(){var t=this;this.uwbCount=0,this.initUwbLabelType().then((function(){t.initUwbWebsocket()}))},activated:function(){var t=this,e=setInterval((function(){t.initUwbLabelType()}),6e4);this.$once("hook:beforeDestroy",(function(){clearInterval(e)})),this.$once("hook:deactivated",(function(){clearInterval(e)}))},methods:{initUwbLabelType:function(){var t=this;return this.$http({url:"/system/index/uwbLabelType",method:"get"}).then((function(e){var r=e.data;if(0!=r.code)return t.$message.error(r.msg);t.uwbLabelTypeList=r.data}))},initUwbWebsocket:function(){var t=this,e=this;try{var r=new WebSocket(window.GLOBAL_CONFIG.UWB_WEBSOCKET);r.onopen=function(){console.log("websocket连接成功");var t=JSON.stringify({type:1,map_id:"14"});r.send(t)},r.onclose=function(){console.log("websocket连接已关闭")},r.onerror=function(){console.log("websocket连接失败")},r.onmessage=function(e){if("heartbeat"!=e.data){var r=JSON.parse(e.data),i=t.uwbLabelTypeList,o={studentUwb:[],teacherUwb:[],visitorUwb:[],other:[]};r.forEach((function(t){var e=t.tid.toString();i.studentUwb.includes(e)?o.studentUwb.push(t):i.teacherUwb.includes(e)?o.teacherUwb.push(t):i.visitorUwb.includes(e)?o.visitorUwb.push(t):o.other.push(t)}));var n=[],a=function(e){var r={};o[e].forEach((function(t){r[t.floor]?r[t.floor]++:r[t.floor]=1}));for(var i=t.keyArr,a=[],s=0;s<i.length;s++)a.push(r[i[s]]||"");n.push({name:t.uwbLabel[e],type:"bar",stack:"总人数",barMaxWidth:20,barMinHeight:20,label:{show:!0,position:"inside"},data:a})};for(var s in o)a(s);JSON.stringify(t.series)!=JSON.stringify(n)&&(t.series=n,t.draw())}},e.$once("hook:beforeDestroy",(function(){r.close()})),e.$once("hook:deactivated",(function(){r.close()})),window.addEventListener("beforeunload",(function(){r.close()}))}catch(i){console.error("链接websocket失败",i),e.uwbCount++,e.uwbCount<5?e.initUwbWebsocket():e.$confirm("建立websocket连接失败无法实时获取楼层人数是否重试?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.uwbCount=0,e.initUwbWebsocket()})).catch((function(){}))}}}}},"99f8":function(t,e,r){},bef7:function(t,e,r){"use strict";r("99f8")},dc6a:function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"academic-building"},[t._m(0),r("div",{staticClass:"academic-building__content1"},[r("div",{staticStyle:{width:"210px"}},[r("span",{staticStyle:{"font-size":"28px",cursor:"pointer"},on:{click:function(e){return t.$router.push({path:"/statistics-accessRecord"})}}},[t._v(t._s(t.dormitoryTotalNums.entrantsCount)+"\n\t\t\t")]),r("span",[t._v("人次")])]),r("div",{staticStyle:{width:"210px","margin-left":"50px"}},[r("span",{staticStyle:{"font-size":"28px",cursor:"pointer"},on:{click:function(e){return t.$router.push({path:"/statistics-accessRecord"})}}},[t._v(t._s(t.dormitoryTotalNums.outCount)+"\n\t\t\t")]),r("span",[t._v("人次")])])]),r("div",{staticClass:"academic-building__title2"},[r("div",{staticClass:"title",staticStyle:{width:"192px"},on:{click:function(e){return t.$router.push({path:"/xwyl-track",query:{url:"index"}})}}},[t._v("\n\t\t\t科研楼实时楼层人数\n\t\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",{ref:"myEchart",class:t.isFullScreen?"chart-maps":"chart-map"})])},o=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"academic-building__title1"},[r("div",{staticClass:"title",staticStyle:{width:"210px"}},[t._v("\n\t\t\t科研楼今<EFBFBD>