(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-cdbd"],{"0d2t":function(t,e,a){"use strict";var i=a("CYzQ");a.n(i).a},"4qYz":function(t,e,a){"use strict";a.r(e);var i=a("14Xm"),r=a.n(i),o=a("D3Ub"),s=a.n(o),l=a("4R65"),n=a.n(l),p=(a("bMVF"),a("t3Un"));function d(t){return Object(p.a)({url:"/map/server/listPage",method:"get",params:t})}var c=a("MCPi"),u=[23],m={name:"Overview",data:function(){return{listLoading:!1,TianDiTu:{Normal:{Map:"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8",Annotion:"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8"},Satellite:{Map:"https://t{s}.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8",Annotion:"https://t{s}.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8"},Terrain:{Map:"https://t{s}.tianditu.gov.cn/ter_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8",Annotion:"https://t{s}.tianditu.gov.cn/cta_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8"},Subdomains:["0","1","2","3","4","5","6","7"]},map:null,grid:null,showtable:!0,partsOptions:["视频监控","环境监测"],selectParts:["底图","网格","视频监控","环境监测"],listQuery:{offset:1,limit:15},list:[],maps:[],parts:[],baseUrl:"",partsUrl:"",mapUrl:"",multipleSelection:[],iconlist:[],baselayer:[],caselist:[],statisticNum:{work:0,todayCase:0,allCase:0,merchant:0,parts:0},status:{register:0,dispatch:0,disposal:0,disposaling:0}}},mounted:function(){this.init()},methods:{mapChange:function(t){if(t)for(var e=0;e<this.maps.length;e++)this.map.addLayer(this.maps[e]);else for(var a=0;a<this.maps.length;a++)this.map.removeLayer(this.maps[a])},gridChange:function(t){t?this.map.addLayer(this.grid):this.map.removeLayer(this.grid)},partsChange:function(t,e){},tableclick:function(){this.showtable=!this.showtable},removemarkers:function(){for(var t=0;t<this.iconlist.length;t++)this.map.removeLayer(this.iconlist[t]);var e=this.baselayer;this.map.eachLayer(function(t){t!==e[0]&&t!==e[1]&&t.remove()})},setZoom:function(t){if(t.length>0){for(var e,a=t[0][1],i=t[0][1],r=t[0][0],o=t[0][0],s=t.length-1;s>=0;s--)(e=t[s])[1]>a&&(a=e[1]),e[1]<i&&(i=e[1]),e[0]>r&&(r=e[0]),e[0]<o&&(o=e[0]);var l=(parseFloat(a)+parseFloat(i))/2,n=(parseFloat(r)+parseFloat(o))/2,p=this.getZoom(a,i,r,o);this.map.setView({lat:n,lng:l},p)}else this.map.setView({lat:103.388611,lng:35.563611},5)},getZoom:function(t,e,a,i){for(var r=["50","100","200","500","1000","2000","5000","10000","20000","25000","50000","100000","200000","500000","1000000","2000000","5000000"],o=n.a.latLng(a,t).distanceTo(n.a.latLng(i,e)),s=0,l=r.length;s<l;s++)if(r[s]-o>0)return 18-s+2;return 5},init:function(){var t=this;return s()(r.a.mark(function e(){var a,i,o,s,l,p;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(t.listQuery);case 2:for(a=e.sent,t.list=a.data.rows,i=0;i<t.list.length;i++)"GIS地图"===t.list[i].name?t.baseUrl=t.list[i].url:"部件分层URL"===t.list[i].name?t.partsUrl=t.list[i].url:"二维地图URL"===t.list[i].name&&(t.mapUrl=t.list[i].url);for((o=n.a.map("map",{minZoom:2,center:[27.755,116.08],zoom:18,zoomControl:!1,attributionControl:!1,crs:n.a.CRS.EPSG3857})).doubleClickZoom.disable(),t.map=o,window.map=o,i=0;i<=20;i++)s={url:t.baseUrl+t.mapUrl+"/"+i.toString()},t.maps.push(c.featureLayer(s).addTo(o));for(l={url:t.baseUrl+"/arcgis/rest/services/crdt/MapServer/13"},t.grid=c.featureLayer(l).addTo(o),console.log(t.baseUrl+t.partsUrl),i=0;i<u.length;i++)l={url:t.baseUrl+t.partsUrl+"/"+u[i]},p=c.featureLayer(l).addTo(o),console.log(l),p.on("click",function(t){console.log(t),console.log(t.layer.feature.properties);var e='<div style="font-size: 14px;width:200px;"><div style="font-size: 14px;margin-bottom: 8px;"><div>'+t.layer.feature.properties.objectid+'</div></div><div style="padding-bottom: 4px"><col style="padding-right: 5px">大类:</col>'+t.layer.feature.properties.dl+'</div><div style="padding-bottom: 4px"><col style="padding-right: 5px">小类:</col>'+t.layer.feature.properties.objname+'</div><div style="padding-bottom: 4px"><col style="padding-right: 5px">设备状态:</col>'+t.layer.feature.properties.objstate+'</div><div style="padding-bottom: 4px"><col style="padding-right: 5px">权属单位:</col>'+t.layer.feature.properties.deptname1+'</div><div style="padding-bottom: 4px"><col style="padding-right: 5px">安装日期:</col>'+t.layer.feature.properties.ordate+'</div><div style="padding-bottom: 4px"><col style="padding-right: 5px">数据来源:</col>'+t.layer.feature.properties.datasource+'</div><button style="background-color: #409eff;border-color: #409eff;margin-left: 150px;color: white;padding: 5px 8px;font-size: 12px;border-radius: 4px" id="btntrail">预览</button><div>',a=n.a.popup().setContent(e);t.layer.dragging._marker.bindPopup(a,{minWidth:200}).openPopup()}),t.parts.push(p);t.map.setZoom(15);case 15:case"end":return e.stop()}},e,t)}))()},handleSelectionChange:function(t){this.multipleSelection=t}}},h=(a("0d2t"),a("KHd+")),g=Object(h.a)(m,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"leaflet_container",staticStyle:{"background-color":"white"},attrs:{id:"map"}},[a("div",{staticStyle:{"margin-top":"20px",position:"absolute",right:"50px","z-index":"100000"}},[a("el-checkbox-group",{staticStyle:{width:"130px"},model:{value:t.selectParts,callback:function(e){t.selectParts=e},expression:"selectParts"}},[a("el-checkbox",{key:"底图",staticStyle:{"margin-left":"10px",width:"130px","background-color":"white"},attrs:{label:"底图",border:""},on:{change:t.mapChange}}),t._v(" "),a("el-checkbox",{key:"网格",staticStyle:{"margin-left":"10px",width:"130px","background-color":"white"},attrs:{label:"网格",border:""},on:{change:t.gridChange}}),t._v(" "),t._l(t.partsOptions,function(e){return a("el-checkbox",{key:e,staticStyle:{width:"130px","background-color":"white"},attrs:{label:e,border:""},on:{change:t.partsChange}},[t._v(t._s(e))])})],2)],1)])])},[],!1,null,"1ad3604c",null);g.options.__file="overview.vue";e.default=g.exports},CYzQ:function(t,e,a){}}]);