Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-4b0f4e10.4ffea130.js

1 line
4.6 KiB
JavaScript
Raw Permalink 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-4b0f4e10"],{"18de":function(t,e,o){"use strict";o("6762"),o("2fdb"),o("6b54"),o("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 o=e.data;if(0!=o.code)return t.$message.error(o.msg);t.uwbLabelTypeList=o.data}))},initUwbWebsocket:function(){var t=this,e=this;try{var o=new WebSocket(window.GLOBAL_CONFIG.UWB_WEBSOCKET);o.onopen=function(){console.log("websocket连接成功");var t=JSON.stringify({type:1,map_id:"14"});o.send(t)},o.onclose=function(){console.log("websocket连接已关闭")},o.onerror=function(){console.log("websocket连接失败")},o.onmessage=function(e){if("heartbeat"!=e.data){var o=JSON.parse(e.data),i=t.uwbLabelTypeList,n={studentUwb:[],teacherUwb:[],visitorUwb:[],other:[]};o.forEach((function(t){var e=t.tid.toString();i.studentUwb.includes(e)?n.studentUwb.push(t):i.teacherUwb.includes(e)?n.teacherUwb.push(t):i.visitorUwb.includes(e)?n.visitorUwb.push(t):n.other.push(t)}));var r=[],a=function(e){var o={};n[e].forEach((function(t){o[t.floor]?o[t.floor]++:o[t.floor]=1}));for(var i=t.keyArr,a=[],s=0;s<i.length;s++)a.push(o[i[s]]||"");r.push({name:t.uwbLabel[e],type:"bar",stack:"总人数",barMaxWidth:20,barMinHeight:20,label:{show:!0,position:"inside"},data:a})};for(var s in n)a(s);JSON.stringify(t.series)!=JSON.stringify(r)&&(t.series=r,t.draw())}},e.$once("hook:beforeDestroy",(function(){o.close()})),e.$once("hook:deactivated",(function(){o.close()})),window.addEventListener("beforeunload",(function(){o.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(){}))}}}}},3731:function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"academic-building"},[o("div",{staticClass:"academic-building__title1"},[o("div",{staticClass:"title",staticStyle:{width:"192px",cursor:"pointer"},on:{click:function(e){return t.$router.push({path:"/xwyl-track",query:{url:"index"}})}}},[t._v("\n\t\t\t科研楼实时楼层人数\n\t\t\t"),o("div",{staticClass:"angle-border left-top-border"}),o("div",{staticClass:"angle-border right-top-border"}),o("div",{staticClass:"angle-border left-bottom-border"}),o("div",{staticClass:"angle-border right-bottom-border"})])]),o("div",{ref:"myEchart",staticClass:"chart-map"})])},n=[],r=(o("ac6a"),o("7f7f"),o("18de")),a={mixins:[r["a"]],props:{enterTitle:{type:String,default:function(){}},gooutTitle:{type:String,default:function(){}}},data:function(){return{dormitoryTotalNums:{entrantsCount:0,outCount:0}}},mounted:function(){this.aidooreightFun()},activated:function(){var t=setInterval((function(){}),5e3);this.$once("hook:deactivated",(function(){clearInterval(t)})),this.$once("hook:destroyed",(function(){clearInterval(t)}))},methods:{draw:function(){var t=this.$echarts.init(this.$refs.myEchart),e={color:["#45DBF7","#F69846","#FF4343","#AD94FF"],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(t){var e=t[0].name+"<br>";return t.forEach((function(t){t.value?e+=t.marker+" "+t.seriesName+" : "+t.value+"</br>":e+=t.marker+" "+t.seriesName+" : 0 </br>"})),e}},legend:{data:["学生","教师","访客","其它"],textStyle:{color:"#fff"}},grid:{top:"20px",left:0,right:"6%",bottom:0,containLabel:!0},xAxis:[{splitLine:{show:!1},type:"value",show:!1}],yAxis:[{splitLine:{show:!1},axisLine:{show:!1},type:"category",axisTick:{show:!1},data:this.keyArr,axisLabel:{show:!0,textStyle:{color:"#00FFFF"}}}],series:this.series};t.setOption(e)},aidooreightFun:function(){var t=this;this.$http.get("/system/index/aidooreight").then((function(e){var o=e.data;if(0!=o.code)return t.$message.error(o.msg);t.dormitoryTotalNums=o.data}))}}},s=a,c=(o("9021"),o("2877")),u=Object(c["a"])(s,i,n,!1,null,"fced2088",null);e["default"]=u.exports},9021:function(t,e,o){"use strict";o("f903")},f903:function(t,e,o){}}]);