Newer
Older
smartwell_front_dz / smartwell / static / js / 868.5893785f.js
wangxitong on 11 Sep 2023 15 KB first commit
"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[868],{55569:(e,a,i)=>{i.r(a),i.d(a,{default:()=>R});i(74916),i(64765);var t=function(){var e=this,a=e._self._c;return a("div",{staticClass:"map-zq",staticStyle:{overflow:"hidden",height:"100%"}},[a("mars3d-map",{directives:[{name:"loading",rawName:"v-loading",value:e.mapLoading,expression:"mapLoading"}],attrs:{basemap:e.basemap,"map-key":"zq"},on:{onload:e.onMapload}}),a("div",{staticClass:"cover"},e._l(e.labelName,(function(i,t){return a("div",{key:i,staticClass:"cover-item"},[0===t?a("span",{staticStyle:{color:"#FF7FE9","font-weight":"900",width:"17px"}},[e._v("—")]):a("span",3===t?[a("img",{staticStyle:{width:"17px",height:"17px"},attrs:{src:"/../../../static/images/标识器.png"}})]:[a("img",{staticStyle:{width:"17px",height:"17px"},attrs:{src:"/../../../static/images/"+e.labelName[t]+".png"}})]),a("span",{staticStyle:{position:"relative",left:"5px"}},[e._v(e._s(i))])])})),0),a("div",{staticClass:"overview-map-container"},[a("map-search-comp",{staticStyle:{"margin-left":"20px",background:"#00000000"},attrs:{list:e.resultList,placeholder:"点位编号/名称/位置"},on:{search:e.search,"change-page":e.searchPageChange,"click-item":e.searchItemClick,clear:e.clearSearch}}),a("div",{staticStyle:{width:"230px",position:"absolute",top:"0px",right:"10px",display:"flex"}},[a("i",{staticClass:"el-icon-map-location circle_btn",on:{click:function(a){return e.setCenter(e.center)}}}),a("el-slider",{staticStyle:{width:"180px","margin-left":"10px"},model:{value:e.alpha,callback:function(a){e.alpha=a},expression:"alpha"}})],1),a("alarm-list",{attrs:{show:e.showAlarm,data:e.alarmList},on:{"row-click":e.alarmRowClick}}),a("tool-box",{staticStyle:{position:"absolute",width:"300px",top:"25px",right:"0px"},attrs:{"is3-d":!0,show:!e.loading,layers:e.layers,"layer-checked":e.checkedLayer,"tool-menu":e.menus.menuList},on:{"change-base-map":e.changeBaseMap,"layer-change":e.filterLayer,"click-menu":e.clickMenu,"close-menu-pop":e.closeAllPopup}}),a("popup-location",{ref:"popupLocation",attrs:{"is3-d":!0,show:e.menus.locationWindowShow},on:{search:e.setCenter,picker:e.pickerPosition,close:e.closePopupLocation}})],1)],1)},n=[],s=i(66347),l=i(89584),o=i(50124),r=i(48534),c=i(95082),h=(i(21249),i(82772),i(83710),i(89554),i(41539),i(54747),i(32564),i(57327),i(68309),i(40561),i(26699),i(32023),i(92222),i(34553),i(20629)),d=(i(9632),i(9029)),p=i(62566),u=(i(44361),i(34492),i(76204)),m=i(16596),f=i(87352),g=i(12715),w=i(13934),y=(i(9669),i(99511)),v=(i(68480),i(22449)),b=i(55842),L=i(3126),k=i(43945),x=i(38224),S=i(21653),D=i(42486),C=i(25108),T=null,M=null,P=[],A=null,W=[],I=null,O=null,E=null;const _={name:"Overview3D",components:{Mars3dMap:k.Z,MapSearchComp:w.Z,PopupLocation:g.Z,PopupDataFilter:f.Z,ToolBox:m.Z,AlarmList:u.Z},data:function(){return{layerName:["燃气阀门井","燃气调压箱","中燃燃气标识器","圣井燃气标识器","正和燃气标识器","华润燃气标识器","华气燃气标识器","井盖状态监测仪","管盯","燃气智能监测终端","激光遥测云台","燃气管线"],labelName:["燃气管线","燃气阀门井","燃气调压箱","中燃-圣井-正和-华润-华气标识器","井盖状态监测仪","管盯","燃气智能监测终端","激光遥测云台"],basemap:1112,baseLayer:"dark",layers:[{id:"well",name:"井图层",children:[]},{id:"line",name:"管线图层",children:[]},{id:"dev",name:"设备图层",children:[]},{id:"alarm",name:"报警图层"}],checkedLayer:[],center:["",""],type:this.baseConfig.showPointType,refreshType:this.baseConfig.refreshType,searchResultSize:[24,30],searchResultOffset:[-12,-30],mapLoading:!0,searchResultIcon:i(2449),showAlarm:!0,alpha:80,toolShow:!1,menus:{menuList:[{icon:"coordinate",menu:"location",name:"坐标定位"}],dataFilterWindowShow:!1,locationWindowShow:!1},listQuery:{keywords:"",wellType:"",deptid:""},count:30,clock:null,showWellType:!1,wellTypeList:[],alarmList:[],alarmWells:[],resultList:[],searchMarkers:[],latestAlarmTime:"",alarmFirstAmount:!0,firstAmount:!0,loading:!0,markers:[],tempMarker:null,bloomEffect:null,isAll:!0}},computed:(0,c.Z)({},(0,h.Se)(["needRefresh","bodyHeight"])),watch:{alpha:function(e){window.map.basemap.opacity=e/100,window.map.level>=19&&this.alpha<90?(I["3D"].show=-1!==this.checkedLayer.indexOf("well-燃气阀门井"),O["3D"].show=-1!==this.checkedLayer.indexOf("well-燃气调压箱")):(I["3D"].show=!1,O["3D"].show=!1)},needRefresh:function(e){C.log("socket报警刷新"),e&&this.refreshAlarm()},"menus.locationWindowShow":function(e){e&&this.$refs.popupLocation.setQuery(this.center)}},created:function(){this.fetchWellType(),this.resultList=[],C.log("create"," 时间(s):",(new Date).getSeconds())},mounted:function(){var e=this;this.$nextTick((function(){e.windowResize(window.innerHeight,window.innerWidth)}))},beforeDestroy:function(){this.$store.dispatch("settings/changeSetting",{key:"breadcrumb",value:!0}),this.$store.dispatch("settings/changeSetting",{key:"tagsView",value:!0}),this.clock&&(clearInterval(this.clock),this.clock=null)},beforeCreate:function(){this.$store.dispatch("settings/changeSetting",{key:"breadcrumb",value:!1}),this.$store.dispatch("settings/changeSetting",{key:"tagsView",value:!1})},methods:{windowResize:function(e,a){var i=document.getElementById("app-header"),t=e-(i?i.clientHeight:56);if(b.Z.getters.tagsView){var n=document.getElementById("tags-view-container");t-=n?n.clientHeight:34}if(L.breadcrumb){var s=document.getElementsByClassName("navbar");t-=s?s[0].clientHeight:48}t-=5,b.Z.dispatch("settings/ChangeHeight",t)},initBaseMap:function(){var e="http://172.20.90.108:8081/geoesb/proxy/5a44607b2e814658b463b76f9675bd3e/9bf164775ad94a18a5324f0eb681deea",a="http://172.20.90.108:8081/geoesb/proxy/4fb75f7491c94356a9dd58a44d0dc57b/9bf164775ad94a18a5324f0eb681deea",i=new y.WebMapTileServiceImageryProvider({url:e+"/Layers/default/Custom_Layers/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"wzmap_map",style:"default",tileMatrixSetID:"default028mm",format:"image/png",tilingScheme:new y.GeographicTilingScheme,tileMatrixLabels:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21"]});T=window.viewer.imageryLayers.addImageryProvider(i),T.alpha=this.alpha/100,i=new y.WebMapTileServiceImageryProvider({url:a+"?service=WMTS&request=GetTile&version=1.0.0&layer=JN2020DOM_05M&style=default&format=image/png&TileMatrixSet=CustomCRS4490ScaleJN2020DOM_05M&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}",layer:"wzmap_map",style:"default",tileMatrixSetID:"default028mm",format:"image/png",tilingScheme:new y.GeographicTilingScheme,tileMatrixLabels:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21"]}),M=window.viewer.imageryLayers.addImageryProvider(i),M.alpha=this.alpha/100,T.show=!1},onMapload:function(e,a){window.map=e,this.center=a,E=new v.thing.Underground({alpha:this.alpha/100}),window.map.addThing(E),A=new v.layer.GraphicLayer({name:"报警图层"}),window.map.addLayer(A),this.initLine(),this.initPoint(),window.map.on(v.EventType.cameraChanged,this.cameraChange,this)},initLine:function(){return(0,r.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:W.push((0,x.Qk)("0","#FF7FE9","燃气管线",.1)),W.push((0,x.jk)("0","#FF7FE9","燃气管线",3));case 2:case"end":return e.stop()}}),e)})))()},initPoint:function(){var e=arguments,a=this;return(0,r.Z)((0,o.Z)().mark((function i(){var t,n,s,l,r;return(0,o.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:for(t=e.length>0&&void 0!==e[0]?e[0]:"",a.mapLoading=!0,null!==I&&(window.map.removeLayer(I["2D"]),window.map.removeLayer(I["3D"])),null!==O&&(window.map.removeLayer(O["2D"]),window.map.removeLayer(O["3D"])),0!==P.length&&P.forEach((function(e){return window.map.removeLayer(e)})),P=[],n=""===t?"1<>1":"编号 LIKE '%"+t+"%' or 附属物名称 LIKE '%"+t+"%' or 所属道路 LIKE '%"+t+"%'",s=""===t?"1<>1":"编号 LIKE '%"+t+"%' or 对象名称 LIKE '%"+t+"%' or 所属道路 LIKE '%"+t+"%'",I=(0,S.a2)("1","燃气阀门井","../static/images/燃气阀门井.png","../static/model/ys.gltf",1.5,n),O=(0,S.a2)("2","燃气调压箱","../static/images/燃气调压箱.png","../static/model/tyx.glb",.1,n),l=2;l<11;l++)P.push((0,S.Zs)(a.layerName[l],l+1,l<=6?"../static/images/标识器.png":"../static/images/"+a.layerName[l]+".png",s));r=a,I["2D"].on(v.EventType.load,(function(e){r.mapReady()}));case 13:case"end":return i.stop()}}),i)})))()},cameraChange:function(){window.map.level>=19&&this.alpha<90?(I["3D"].show=-1!==this.checkedLayer.indexOf("well-燃气阀门井"),O["3D"].show=-1!==this.checkedLayer.indexOf("well-燃气调压箱")):(I["3D"].show=!1,O["3D"].show=!1)},mapReady:function(){var e=this;this.refreshAlarm(),this.fetchWellList(),this.firstAmount=!0,this.toolShow=!0,setTimeout((function(){e.countDown()}),1e3)},filterLayer:function(e){this.checkedLayer=e,-1!==e.indexOf("well-燃气阀门井")?(I["2D"].show=!0,I["3D"].show=!0):(I["2D"].show=!1,I["3D"].show=!1),-1!==e.indexOf("well-燃气调压箱")?(O["2D"].show=!0,O["3D"].show=!0):(O["2D"].show=!1,O["3D"].show=!1),-1!==e.indexOf("line")?W.forEach((function(e){e.show=!0})):W.forEach((function(e){e.show=!1}));var a=e.filter((function(e){return e.indexOf("dev-")>-1})).map((function(e){return e.substring(4)}));P.forEach((function(e){e.show=a.indexOf(e.options.name)>-1})),-1!==e.indexOf("alarm")?A.show=!0:A.show=!1},changeBaseMap:function(e){this.baseLayer=e,this.basemap="dark"===e?1112:"gaode_vec"===e?1111:1113},countDown:function(){var e=this;this.clock=setInterval((function(){e.count--,e.count<0&&(e.refreshAlarm(),e.count=e.baseConfig.refreshTime)}),1e3)},fetchWellType:function(){var e=this,a={id:"well",name:"井图层",children:this.layerName.map((function(e){return{id:"well-"+e,name:e}})).splice(0,2)},i={id:"line",name:"管线图层",children:this.layerName.map((function(e){return{id:"line-"+e,name:e}})).splice(11,1)},t={id:"dev",name:"设备图层",children:this.layerName.map((function(e){return{id:"dev-"+e,name:e}})).splice(2,9)};this.layers.splice(0,1,a),this.layers.splice(1,1,i),this.layers.splice(2,1,t),this.baseConfig.showAllWells?(this.checkedLayer=["well","line","dev"],a.children.forEach((function(a){return e.checkedLayer.push("well-"+a.name)})),i.children.forEach((function(a){return e.checkedLayer.push("line-"+a.name)})),t.children.forEach((function(a){return e.checkedLayer.push("dev-"+a.name)}))):this.checkedLayer=(0,l.Z)(this.checkedLayer),this.wellTypeList.length<=1&&(this.showWellType=!1)},clearSearch:function(){this.searchMarkers=[],this.resultList=[]},search:function(e){""===e?(this.isAll=!0,this.initPoint("")):(this.isAll=!1,this.resultList=this.markers.filter((function(a){return!!(a.wellCode.includes(e)||a.wellName.includes(e)||a.position.includes(e))})),this.initPoint(e))},searchPageChange:function(e){this.searchMarkers=e},searchItemClick:function(e){var a=I["2D"].graphics.filter((function(a){return a.options.id===e.wellCode}))[0];if(void 0!==a){var i={lat:a.options.position[1],lng:a.options.position[0],alt:300,heading:360,pitch:-90};window.map.setCameraView(i),a.openPopup()}else this.$message.warning("当前建设无次井,请联系管理员!")},fetchWellList:function(){var e=this;this.loading=!0,(0,d.ks)().then((function(a){if(e.loading=!1,200===a.code){var i=a.data;if(i.length>0){e.markers=[];var t,n=(0,s.Z)(i);try{for(n.s();!(t=n.n()).done;){var l=t.value;e.markers.push(l)}}catch(o){n.e(o)}finally{n.f()}}}e.loading=!1,e.mapLoading=!1}))},refreshAlarm:function(){var e=this;C.log("refreshAlarm"),this.count=this.baseConfig.refreshTime,this.loading=!0,this.showAlarm&&-1==this.checkedLayer.indexOf("alarm")&&this.checkedLayer.push("alarm"),A.closePopup().clear(),this.alarmWells.forEach((function(a){var i=I["2D"].graphics.filter((function(e){return e.options.id===a.wellCode}))[0];if(void 0!==i){var t=i.options.attr||{};e.$delete(t,"报警内容"),e.$delete(t,"报警数值"),e.$delete(t,"报警时间"),i.setStyle({image:"../static/images/燃气附属物.png",scale:.6,hasPixelOffset:!0,pixelOffsetY:-10,scaleByDistance:!0,scaleByDistance_far:2e4,scaleByDistance_farValue:.6,scaleByDistance_near:0,scaleByDistance_nearValue:1.4}).unbindHighlight(),i.unbindPopup();var n='<div style="font-size: 14px;color: white;font-weight: 500;font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;">';for(var s in t)"FID"!==s&&(n+=' <div style="padding: 2px;padding-left: 8px">\n                         <label style="padding-right: 5px;font-weight: 700">'.concat(s,": </label>\n                        ").concat(t[s],"</div>"));n+="</div>",i.bindPopup(n)}})),(0,d.TJ)().then((function(a){if(200===a.code){if(e.loading=!1,a.data.length>0){var i=a.data[0].alarmTime;C.log(i,"vs",e.latestAlarmTime),e.latestAlarmTime<i&&(!e.alarmFirstAmount&&e.baseConfig.alarmSound&&(C.log("playAudio"),e.playAudio()),e.latestAlarmTime=i)}e.alarmFirstAmount=!1,e.alarmList=a.data,e.alarmWells=[];var t,n=(0,s.Z)(a.data);try{var l=function(){var a=t.value;-1==e.alarmWells.findIndex((function(e){return e.wellCode===a.wellCode}))&&e.alarmWells.push(a)};for(n.s();!(t=n.n()).done;)l()}catch(o){n.e(o)}finally{n.f()}C.log("alarmWells Length",e.alarmWells.length),e.alarmWells.forEach((function(e){var a=I["2D"].graphics.filter((function(a){return a.options.id===e.wellCode}))[0];if(void 0!==a){var i=a.options.attr||{};i["报警内容"]=e.alarmContent,i["报警数值"]=e.alarmValue,i["报警时间"]=e.alarmTime,(0,D.vO)(A,a.options.position,i),a.setStyle({image:"../static/images/alarm.png",scale:.8,hasPixelOffset:!0,pixelOffsetY:-20,scaleByDistance:!0,scaleByDistance_far:2e4,scaleByDistance_farValue:.8,scaleByDistance_near:0,scaleByDistance_nearValue:1.6,visibleDepth:!1}).unbindHighlight(),a.unbindPopup();var t='<div style="font-size: 14px;color: #7ff5ff;font-weight: 500;font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;">';for(var n in i)"FID"!==n&&(t+=' <div style="padding: 2px;padding-left: 8px">\n                         <label style="padding-right: 5px;font-weight: 700">'.concat(n,": </label>\n                        ").concat(i[n],"</div>"));t+="</div>",a.bindPopup(t)}}))}}))},clearInfoWindow:function(){var e=this.map;e.clearInfoWindow()},alarmRowClick:function(e){if(this.isAll){e.wellId;var a=I["2D"].graphics.filter((function(a){return a.options.id===e.wellCode}))[0];if(void 0!==a){var i={lat:a.options.position[1],lng:a.options.position[0],alt:300,heading:360,pitch:-90};window.map.setCameraView(i),a.openPopup()}else this.$message.warning("当前建设无次井,请联系管理员!")}else this.$message.info("当前搜索条件不为空,请重新搜索")},clickMenu:function(e){this.closeAllPopup();var a=e.menu+"WindowShow",i={};i[a]=!0,Object.assign(this.menus,i)},closeAllPopup:function(){for(var e in this.menus)if(e.indexOf("WindowShow")>-1){var a={};a[e]=!1,Object.assign(this.menus,a)}},closePopupDataFilter:function(){Object.assign(this.menus,{dataFilterWindowShow:!1})},setCenter:function(e){var a={lat:e[1],lng:e[0],alt:2e4,heading:360,pitch:-45};window.map.setCameraView(a)},pickerPosition:function(){var e=this,a=this.searchResultOffset,i=this.searchResultIcon,t=this.searchResultSize,n=this.center,s=new window.AMap.Icon({size:(0,p.Pq)(t),image:i,imageSize:(0,p.Pq)(t)}),l=new window.AMap.Marker({icon:s,position:n,offset:(0,p.HX)(a),draggable:!0});l.on("dragend",(function(a){var i=[a.lnglat.lng,a.lnglat.lat];e.$refs.popupLocation.setQuery(i)})),l.setMap(window.map),this.tempMarker=l},closePopupLocation:function(){Object.assign(this.menus,{locationWindowShow:!1})}}},F=_;var Z=i(1001),B=(0,Z.Z)(F,t,n,!1,null,"3f09af49",null);const R=B.exports}}]);