Agriculture-front-end/dist/assets/index.833d6573.js
2023-06-06 10:46:36 +08:00

2 lines
14 KiB
JavaScript

import{_ as xe,r as f,A as ee,B as Me,C as De,D as q,d as P,o as g,c as _,l as i,e as h,w as k,J as V,K as j,x as D,f as m,g as F,a2 as G,y as Se,p as Ie,q as Le}from"./index.68b143c5.js";import{_ as W}from"./close1.45635d81.js";import{_ as Te,a as Pe,b as ke,c as Fe,d as Xe,e as Ze}from"./linesGL.90f708a5.js";import"./index.c9f5bd8b.js";import{a as Ae,b as Oe,c as Ee,g as We}from"./classify.3cc97447.js";const N=X=>(Ie("data-v-21cafe5e"),X=X(),Le(),X),Ne={class:"center"},Re=N(()=>i("div",{style:{width:"100%",height:"100%"},id:"cesiumContainer"},null,-1)),ze={class:"leftWra"},Be={class:"leftTop"},Qe=N(()=>i("div",{class:"title"},[i("span",null,"\u6444\u50CF\u5934\u9009\u62E9")],-1)),qe={class:"search"},Ve={class:"cameraDiv"},je={key:0,src:W,alt:""},Ge={key:0,class:"imgrotate",src:W,alt:""},Je={class:"rightWra"},Ue={class:"rightTop"},Ye=N(()=>i("div",{class:"title"},[i("span",null,"\u89C6\u9891\u76D1\u63A7")],-1)),He={class:"videoDiv"},$e={key:0,src:W,alt:""},Ke={key:0,class:"imgrotate",src:W,alt:""},et=Se('<div class="tool" data-v-21cafe5e><span data-v-21cafe5e><img src="'+Te+'" alt="" data-v-21cafe5e></span><span data-v-21cafe5e><img src="'+Pe+'" alt="" data-v-21cafe5e></span><span data-v-21cafe5e><img src="'+ke+'" alt="" data-v-21cafe5e></span><span data-v-21cafe5e><img src="'+Fe+'" alt="" data-v-21cafe5e></span><span data-v-21cafe5e><img src="'+Xe+'" alt="" data-v-21cafe5e></span><span data-v-21cafe5e><img src="'+Ze+'" alt="" data-v-21cafe5e></span></div>',1),tt={id:"popup"},at={id:"pop"},rt={key:0},ot=N(()=>i("div",null,"\u6751\u540D\uFF1A",-1)),st={__name:"index",setup(X){let o=f(null);f(null),f(null);const te=f("370211");f(null);let S=ee({arr:[],brr:[],crr:[]});const J=f({name:"",value:""}),ae=f([]),re=f(!1);let w=f(!0),x=f(!0);const U=f("");let oe=f(["\u6444\u50CF\u5934\u540D\u79F01","\u6444\u50CF\u5934\u540D\u79F01","\u6444\u50CF\u5934\u540D\u79F01"]);const se=[{value:"Option1",label:"Option1"},{value:"Option2",label:"Option2"},{value:"Option3",label:"Option3"},{value:"Option4",label:"Option4"},{value:"Option5",label:"Option5"}],R=ee({width:"100%",height:"100%",color:"#409eff",title:"",src:"https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4",muted:!1,webFullScreen:!1,speedRate:["0.75","1.0","1.25","1.5","2.0"],autoPlay:!1,loop:!1,mirror:!1,ligthOff:!1,volume:.3,control:!0,controlBtns:["quality","volume","fullScreen"]});Me(()=>S.arr,e=>{console.log("val:",e)});var Y={title:[]};let z={\u5C0F\u9EA6:[],\u7389\u7C73:[],\u5927\u8C46:[],\u5730\u74DC:[],\u82B1\u751F:[],\u84DD\u8393:[],\u8336\u53F6:[],\u9A6C\u94C3\u85AF:[],\u767D\u83DC\u548C\u841D\u535C:[],\u5176\u4ED6:[]};De(()=>{ve(),ye(),ge(),_e(),ie(),ce()});const le={url:"http://{s}.tianditu.gov.cn/img_c/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=31091965e263284a501a723b8909f405",layer:"tdtCva",style:"default",format:"tiles",tileMatrixSetID:"c",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],tilingScheme:new Cesium.GeographicTilingScheme,tileMatrixLabels:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],maximumLevel:18};Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiYzcwZmJmNi02MzQ5LTQ1MGEtODgzMy0yZTZiZGExY2MzMGMiLCJpZCI6MTAxOTgsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJnYyJdLCJpYXQiOjE1ODEzMDgxNTR9.NeJU4yfUi-SnLrNDOBYsQgmiSh3B4axCTi1m84Qw99c";function ie(){o=new Cesium.Viewer("cesiumContainer",{baseLayerPicker:!1,shouldAnimate:!0,infoBox:!1,animation:!1,timeline:!1,geocoder:!1,homeButton:!1,navigationHelpButton:!1,selectionIndicator:!1,fullscreenButton:!1,terrainProvider:new Cesium.EllipsoidTerrainProvider({}),sceneModePicker:!1,contextOptions:{webgl:{alpha:!0}},imageryProvider:new Cesium.WebMapTileServiceImageryProvider({...le})}),o.cesiumWidget.creditContainer.style.display="none",he("shuzisannong:huangdaoqu_town","tl"),o.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:0}),ue(),be()}function H(e,t,a){e.forEach(r=>{let l=[];r[0].forEach(n=>{l.push(n[0]),l.push(n[1])}),o.entities.add({name:t,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(l),width:6,material:new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:a?Cesium.Color.fromCssColorString(a):Cesium.Color.fromBytes(250,128,114)}),clampToGround:!0}})})}function ne(e){return e>48e6?0:e>24e6?1:e>12e6?2:e>6e6?3:e>3e6?4:e>15e5?5:e>75e4?6:e>375e3?7:e>187500?8:e>93750?9:e>46875?10:e>23437.5?11:e>11718.75?12:e>5859.38?13:e>2929.69?14:e>1464.84?15:e>732.42?16:e>366.21?17:18}function ce(){q({url:serverAPI.geoserverUrl+"/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afarmland&maxFeatures=50&outputFormat=application%2Fjson",method:"get"}).then(e=>{console.log("\u519C\u7530\uFF1A",e),ae.value=e.data.features}).catch(e=>{})}let v=f({label:[]}),Z="";function ue(){var e=new Cesium.ScreenSpaceEventHandler(o.canvas);e.setInputAction(function(t){var a=o.camera.getPickRay(t.position),r=o.scene.globe.pick(a,o.scene);if(r){let l=Cesium.Cartographic.fromCartesian(r);if(l){let n=new Cesium.Cartesian2,u=o.camera.positionCartographic.height,s=ne(u);const d=o.imageryLayers._layers,C=d.findIndex(c=>c._imageryProvider._layers&&c._imageryProvider._layers==="shuzisannong:huangdaoqu_town");if(C>-1){const c=d[C];let p=c._imageryProvider;if(p&&p.ready&&p._layers&&c.show===!0){n=p.tilingScheme.positionToTileXY(l,s,n);let L=p.pickFeatures(n.x,n.y,s,l.longitude,l.latitude);L&&L.then(T=>{if(T.length>0){let y=T[0];if(y.properties&&y.properties.XZDM)if(console.log("XZDM:",Z),console.log("newData.properties.XZDM:",y.properties.XZDM),Z!==y.properties.XZDM){re.value=!0,Z=y.properties.XZDM,te.value=Z;let b=y.data;o.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(b.bbox[0],b.bbox[1],b.bbox[2],b.bbox[3]),duration:2}),I("townLine"),H(b.geometry&&b.geometry.coordinates,"townLine","yellow"),O(["village_CQL"]),pe(`XZDM=${y.properties.XZDM}`,"village_CQL");let E=o.entities._entities._array;for(var M=E.length-1;M>=0;M--)if(E[M]._name&&E[M]._name==="point"+y.properties.XZDM){let we=E[M]._info;v.value=we,console.log(v.value,"------------------"),K(t.position),o.scene.postRender.addEventListener(B)}I("villageLine"),A=""}else de(d,n,s,l,t);else O(["village_CQL"]),Q()}})}}}}},Cesium.ScreenSpaceEventType.LEFT_CLICK)}let A="";function de(e,t,a,r,l){const n=e.findIndex(u=>u._imageryProvider._layers&&u._imageryProvider._layers==="shuzisannong:huangdaoqu_village");if(n>-1){const u=e[n];let s=u._imageryProvider;if(s&&s.ready&&s._layers&&u.show===!0){t=s.tilingScheme.positionToTileXY(r,a,t);let d=s.pickFeatures(t.x,t.y,a,r.longitude,r.latitude);d&&d.then(C=>{if(C.length>0){let c=C[0];if(console.log(c),o.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(c.data.bbox[0],c.data.bbox[1],c.data.bbox[2],c.data.bbox[3]),duration:2}),c.properties&&c.properties.XZQDM&&A!==c.properties.XZQDM){A=c.properties.XZQDM;let p=c.data;if(I("villageLine"),H(p.geometry&&p.geometry.coordinates,"villageLine","yellow"),c.properties.XZQDM==="370211104217"){const L=Cesium.Rectangle.fromDegrees(p.bbox[0],p.bbox[1],p.bbox[2],p.bbox[3]),T=Cesium.Rectangle.center(L);let M=Cesium.Math.toDegrees(T.longitude),y=Cesium.Math.toDegrees(T.latitude),b={lon:M,lat:y,...p.properties,label:[{crop:"\u8336\u53F6",Shape_Area:2820},{crop:"\u5927\u8C46",Shape_Area:2767},{crop:"\u82B1\u751F",Shape_Area:62356},{crop:"\u84DD\u8393",Shape_Area:5443},{crop:"\u5730\u74DC",Shape_Area:897},{crop:"\u5C0F\u9EA6",Shape_Area:20111}]};v.value=b,K(l.position),o.scene.postRender.addEventListener(B)}}}})}}}function pe(e,t){let a=new Cesium.WebMapServiceImageryProvider({url:`${serverAPI.geoserverUrl}/shuzisannong/wms`,layers:"shuzisannong:huangdaoqu_village",parameters:{service:"WMS",format:"image/png",transparent:!0,CQL_FILTER:e}});a.customName=t,o.imageryLayers.addImageryProvider(a)}function O(e,t){if(o){const a=o.imageryLayers._layers;for(let r=a.length-1;r>=0;r--)e.forEach(l=>{a[r]._imageryProvider&&a[r]._imageryProvider.customName&&(t?a[r]._imageryProvider.customName.indexOf(l)>-1&&o.imageryLayers.remove(a[r]):a[r]._imageryProvider.customName===l&&o.imageryLayers.remove(a[r]))})}}function I(e){if(o){let a=o.entities._entities._array;for(var t=a.length-1;t>=0;t--)a[t]._name&&a[t]._name===e&&o.entities.remove(a[t])}}function fe(){if(w.value=!w.value,w.value){let e=document.querySelector(".leftWra");e&&(e.style.transform="translate(0,0)")}else{let e=document.querySelector(".leftWra");e&&(e.style.transform="translate(-107%,0)")}}function me(){if(x.value=!x.value,x.value){let e=document.querySelector(".rightWra");e.style.transform="translate(0,0)"}else{let e=document.querySelector(".rightWra");e.style.transform="translate(107%,0)"}}const ve=()=>{Ae({time:"2023-04-25",subregion:"1",parent:"\u9EC4\u5C9B\u533A"}).then(e=>{console.log(e)})},ge=()=>{Oe().then(e=>{S.arr=e.features,S.arr.unshift({bbox:[119.5091,35.5671,120.3285,36.1455],properties:{XZDM:"370211",XZMC:"\u5168\u90E8"}});let t=[...e.features],a=[];t.splice(0,1),t.forEach(r=>{a.push(r.properties.XZMC)}),Y.title=[...Object.values(a)]})},_e=()=>{Ee().then(e=>{S.brr=e.features})},ye=()=>{We().then(e=>{S.crr=e.features,Y.title.forEach((t,a)=>{let r=e.features.map(l=>{if(t===l.properties.town)return l.properties});Object.keys(z).forEach(l=>{const n=r.findIndex(u=>u&&u.crop===l);n>-1?z[l].push(r[n].Shape_Area):z[l].push(null)})})})};function he(e,t){let a=new Cesium.WebMapServiceImageryProvider({url:serverAPI.geoserverUrl+"/shuzisannong/wms?",layers:e,parameters:{service:"WMS",format:"image/png",transparent:!0}});a.customName=t;let r=o.imageryLayers.addImageryProvider(a);t.indexOf("gbznt")>-1&&(o.imageryLayers.lowerToBottom(r),o.imageryLayers.raise(r))}function Ce(){let e=$.value;console.log("fl:",e),q({url:serverAPI.geoserverUrl+"/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Ahuangdaoqu_town&maxFeatures=50&outputFormat=application%2Fjson"}).then(t=>{console.log("res1111:",t),t.data.features.forEach((r,l)=>{const n=Cesium.Rectangle.fromDegrees(r.bbox[0],r.bbox[1],r.bbox[2],r.bbox[3]),u=Cesium.Rectangle.center(n);let s=Cesium.Math.toDegrees(u.longitude),d=Cesium.Math.toDegrees(u.latitude);r.properties.XZDM==="370211011"?(s=120.0863,d=35.941):r.properties.XZDM==="370211003"&&(s=120.243682,d=35.97123201);const C=e[r.properties.XZMC];let c=[];C&&(c=C.map((p,L)=>p.properties)),o.entities.add({name:"point"+r.properties.XZDM,position:Cesium.Cartesian3.fromDegrees(s,d),point:new Cesium.PointGraphics({show:!0,pixelSize:10,color:Cesium.Color.fromCssColorString("rgba(255, 255, 26, 1)"),outlineColor:new Cesium.Color(0,0,0,0),outlineWidth:0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND}),info:{label:c,...r.properties,lon:s,lat:d}})})}).catch(t=>{})}let $=f({});function be(){q({url:serverAPI.geoserverUrl+"/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afenlei&maxFeatures=137&outputFormat=application%2Fjson"}).then(e=>{let t=e.data.features,a={};t.forEach(r=>{let l=r.properties.town;a[l]?a[l].push(r):a[l]=[r]}),$.value=a,Ce()}).catch(e=>{})}function B(){if(v.value&&v.value.lon&&v.value.lat){const t=Cesium.Cartesian3.fromDegrees(Number(v.value.lon),Number(v.value.lat),0);var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(o.scene,t);if(Cesium.defined(e)){const a=document.getElementById("pop");a.style.top=e.y-10+"px",a.style.left=e.x+10+"px"}}}function Q(){A="",O(["village_CQL"]),I("villageLine"),I("townLine");const e=document.getElementById("pop");e.style.display="none",o.scene.postRender.removeEventListener(B),O(["gbznt"],!0)}function K(e){console.log(e);const t=document.getElementById("pop");t.style.display="block",t.style.position="absolute",t.style.top=e.y-10+"px",t.style.left=e.x+10+"px",t.style.zIndex=99}return(e,t)=>{const a=P("el-input"),r=P("el-option"),l=P("el-select"),n=P("el-tooltip"),u=P("vue3VideoPlay");return g(),_("div",Ne,[Re,i("div",ze,[i("div",Be,[Qe,i("div",qe,[h(a,{class:"seach_input",modelValue:e.input,"onUpdate:modelValue":t[0]||(t[0]=s=>e.input=s),placeholder:"\u8BF7\u8F93\u5165\u8981\u7B5B\u9009\u6444\u50CF\u5934\u540D",clearable:""},null,8,["modelValue"]),h(l,{"popper-class":"selectCity",class:"seach_input",modelValue:U.value,"onUpdate:modelValue":t[1]||(t[1]=s=>U.value=s),placeholder:"\u8BF7\u9009\u62E9\u8981\u7B5B\u9009\u8857\u9053"},{default:k(()=>[(g(),_(V,null,j(se,s=>h(r,{key:s.value,label:s.label,value:s.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),i("div",Ve,[(g(!0),_(V,null,j(m(oe),(s,d)=>(g(),_("p",{key:d},D(s),1))),128))])]),i("div",{class:"leftFoldDiv",onClick:t[2]||(t[2]=s=>fe())},[h(n,{class:"box-item","show-arrow":!1,disabled:m(w),"hide-after":"0","show-after":"200",effect:"dark",content:"\u5C55\u5F00",placement:"top"},{default:k(()=>[m(w)?F("v-if",!0):(g(),_("img",je))]),_:1},8,["disabled"]),h(n,{disabled:!m(w),"show-arrow":!1,class:"box-item","show-after":"200","hide-after":"0",effect:"dark",content:"\u6536\u8D77",placement:"top"},{default:k(()=>[m(w)?(g(),_("img",Ge)):F("v-if",!0)]),_:1},8,["disabled"])])]),i("div",Je,[i("div",Ue,[Ye,i("div",He,[i("div",null,[h(u,G(R,{poster:"https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"}),null,16)]),i("div",null,[h(u,G(R,{poster:"https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"}),null,16)]),i("div",null,[h(u,G(R,{poster:"https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"}),null,16)])])]),i("div",{class:"rightFoldDiv",onClick:t[3]||(t[3]=s=>me())},[h(n,{disabled:!m(x),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u6536\u8D77",placement:"top"},{default:k(()=>[m(x)?(g(),_("img",$e)):F("v-if",!0)]),_:1},8,["disabled"]),h(n,{disabled:m(x),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u5C55\u5F00",placement:"top"},{default:k(()=>[m(x)?F("v-if",!0):(g(),_("img",Ke))]),_:1},8,["disabled"])])]),et,i("div",tt,[i("div",null,D(J.value.name)+"\uFF1A",1),i("div",null,D(J.value.value)+"\u4EA9",1),i("div",{class:"cancel",onClick:Q},"X")]),i("div",at,[(g(!0),_(V,null,j(m(v).label,(s,d)=>(g(),_("div",{key:d},[i("div",null,D(s.crop)+"\uFF1A",1),i("div",null,D((s.Shape_Area/666.67).toFixed(2))+" \u4EA9",1)]))),128)),m(v).XZQMC?(g(),_("div",rt,[ot,i("div",null,D(m(v).XZQMC),1)])):F("v-if",!0),i("div",{class:"cancel",onClick:Q},"X")])])}}},dt=xe(st,[["__scopeId","data-v-21cafe5e"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/plough/VideoSurveillance/index.vue"]]);export{dt as default};