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

1 line
6.7 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-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科研楼今日进入总人次\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",{staticClass:"title",staticStyle:{width:"210px","margin-left":"50px"}},[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"})])])}],n=(r("8e6e"),r("456d"),r("ac6a"),r("7f7f"),r("ade3")),a=r("18de"),s=r("2f62");function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){Object(n["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var u={mixins:[a["a"]],computed:l({},Object(s["b"])(["isFullScreen"])),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=this,e=setInterval((function(){t.aidooreightFun()}),5e3);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={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 r=e.data;if(0!=r.code)return t.$message.error(r.msg);t.dormitoryTotalNums=r.data}))}}},d=u,b=(r("bef7"),r("2877")),f=Object(b["a"])(d,i,o,!1,null,"980eb686",null);e["default"]=f.exports}}]);