Newer
Older
smartwell_front_dz / smartwell / static / js / 7937.be87b69a.js
wangxitong on 11 Sep 2023 17 KB first commit
"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[7937],{20903:(e,t,n)=>{n.r(t),n.d(t,{default:()=>z});n(74916),n(64765);var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"map-gz",staticStyle:{overflow:"hidden",height:"100%"}},[t("mars3d-map",{directives:[{name:"loading",rawName:"v-loading",value:e.mapLoading,expression:"mapLoading"}],attrs:{basemap:e.basemap,"map-key":"gz"},on:{onload:e.onMapload}}),t("div",{staticClass:"cover"},e._l(e.layerName,(function(n,a){return t("div",{key:n,staticClass:"cover-item",style:a>7&&a<10?{width:"100%"}:{}},[a<=6?t("span",{style:{color:e.colors[a],fontWeight:600}},[e._v("—")]):t("span",[t("img",{staticStyle:{width:"17px",height:"17px"},attrs:{src:"/../../../static/images/"+e.layerName[a]+".png"}})]),e._v(" "+e._s(n)+" ")])})),0),t("div",{staticClass:"overview-map-container"},[t("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}}),t("div",{staticStyle:{width:"230px",position:"absolute",top:"0px",right:"10px",display:"flex"}},[t("i",{staticClass:"el-icon-map-location circle_btn",on:{click:function(t){return e.setCenter(e.center)}}}),t("el-slider",{staticStyle:{width:"180px","margin-left":"10px"},model:{value:e.alpha,callback:function(t){e.alpha=t},expression:"alpha"}})],1),t("alarm-list",{attrs:{show:e.showAlarm,data:e.alarmList},on:{"row-click":e.alarmRowClick}}),t("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}}),t("popup-location",{ref:"popupLocation",attrs:{"is3-d":!0,show:e.menus.locationWindowShow},on:{search:e.setCenter,picker:e.pickerPosition,close:e.closePopupLocation}})],1)],1)},i=[],r=n(89584),o=n(66347),s=n(50124),l=n(48534),c=n(95082),h=n(82482),u=(n(21249),n(83710),n(57327),n(41539),n(82772),n(15306),n(89554),n(54747),n(78783),n(33948),n(40561),n(68309),n(32564),n(26699),n(32023),n(92222),n(34553),n(20629)),f=(n(9632),n(9029)),d=(n(64171),n(62566)),p=n(44361),m=(n(34492),n(76204)),w=n(20144),g=n(16596),v=n(87352),y=n(12715),Z=n(13934),k=(n(9669),n(68480),n(22449)),L=n(43945),x=n(55842),b=n(3126),C=(n(57733),n(38224)),S=n(21653),W=(n(42486),n(91751),n(25108)),A=[],O=[],T=[],E=[],I=null,M=null,P=[],D=["雨水附属物","污水附属物","燃气附属物","给水附属物","电信附属物","电力附属物"];const N={name:"Overview3D",components:{Mars3dMap:L.Z,MapSearchComp:Z.Z,PopupLocation:y.Z,PopupDataFilter:v.Z,ToolBox:g.Z,AlarmList:m.Z},data:function(){var e;return e={showAllWells:!1,initWell:!1,showLine:!0,basemap:1113,colors:["#7f0000","#804000","#ff7fe9","#ff0000","#00bfff","#00ff00","#ff0000","#00ff00","#ff0000"],layerName:["雨水管线","污水管线","燃气管线","路灯管线","给水管线","电信管线","电力管线","井盖状态监测仪","燃气智能监测终端","消防栓防盗水监测仪","液位监测仪","噪声记录仪"],baseLayer:"gaode_vec",layers:[{id:"line",name:"管线图层",children:[]},{id:"dev",name:"设备图层",children:[]},{id:"alarm",name:"报警图层"}],checkedLayer:[],center:["114.88","25.68"]},(0,h.Z)(e,"showLine",!1),(0,h.Z)(e,"showModel",!1),(0,h.Z)(e,"type",this.baseConfig.showPointType),(0,h.Z)(e,"refreshType",this.baseConfig.refreshType),(0,h.Z)(e,"searchResultSize",[24,30]),(0,h.Z)(e,"searchResultOffset",[-12,-30]),(0,h.Z)(e,"mapLoading",!0),(0,h.Z)(e,"searchResultIcon",n(2449)),(0,h.Z)(e,"showAlarm",!0),(0,h.Z)(e,"alpha",80),(0,h.Z)(e,"toolShow",!1),(0,h.Z)(e,"menus",{menuList:[{icon:"coordinate",menu:"location",name:"坐标定位"}],dataFilterWindowShow:!1,locationWindowShow:!1}),(0,h.Z)(e,"listQuery",{keywords:"",wellType:"",deptid:""}),(0,h.Z)(e,"count",30),(0,h.Z)(e,"clock",null),(0,h.Z)(e,"showWellType",!1),(0,h.Z)(e,"wellTypeList",[]),(0,h.Z)(e,"alarmList",[]),(0,h.Z)(e,"alarmWells",[]),(0,h.Z)(e,"resultList",[]),(0,h.Z)(e,"searchMarkers",[]),(0,h.Z)(e,"latestAlarmTime",""),(0,h.Z)(e,"alarmFirstAmount",!0),(0,h.Z)(e,"firstAmount",!0),(0,h.Z)(e,"loading",!0),(0,h.Z)(e,"markers",[]),(0,h.Z)(e,"tempMarker",null),(0,h.Z)(e,"bloomEffect",null),(0,h.Z)(e,"loadToken",!1),(0,h.Z)(e,"isAll",!0),e},computed:(0,c.Z)({},(0,u.Se)(["needRefresh","bodyHeight"])),watch:{alpha:function(e){window.map.basemap.opacity=e/100,I.alpha=e/100,this.cameraChange()},needRefresh:function(e){e&&this.refreshAlarm()},"menus.locationWindowShow":function(e){e&&this.$refs.popupLocation.setQuery(this.center)}},beforeCreate:function(){this.$store.dispatch("settings/changeSetting",{key:"breadcrumb",value:!1}),this.$store.dispatch("settings/changeSetting",{key:"tagsView",value:!1})},created:function(){this.fetchWellType(),this.resultList=[],W.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)},methods:{windowResize:function(e,t){var n=document.getElementById("app-header"),a=e-(n?n.clientHeight:56);if(x.Z.getters.tagsView){var i=document.getElementById("tags-view-container");a-=i?i.clientHeight:34}if(b.breadcrumb){var r=document.getElementsByClassName("navbar");a-=r?r[0].clientHeight:48}a-=5,x.Z.dispatch("settings/ChangeHeight",a)},onMapload:function(e,t){window.map=e,this.center=t,I=new k.thing.Underground({alpha:this.alpha/100}),window.map.addThing(I),M=new k.layer.GraphicLayer({name:"报警图层"}),window.map.addLayer(M),this.initPoint(),window.map.on(k.EventType.cameraChanged,this.cameraChange,this)},initLine:function(){var e=this;return(0,l.Z)((0,s.Z)().mark((function t(){var n;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(n=1;n<=6;n++)O.push((0,C.Qk)(n+6,e.colors[n],e.layerName[n],.1,-1.5)),A.push((0,C.jk)(n+6,e.colors[n],e.layerName[n],3));case 1:case"end":return t.stop()}}),t)})))()},initPoint:function(){var e=arguments,t=this;return(0,l.Z)((0,s.Z)().mark((function n(){var a,i,r,o,l;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.length>0&&void 0!==e[0]?e[0]:"",e.length>1&&void 0!==e[1]&&e[1],i=t.checkedLayer.filter((function(e){return e.indexOf("line-")>-1})).map((function(e){return e.substring(5)})).map((function(e){return e.replace("管线","附属物")})),0!==T.length&&T.forEach((function(e){return window.map.removeLayer(e)})),T=[],0!==E.length&&E.forEach((function(e){return window.map.removeLayer(e)})),E=[],r=""===a?"1<>1":"编号 LIKE '%"+a+"%' or 附属物名称 LIKE '%"+a+"%' or 所属道路 LIKE '%"+a+"%'",o=(0,s.Z)().mark((function e(t){var n;return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,S.b)(t,D[t],"../static/model/ys.gltf",1.5,r);case 2:n=e.sent,n.show=0!==i.filter((function(e){return e===D[t]})).length,T.push(n);case 5:case"end":return e.stop()}}),e)})),l=0;case 10:if(!(l<=5)){n.next=15;break}return n.delegateYield(o(l),"t0",12);case 12:l++,n.next=10;break;case 15:t.mapReady();case 16:case"end":return n.stop()}}),n)})))()},initSearch:function(){var e=arguments,t=this;return(0,l.Z)((0,s.Z)().mark((function n(){var a,i,r,o,l;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=e.length>0&&void 0!==e[0]?e[0]:"",e.length>1&&void 0!==e[1]&&e[1],0!==P.length&&P.forEach((function(e){return window.map.removeLayer(e)})),P=[],""!==a){n.next=6;break}return n.abrupt("return");case 6:for(i=t.checkedLayer.filter((function(e){return e.indexOf("line-")>-1})).map((function(e){return e.substring(5)})).map((function(e){return e.replace("管线","附属物")})),r=""===a?"1<>1":"编号 LIKE '%"+a+"%' or 附属物名称 LIKE '%"+a+"%' or 所属道路 LIKE '%"+a+"%'",o=function(e){0!==i.filter((function(t){return t===D[e]})).length&&P.push((0,S.Zs)(D[e],e,"../static/images/标识器.png",r))},l=0;l<=5;l++)o(l);case 10:case"end":return n.stop()}}),n)})))()},initLineLayer:function(e){var t=this;return(0,l.Z)((0,s.Z)().mark((function n(){var a;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=t.layerName.indexOf(e),O.push((0,C.Qk)(a+6,t.colors[a],e,.1,-1.5)),A.push((0,C.jk)(a+6,t.colors[a],e,3));case 3:case"end":return n.stop()}}),n)})))()},initDevLayer:function(e){var t=this;return(0,l.Z)((0,s.Z)().mark((function n(){return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:E.push((0,S.Zs)(e,t.layerName.indexOf(e)+6,"../static/images/"+e+".png","1<>1"));case 1:case"end":return n.stop()}}),n)})))()},cameraChange:function(){if(this.showModel){if(this.alpha>80||window.map.level<=19){this.checkedLayer.filter((function(e){return e.indexOf("line-")>-1})).map((function(e){return e.substring(5)}));T.forEach((function(e){e.show=!1})),O.forEach((function(e){e.show=!1})),this.showModel=!1}}else if(this.alpha<=80&&window.map.level>19){var e=this.checkedLayer.filter((function(e){return e.indexOf("line-")>-1})).map((function(e){return e.substring(5)})),t=e.map((function(e){return e.replace("管线","附属物")}));t.splice(3,1),T.forEach((function(e){e.show=t.indexOf(e.options.name)>-1})),O.forEach((function(t){t.show=e.indexOf(t.options.name)>-1})),this.showModel=!0}},mapReady:function(){var e=this;this.refreshAlarm(),this.fetchWellList(),this.firstAmount=!0,this.toolShow=!0,this.mapLoading=!1,setTimeout((function(){e.countDown()}),1e3)},fetchWellList:function(){var e=this;this.loading=!0,(0,f.vE)().then((function(t){if(e.loading=!1,200===t.code){var n=t.data;if(n.length>0){e.markers=[];var a,i=(0,o.Z)(n);try{for(i.s();!(a=i.n()).done;){var r=a.value;e.markers.push(r)}}catch(s){i.e(s)}finally{i.f()}}}e.loading=!1}))},filterLayer:function(e){var t=this;this.checkedLayer=e;var n=e.filter((function(e){return e.indexOf("line-")>-1})).map((function(e){return e.substring(5)})),a=n.map((function(e){return e.replace("管线","附属物")})),i=e.filter((function(e){return e.indexOf("dev-")>-1})).map((function(e){return e.substring(4)}));T.forEach((function(e){e.show=a.indexOf(e.options.name)>-1})),A.forEach((function(e){e.show=n.indexOf(e.options.name)>-1})),O.forEach((function(e){e.show=n.indexOf(e.options.name)>-1}));var r=A.map((function(e){return e.options.name}));n.forEach((function(e){r.indexOf(e)<=-1&&t.initLineLayer(e)})),E.forEach((function(e){e.show=i.indexOf(e.options.name)>-1}));var o=E.map((function(e){return e.options.name}));i.forEach((function(e){o.indexOf(e)<=-1&&t.initDevLayer(e)})),-1!==e.indexOf("alarm")?M.show=!0:M.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,t={id:"line",name:"管线图层",children:this.layerName.map((function(e){return{id:"line-"+e,name:e}})).splice(0,7)},n={id:"dev",name:"设备图层",children:this.layerName.map((function(e){return{id:"dev-"+e,name:e}})).splice(7,5)};this.layers.splice(0,1,t),this.layers.splice(1,1,n),this.showAllWells?(this.checkedLayer=["line","dev"],t.children.forEach((function(t){return e.checkedLayer.push("line-"+t.name)})),t.children.forEach((function(t){return e.checkedLayer.push("dev-"+t.name)}))):this.checkedLayer=(0,r.Z)(this.checkedLayer),this.wellTypeList.length<=1&&(this.showWellType=!1)},clearSearch:function(){this.searchMarkers=[],this.resultList=[]},search:function(e){""===e?this.initSearch(""):(this.resultList=this.markers.filter((function(t){return!!(t.wellCode.includes(e)||t.wellName.includes(e)||t.position.includes(e))})),this.initSearch(e))},searchPageChange:function(e){this.searchMarkers=e},searchItemClick:function(e){},searchWellLayer:function(e){for(var t=void 0,n=0;n<T.length;n++)if(t=T[n].graphics[0].options.instances.filter((function(t){return t.attr.编号===e}))[0],void 0!==t)return t;W.log(t)},refreshAlarm:function(){var e=this;W.log("refreshAlarm"),this.count=this.baseConfig.refreshTime,this.loading=!0,this.showAlarm&&-1==this.checkedLayer.indexOf("alarm")&&this.checkedLayer.push("alarm"),M.closePopup().clear(),(0,f.u0)().then((function(t){if(200===t.code){if(e.loading=!1,t.data.length>0){var n=t.data[0].alarmTime;W.log(n,"vs",e.latestAlarmTime),e.latestAlarmTime<n&&(!e.alarmFirstAmount&&e.baseConfig.alarmSound&&(W.log("playAudio"),e.playAudio()),e.latestAlarmTime=n)}e.alarmFirstAmount=!1,e.alarmList=t.data,e.alarmWells=[];var a,i=(0,o.Z)(t.data);try{var r=function(){var t=a.value;-1==e.alarmWells.findIndex((function(e){return e.wellCode===t.wellCode}))&&e.alarmWells.push(t)};for(i.s();!(a=i.n()).done;)r()}catch(s){i.e(s)}finally{i.f()}W.log("alarmWells Length",e.alarmWells.length),e.alarmWells.forEach((function(t){var n=e.searchWellLayer(t.wellCode);if(void 0!==n){var a=n.attr||{};a["报警内容"]=t.alarmContent,a["报警数值"]=t.alarmValue,a["报警时间"]=t.alarmTime;var i='<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 r in a)"FID"!==r&&(i+=' <div style="padding: 2px;padding-left: 8px">\n                         <label style="padding-right: 5px;font-weight: 700">'.concat(r,": </label>\n                        ").concat(a[r],"</div>"));i+="</div>";var o=new k.graphic.BillboardPrimitive({allowDrillPick:!0,attr:a,id:"alarm-"+a.编号,position:[a.经度,a.纬度],style:{image:"../static/images/alarm.png",scale:.6,hasPixelOffset:!0,pixelOffsetY:-10,scaleByDistance:!0,scaleByDistance_far:2e4,scaleByDistance_farValue:.6,scaleByDistance_near:0,scaleByDistance_nearValue:1.4},flyTo:!0});o.bindPopup(i),M.addGraphic(o)}}))}}))},openAlarmWindow:function(e,t){var n=this;W.log("openAlarmWindow:"+e),(0,f.lW)(e).then((function(e){if(200===e.code){e.data;var a={wellCode:e.data.wellCode,position:e.data.position,deptName:e.data.deptName,wellTypeName:e.data.wellTypeName,alarms:e.data.alarmList,deep:e.data.deep},i=w["default"].extend({render:function(e){return e(p.Z,{props:{alarmInfo:a}})}}),r=(new i).$mount(),o=new window.AMap.InfoWindow({content:r.$el,offset:[0,n.alarmOffset[1]],autoMove:!0});o.open(window.map,new d.WN(t))}}))},clearInfoWindow:function(){var e=this.map;e.clearInfoWindow()},alarmRowClick:function(e){W.log("alarmRowClick");var t,n=e.wellId,a=(0,o.Z)(this.alarmWells);try{for(a.s();!(t=a.n()).done;){var i=t.value;i.wellId===n&&(this.zoom<16&&(this.zoom=16),this.openAlarmWindow(i.wellId,i.coordinates,!0))}}catch(r){a.e(r)}finally{a.f()}},clickMenu:function(e){this.closeAllPopup();var t=e.menu+"WindowShow",n={};n[t]=!0,Object.assign(this.menus,n)},closeAllPopup:function(){for(var e in this.menus)if(e.indexOf("WindowShow")>-1){var t={};t[e]=!1,Object.assign(this.menus,t)}},closePopupDataFilter:function(){Object.assign(this.menus,{dataFilterWindowShow:!1})},setCenter:function(e){var t={lat:e[1],lng:e[0],alt:1e4,heading:360,pitch:-45};window.map.setCameraView(t)},pickerPosition:function(){var e=this,t=this.searchResultOffset,n=this.searchResultIcon,a=this.searchResultSize,i=this.center,r=new window.AMap.Icon({size:(0,d.Pq)(a),image:n,imageSize:(0,d.Pq)(a)}),o=new window.AMap.Marker({icon:r,position:i,offset:(0,d.HX)(t),draggable:!0});o.on("dragend",(function(t){var n=[t.lnglat.lng,t.lnglat.lat];e.$refs.popupLocation.setQuery(n)})),o.setMap(window.map),this.tempMarker=o},closePopupLocation:function(){Object.assign(this.menus,{locationWindowShow:!1})},fetchDeptList:function(e){W.log("fetchDeptList");var t,n=[e],a=this.$refs.deptSelect.fetchDeptTree(),i=(0,o.Z)(a);try{for(i.s();!(t=i.n()).done;){var r=t.value;r.pid===e&&n.push(r.id)}}catch(u){i.e(u)}finally{i.f()}var s=[];if(a.length>0){var l,c=(0,o.Z)(a);try{for(c.s();!(l=c.n()).done;){var h=l.value;(-1!==n.indexOf(h.id)||-1!==n.indexOf(h.pid))&&s.push(h.id)}}catch(u){c.e(u)}finally{c.f()}}return W.log(s),s}}},R=N;var B=n(1001),_=(0,B.Z)(R,a,i,!1,null,"7338f640",null);const z=_.exports},64171:(e,t,n)=>{n.d(t,{FR:()=>p,FU:()=>u,Ix:()=>o,S6:()=>c,e5:()=>f,fj:()=>l,l7:()=>s,nY:()=>d,xl:()=>h});var a=n(84471),i=n(80129),r=n.n(i);function o(e){return(0,a.Z)({url:"device/list-page",method:"get",params:e})}function s(e){return(0,a.Z)({url:"device/type",method:"get",params:e})}function l(e){return(0,a.Z)({url:"device/model",method:"get",params:{deviceType:e}})}function c(e){return(0,a.Z)({url:"device/add",method:"post",params:e})}function h(e){return(0,a.Z)({url:"device/update",method:"post",params:e})}function u(e){return(0,a.Z)({url:"device/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return r().stringify(e,{indices:!1})}})}function f(e){var t=new FormData;return t.append("file",e),(0,a.Z)({url:"device/batchImport",method:"post",timeout:24e4,headers:{"Content-Type":"multipart/form-data"},data:t})}function d(e){return(0,a.Z)({url:"device/batchExport",method:"get",timeout:12e4,params:e,responseType:"blob"})}function p(e){return(0,a.Z)({url:"/device/offline-list-page",method:"get",params:e})}}}]);