FastBee/docker/data/nginx/vue/static/js/chunk-01a4c846.a875b138.js
2025-07-07 09:21:15 +08:00

1 line
13 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-01a4c846"],{"09cb":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n("d3b7");function o(){return new Promise((function(e,t){if("undefined"!==typeof BMap)return e(BMap),!0;window.onBMapCallback=function(){e(BMap)};var n=document.location.protocol;if("https:"==n){var o=document.createElement("meta");o.httpEquiv="Content-Security-Policy",o.content="upgrade-insecure-requests",o.onerror=t,document.head.appendChild(o)}var i=document.createElement("script");i.type="text/javascript",i.src="http://api.map.baidu.com/api?v=2.0&ak=nAtaBg9FYzav6c8P9rF9qzsWZfT8O0PD&s=1&__ec_v__=20190126&callback=onBMapCallback",i.onerror=t,document.head.appendChild(i)}))}},2114:function(e,t,n){var o=n("313e");function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}var r=o.extendComponentView({type:"bmap",render:function(e,t,n){var r=!0,a=e.getBMap(),s=n.getZr().painter.getViewportRoot(),c=e.coordinateSystem,l=function(t,o){if(!r){var i=s.parentNode.parentNode.parentNode,a=[-parseInt(i.style.left,10)||0,-parseInt(i.style.top,10)||0];s.style.left=a[0]+"px",s.style.top=a[1]+"px",c.setMapOffset(a),e.__mapOffset=a,n.dispatchAction({type:"bmapRoam"})}};function d(){r||n.dispatchAction({type:"bmapRoam"})}a.removeEventListener("moving",this._oldMoveHandler),a.removeEventListener("moveend",this._oldMoveHandler),a.removeEventListener("zoomend",this._oldZoomEndHandler),a.addEventListener("moving",l),a.addEventListener("moveend",l),a.addEventListener("zoomend",d),this._oldMoveHandler=l,this._oldZoomEndHandler=d;var p=e.get("roam");p&&"scale"!==p?a.enableDragging():a.disableDragging(),p&&"move"!==p?(a.enableScrollWheelZoom(),a.enableDoubleClickZoom(),a.enablePinchToZoom()):(a.disableScrollWheelZoom(),a.disableDoubleClickZoom(),a.disablePinchToZoom());var u=e.__mapStyle,f=e.get("mapStyle")||{},m=JSON.stringify(f);JSON.stringify(u)!==m&&(i(v)||a.setMapStyle(o.util.clone(f)),e.__mapStyle=JSON.parse(m));var y=e.__mapStyle2,v=e.get("mapStyleV2")||{},h=JSON.stringify(v);JSON.stringify(y)!==h&&(i(v)||a.setMapStyleV2(o.util.clone(v)),e.__mapStyle2=JSON.parse(h)),r=!1}});e.exports=r},"4ae9":function(e,t,n){var o,i=n("313e"),r=i.util,a=i.graphic,s=i.matrix;function c(e,t){this._bmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t,this._projection=new BMap.MercatorProjection}function l(e,t){return t=t||[0,0],r.map([0,1],(function(n){var o=t[n],i=e[n]/2,r=[],a=[];return r[n]=o-i,a[n]=o+i,r[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(r)[n]-this.dataToPoint(a)[n])}),this)}function d(){function e(e){this._root=e}return e.prototype=new BMap.Overlay,e.prototype.initialize=function(e){return e.getPanes().labelPane.appendChild(this._root),this._root},e.prototype.draw=function(){},e}c.prototype.dimensions=["lng","lat"],c.prototype.setZoom=function(e){this._zoom=e},c.prototype.setCenter=function(e){this._center=this._projection.lngLatToPoint(new BMap.Point(e[0],e[1]))},c.prototype.setMapOffset=function(e){this._mapOffset=e},c.prototype.getBMap=function(){return this._bmap},c.prototype.dataToPoint=function(e){var t=new BMap.Point(e[0],e[1]),n=this._bmap.pointToOverlayPixel(t),o=this._mapOffset;return[n.x-o[0],n.y-o[1]]},c.prototype.pointToData=function(e){var t=this._mapOffset;e=this._bmap.overlayPixelToPoint({x:e[0]+t[0],y:e[1]+t[1]});return[e.lng,e.lat]},c.prototype.getViewRect=function(){var e=this._api;return new a.BoundingRect(0,0,e.getWidth(),e.getHeight())},c.prototype.getRoamTransform=function(){return s.create()},c.prototype.prepareCustoms=function(e){var t=this.getViewRect();return{coordSys:{type:"bmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:r.bind(this.dataToPoint,this),size:r.bind(l,this)}}},c.dimensions=c.prototype.dimensions,c.create=function(e,t){var n,i=t.getDom();e.eachComponent("bmap",(function(e){var r=t.getZr().painter,a=r.getViewportRoot();if("undefined"===typeof BMap)throw new Error("BMap api is not loaded");if(o=o||d(),n)throw new Error("Only one bmap component can exist");if(!e.__bmap){var s=i.querySelector(".ec-extension-bmap");s&&(a.style.left="0px",a.style.top="0px",i.removeChild(s)),s=document.createElement("div"),s.style.cssText="width:100%;height:100%",s.classList.add("ec-extension-bmap"),i.appendChild(s);var l=e.get("mapOptions")||{};delete l.mapType;var p=e.__bmap=new BMap.Map(s,l),u=new o(a);p.addOverlay(u),r.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}p=e.__bmap;var f=e.get("center"),m=e.get("zoom");if(f&&m){var y=p.getCenter(),v=p.getZoom(),h=e.centerOrZoomChanged([y.lng,y.lat],v);if(h){var b=new BMap.Point(f[0],f[1]);p.centerAndZoom(b,m)}}n=new c(p,t),n.setMapOffset(e.__mapOffset||[0,0]),n.setZoom(m),n.setCenter(f),e.coordinateSystem=n})),e.eachSeries((function(e){"bmap"===e.get("coordinateSystem")&&(e.coordinateSystem=n)}))};var p=c;e.exports=p},"584f":function(e,t,n){"use strict";n.d(t,"l",(function(){return i})),n.d(t,"q",(function(){return r})),n.d(t,"m",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"k",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"g",(function(){return p})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return f})),n.d(t,"r",(function(){return m})),n.d(t,"o",(function(){return y})),n.d(t,"p",(function(){return v})),n.d(t,"h",(function(){return h})),n.d(t,"a",(function(){return b})),n.d(t,"s",(function(){return g})),n.d(t,"b",(function(){return w})),n.d(t,"e",(function(){return O})),n.d(t,"j",(function(){return _}));var o=n("b775");function i(e){return Object(o["a"])({url:"/iot/device/list",method:"get",params:e})}function r(e){return Object(o["a"])({url:"/iot/device/unAuthlist",method:"get",params:e})}function a(e){return Object(o["a"])({url:"/iot/device/listByGroup",method:"get",params:e})}function s(e){return Object(o["a"])({url:"/iot/device/shortList",method:"get",params:e})}function c(){return Object(o["a"])({url:"/iot/device/all",method:"get"})}function l(e){return Object(o["a"])({url:"/iot/device/"+e,method:"get"})}function d(e){return Object(o["a"])({url:"/iot/device/synchronization/"+e,method:"get"})}function p(e){return Object(o["a"])({url:"/iot/device/getDeviceBySerialNumber/"+e,method:"get"})}function u(){return Object(o["a"])({url:"/iot/device/statistic",method:"get"})}function f(e,t){return Object(o["a"])({url:"/iot/device/assignment?deptId="+e+"&deviceIds="+t,method:"post"})}function m(e){return Object(o["a"])({url:"/iot/device/recovery?deviceIds="+e,method:"post"})}function y(){return Object(o["a"])({url:"",method:"get"})}function v(){return Object(o["a"])({url:"",method:"get"})}function h(e){return Object(o["a"])({url:"/iot/device/runningStatus",method:"get",params:e})}function b(e){return Object(o["a"])({url:"/iot/device",method:"post",data:e})}function g(e){return Object(o["a"])({url:"/iot/device",method:"put",data:e})}function w(e){return Object(o["a"])({url:"/iot/device/"+e,method:"delete"})}function O(e){return Object(o["a"])({url:"/iot/device/generator",method:"get",params:e})}function _(e){return Object(o["a"])({url:"/iot/device/getMqttConnectData",method:"get",params:e})}},"5d99":function(e,t,n){var o=n("313e");function i(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}var r=o.extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var n=this.option;return!(i(e,n.center)&&t===n.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},mapOptions:{},roam:!1}});e.exports=r},"731b":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"centermap"},[e._m(0),n("div",{staticStyle:{height:"640px","background-color":"#0e2e87"}},[n("dv-border-box-8",[n("div",{ref:"map",staticStyle:{height:"600px",width:"760px",padding:"10px"}})])],1)])},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"maptitle"},[n("div",{staticClass:"zuo"}),n("span",{staticClass:"titletext"},[e._v("设备分布图")]),n("div",{staticClass:"you"})])}],r=n("ade3"),a=(n("d81d"),n("14d9"),n("b0c0"),n("09cb")),s=n("584f");n("a00a");var c={data:function(){return{deviceList:[]}},created:function(){this.getAllDevice()},beforeDestroy:function(){this.clearData()},methods:{clearData:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},switper:function(){var e=this;if(!this.timer){var t=function(t){e.getAllDevice()};this.timer=setInterval(t,12e4)}},getAllDevice:function(){var e=this;Object(s["k"])(this.queryParams).then((function(t){e.deviceList=t.rows,e.deviceCount=t.total,e.loadMap(),e.switper()}))},loadMap:function(){var e=this;Object(a["a"])().then((function(){e.getmap()}))},getmap:function(){var e,t=this,n=this.$echarts.init(this.$refs.map);n.on("click",(function(e){e.data.deviceId&&t.$router.push({path:"/iot/device-edit",query:{t:Date.now(),deviceId:e.data.deviceId}})}));var o=function(e,t){for(var n=[],o=0;o<e.length;o++){var i=[e[o].longitude,e[o].latitude];i&&e[o].status==t&&n.push(Object(r["a"])(Object(r["a"])({name:e[o].deviceName,value:i,serialNumber:e[o].serialNumber,status:e[o].status,isShadow:e[o].isShadow,firmwareVersion:e[o].firmwareVersion,networkAddress:e[o].networkAddress,productName:e[o].productName,activeTime:null==e[o].activeTime?"":e[o].activeTime,deviceId:e[o].deviceId},"serialNumber",e[o].serialNumber),"locationWay",e[o].locationWay))}return n};e={tooltip:{trigger:"item",backgroundColor:"rgba(58,73,116,0.7)",textStyle:{color:"rgba(65,235,246,1)"},formatter:function(e){var t='<div style="padding:5px;line-height:28px;">';return t+="设备名称: <span style='color:#FFF'>"+e.data.name+"</span><br />",t+="设备编号: "+e.data.serialNumber+"<br />",t+="设备状态: ",1==e.data.status?t+="<span style='color:#E6A23C'>未激活</span><br />":2==e.data.status?t+="<span style='color:#F56C6C'>禁用</span><br />":3==e.data.status?t+="<span style='color:#67C23A'>在线</span><br />":4==e.data.status&&(t+="<span style='color:#909399'>离线</span><br />"),1==e.data.isShadow?t+="设备影子: <span style='color:#67C23A'>启用</span><br />":t+="设备影子: <span style='color:#909399'>未启用</span><br />",t+="产品名称: "+e.data.productName+"<br />",t+="固件版本: Version "+e.data.firmwareVersion+"<br />",t+="激活时间: "+e.data.activeTime+"<br />",t+="定位方式: ",1==e.data.locationWay?t+="自动定位<br />":2==e.data.locationWay?t+="设备定位<br />":3==e.data.locationWay?t+="自定义位置<br />":t+="未知<br />",t+="所在地址: "+e.data.networkAddress+"<br />",t+="</div>",t}},bmap:{center:[106,37.5],zoom:5,roam:"move",mapStyle:{styleJson:[{featureType:"water",elementType:"all",stylers:{color:"#3863db"}},{featureType:"land",elementType:"all",stylers:{color:"#0e2e87"}},{featureType:"railway",elementType:"all",stylers:{visibility:"off"}},{featureType:"highway",elementType:"all",stylers:{visibility:"off",color:"#fdfdfd"}},{featureType:"highway",elementType:"labels",stylers:Object(r["a"])({visibility:"off"},"visibility","off")},{featureType:"arterial",elementType:"geometry",stylers:{visibility:"off",color:"#fefefe"}},{featureType:"arterial",elementType:"geometry.fill",stylers:{visibility:"off",color:"#fefefe"}},{featureType:"poi",elementType:"all",stylers:Object(r["a"])({visibility:"off"},"visibility","off")},{featureType:"green",elementType:"all",stylers:{visibility:"off"}},{featureType:"subway",elementType:"all",stylers:{visibility:"off"}},{featureType:"manmade",elementType:"all",stylers:{visibility:"off",color:"#d1d1d1"}},{featureType:"local",elementType:"all",stylers:{visibility:"off",color:"#d1d1d1"}},{featureType:"arterial",elementType:"labels",stylers:{visibility:"off"}},{featureType:"boundary",elementType:"all",stylers:{color:"#23cdd8"}},{featureType:"building",elementType:"all",stylers:{visibility:"off",color:"#d1d1d1"}},{featureType:"label",elementType:"labels.text.fill",stylers:{color:"#264194",visibility:"off"}}]}},series:[{type:"scatter",coordinateSystem:"bmap",data:o(this.deviceList,1),symbolSize:10,itemStyle:{color:"#e8fc05"}},{type:"scatter",coordinateSystem:"bmap",data:o(this.deviceList,2),symbolSize:10,itemStyle:{color:"#fc3464"}},{type:"scatter",coordinateSystem:"bmap",data:o(this.deviceList,4),symbolSize:10,itemStyle:{color:"#eee"}},{type:"effectScatter",coordinateSystem:"bmap",data:o(this.deviceList,3),symbolSize:12,showEffectOn:"render",rippleEffect:{brushType:"stroke",scale:5},label:{formatter:"{b}",position:"right",show:!1},itemStyle:{color:"#5de88e",shadowBlur:100,shadowColor:"#333"},zlevel:1}]},e&&n.setOption(e,!0)}}},l=c,d=(n("93c8"),n("2877")),p=Object(d["a"])(l,o,i,!1,null,null,null);t["default"]=p.exports},"93c8":function(e,t,n){"use strict";n("a757")},a00a:function(e,t,n){var o=n("313e"),i=n("4ae9");n("5d99"),n("2114"),o.registerCoordinateSystem("bmap",i),o.registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("bmap",(function(e){var t=e.getBMap(),n=t.getCenter();e.setCenterAndZoom([n.lng,n.lat],t.getZoom())}))}));var r="1.0.0";t.version=r},a757:function(e,t,n){}}]);