import{_ as De,r as m,z as K,A as Me,B as Le,C as Z,d as b,o as L,c as z,l,e as f,w as y,m as k,g as A,x as I,F as Ie,D as Pe,f as N,k as Te,y as re,p as Fe,q as Ee}from"./index.276e09af.js";import oe from"./downloads.e955445d.js";import{g as Oe,a as ze,b as Ae,c as Be,u as ee,_ as Ve,d as We,e as Xe,f as Ze,h as Ne,i as Re}from"./linesGL.4533f4ed.js";import{i as te}from"./index.c9f5bd8b.js";const _=P=>(Fe("data-v-d061be2f"),P=P(),Ee(),P),Ge={class:"center"},Qe=_(()=>l("div",{style:{width:"100%",height:"100%"},id:"cesiumContainer"},null,-1)),Ue={class:"rightWra"},qe={class:"rightTop"},je=_(()=>l("div",{class:"title"},[l("span",null,"\u4F4D\u7F6E\u5B9A\u4F4D")],-1)),Je=_(()=>l("div",{class:"depth"},[l("p",{class:"SelectedDiv"},"\u5730\u540D"),l("p",null,"\u884C\u653F\u533A"),l("p",null,"\u7ECF\u7EAC\u5EA6")],-1)),Ye={class:"seach_button"},$e={class:"rightbottom"},He=re('
\u4FE1\u606F\u7EDF\u8BA1
\u4FE1\u606F\u603B\u89C8
\u533A\u5212
\u9EC4\u5C9B\u533A\u57FA\u672C\u519C\u7530
12364\u4EA9 ',2),Ke={class:"chart_div"},et={class:"chart_div_title"},tt=_(()=>l("span",null,"\u57FA\u672C\u519C\u7530\u9762\u79EF\u53CA\u5360\u6BD4",-1)),rt=_(()=>l("img",{src:oe,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1)),ot={class:"chart_div"},at={class:"chart_div_title"},lt=_(()=>l("span",null,"\u4E24\u533A\u5212\u5B9A\u9762\u79EF\u53CA\u5360\u6BD4",-1)),st=_(()=>l("img",{src:oe,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1)),nt=re('',1),it={id:"popup"},dt={id:"pop"},ct={key:0},ut=_(()=>l("div",null,"\u6751\u540D\uFF1A",-1)),pt={class:"mt-4"},mt={__name:"index",setup(P){let n=m(null);const ae=m("370211");m(null);let D=K({arr:[],brr:[],crr:[]});K({arr:[]});const R=m({name:"",value:""});m([]);const le=m([]),B=m(!1);m(!0);let V=m(!0);const G=m(""),Q=m("null"),U=m("null");Me(()=>D.arr,e=>{console.log("val:",e)});var q={title:[]};let W={\u5C0F\u9EA6:[],\u7389\u7C73:[],\u5927\u8C46:[],\u5730\u74DC:[],\u82B1\u751F:[],\u84DD\u8393:[],\u8336\u53F6:[],\u9A6C\u94C3\u85AF:[],\u767D\u83DC\u548C\u841D\u535C:[],\u5176\u4ED6:[]};Le(()=>{fe(),he(),ge(),ve(),ne(),de(),ye(),_e()});const se={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 ne(){n=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({...se})}),n.cesiumWidget.creditContainer.style.display="none",Y("shuzisannong:huangdaoqu_town","tl"),n.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:2}),ce(),xe()}function j(e,t,r){e.forEach(o=>{let s=[];o[0].forEach(d=>{s.push(d[0]),s.push(d[1])}),n.entities.add({name:t,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(s),width:6,material:new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:r?Cesium.Color.fromCssColorString(r):Cesium.Color.fromBytes(250,128,114)}),clampToGround:!0}})})}function ie(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 de(){Z({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),le.value=e.data.features}).catch(e=>{})}let g=m({label:[]}),T="";function ce(){var e=new Cesium.ScreenSpaceEventHandler(n.canvas);e.setInputAction(function(t){var r=n.camera.getPickRay(t.position),o=n.scene.globe.pick(r,n.scene);if(o){let s=Cesium.Cartographic.fromCartesian(o);if(s){let d=new Cesium.Cartesian2,c=n.camera.positionCartographic.height,p=ie(c);const u=n.imageryLayers._layers,i=u.findIndex(a=>a._imageryProvider._layers&&a._imageryProvider._layers==="shuzisannong:huangdaoqu_town");if(i>-1){const a=u[i];let v=a._imageryProvider;if(v&&v.ready&&v._layers&&a.show===!0){d=v.tilingScheme.positionToTileXY(s,p,d);let x=v.pickFeatures(d.x,d.y,p,s.longitude,s.latitude);x&&x.then(E=>{if(E.length>0){let h=E[0];if(h.properties&&h.properties.XZDM)if(T!==h.properties.XZDM){T=h.properties.XZDM,ae.value=T,selectTab();let S=h.data;n.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(S.bbox[0],S.bbox[1],S.bbox[2],S.bbox[3]),duration:2}),M("townLine"),j(S.geometry&&S.geometry.coordinates,"townLine","yellow"),w(["village_CQL"]),pe(`XZDM=${h.properties.XZDM}`,"village_CQL");let O=n.entities._entities._array;for(var C=O.length-1;C>=0;C--)if(O[C]._name&&O[C]._name==="point"+h.properties.XZDM){let ke=O[C]._info;g.value=ke,console.log(g.value,"------------------"),Se(t.position),n.scene.postRender.addEventListener(H)}M("villageLine"),F=""}else ue(u,d,p,s);else w(["village_CQL"]),X()}})}}}}},Cesium.ScreenSpaceEventType.LEFT_CLICK)}let F="";function ue(e,t,r,o){const s=e.findIndex(d=>d._imageryProvider._layers&&d._imageryProvider._layers==="shuzisannong:huangdaoqu_village");if(s>-1){const d=e[s];let c=d._imageryProvider;if(c&&c.ready&&c._layers&&d.show===!0){t=c.tilingScheme.positionToTileXY(o,r,t);let p=c.pickFeatures(t.x,t.y,r,o.longitude,o.latitude);p&&p.then(u=>{if(u.length>0){let i=u[0];if(i.properties&&i.properties.XZQDM&&F!==i.properties.XZQDM){F=i.properties.XZQDM;let a=i.data;if(M("villageLine"),j(a.geometry&&a.geometry.coordinates,"villageLine","yellow"),i.properties.XZQDM==="370211104217"){const v=Cesium.Rectangle.fromDegrees(a.bbox[0],a.bbox[1],a.bbox[2],a.bbox[3]),x=Cesium.Rectangle.center(v);let E=Cesium.Math.toDegrees(x.longitude),C=Cesium.Math.toDegrees(x.latitude),h={lon:E,lat:C,...a.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}]};g.value=h}}}})}}}function pe(e,t){let r=new Cesium.WebMapServiceImageryProvider({url:"http://121.36.229.60:9080/geoserver/shuzisannong/wms",layers:"shuzisannong:huangdaoqu_village",parameters:{service:"WMS",format:"image/png",transparent:!0,CQL_FILTER:e}});r.customName=t,n.imageryLayers.addImageryProvider(r)}function w(e,t){if(n){const r=n.imageryLayers._layers;for(let o=r.length-1;o>=0;o--)e.forEach(s=>{r[o]._imageryProvider&&r[o]._imageryProvider.customName&&(t?r[o]._imageryProvider.customName.indexOf(s)>-1&&n.imageryLayers.remove(r[o]):r[o]._imageryProvider.customName===s&&n.imageryLayers.remove(r[o]))})}}function M(e){if(n){let r=n.entities._entities._array;for(var t=r.length-1;t>=0;t--)r[t]._name&&r[t]._name===e&&n.entities.remove(r[t])}}function me(){if(V.value=!V.value,V.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 fe=()=>{Oe({time:"2023-04-25",subregion:"1",parent:"\u9EC4\u5C9B\u533A"}).then(e=>{console.log(e)})},ge=()=>{ze().then(e=>{D.arr=e.features,D.arr.unshift({bbox:[119.5091,35.5671,120.3285,36.1455],properties:{XZDM:"370211",XZMC:"\u5168\u90E8"}});let t=[...e.features],r=[];t.splice(0,1),t.forEach(o=>{r.push(o.properties.XZMC)}),q.title=[...Object.values(r)]})},ve=()=>{Ae().then(e=>{D.brr=e.features})},he=()=>{Be().then(e=>{D.crr=e.features,q.title.forEach((t,r)=>{let o=e.features.map(s=>{if(t===s.properties.town)return s.properties});Object.keys(W).forEach(s=>{const d=o.findIndex(c=>c&&c.crop===s);d>-1?W[s].push(o[d].Shape_Area):W[s].push(null)})})})},J=e=>{be(e)},be=e=>{let t=document.createElement("a");t.style.display="none",t.href=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)};function ye(){const e=te(Q.value);let t={primarySector:46036,primarySectorPercent:29,secondarySector:53942,secondarySectorPercent:35,tertiarySector:54107,tertiarySectorPercent:35.1};const r=[{value:t.primarySector,percent:t.primarySectorPercent,name:"\u6C34\u6D47\u5730",itemStyle:{borderColor:"rgba(84, 111, 198, 1)",borderWidth:5,shadowBlur:20,shadowColor:"#3C4039",shadowOffsetx:25,shadowOffsety:20,color:"rgba(84, 111, 198, 1)"}},{value:t.secondarySector,percent:t.secondarySectorPercent,name:"\u65F1\u5730",itemStyle:{borderColor:"rgba(239, 102, 105, 1)",borderWidth:5,shadowBlur:20,shadowColor:"#0C3E4E",shadowOffsetx:25,shadowOffsety:20,color:"rgba(239, 102, 105, 1)"}},{value:t.tertiarySector,percent:t.tertiarySectorPercent,name:"\u83DC\u5730",itemStyle:{borderColor:"rgba(62, 161, 114, 1)",borderWidth:5,shadowBlur:20,shadowColor:"#043E39",shadowOffsetx:25,shadowOffsety:20,color:"rgba(62, 161, 114, 1)"}},{value:t.tertiarySector,percent:t.tertiarySectorPercent,name:"\u704C\u6E89\u6C34\u7530",itemStyle:{borderColor:"rgba(246, 133, 75, 0.6)",borderWidth:5,shadowBlur:20,shadowColor:"#043E39",shadowOffsetx:25,shadowOffsety:20,color:"rgba(246, 133, 75, 0.6)"}},{value:t.tertiarySector,percent:t.tertiarySectorPercent,name:"\u671B\u5929\u7530",itemStyle:{borderColor:"rgba(145, 203, 115, 1)",borderWidth:5,shadowBlur:20,shadowColor:"#043E39",shadowOffsetx:25,shadowOffsety:20,color:" rgba(145, 203, 115, 1)"}}],s=1*r.reduce((i,a)=>i+a.value,0)/100,d=[],c={name:"",value:s,itemStyle:{color:"transparent"}};let p=0;r.forEach(i=>{p+=i.value});for(let i=0;i{b} : {c}\u4E07 ({d}%)"},legend:{show:!0,right:"0.1%",top:"30%",orient:"vertical",height:300,itemGap:15,textStyle:{color:"rgba(255,255,255,0.7)"}},color:["rgba(91, 154, 213, 1)","rgba(254, 192, 0, 1)"],series:[{name:"",type:"pie",radius:"80%",center:["30%","50%"],selectedMode:"single",hoverOffset:3,selectedOffset:5,label:{normal:{show:!1,position:"inside",color:"red",formatter:`{b}
{d}%`}},labelLine:{normal:{show:!1,length:3,length2:5}},data:[{value:36.7,name:"\u7CAE\u98DF\u751F\u4EA7\u529F\u80FD\u533A",selected:!0},{value:26.3,name:"\u91CD\u8981\u519C\u4EA7\u54C1\u751F\u4EA7\u4FDD\u62A4\u533A"}],itemStyle:{normal:{borderColor:"",borderWidth:2,shadowBlur:2,shadowOffsetX:0,shadowColor:"#00a5f4",opacity:1}}}]};t&&e.setOption(t,{notMerge:!0,grid:{bottom:20}}),ee(e,t)}function Y(e,t){let r=new Cesium.WebMapServiceImageryProvider({url:serverAPI.geoserverUrl+"/shuzisannong/wms?",layers:e,parameters:{service:"WMS",format:"image/png",transparent:!0}});r.customName=t;let o=n.imageryLayers.addImageryProvider(r);t.indexOf("gbznt")>-1&&(n.imageryLayers.lowerToBottom(o),n.imageryLayers.raise(o))}function Ce(){w(["gbznt"],!0),Y("shuzisannong:huangdaoqu_town","tl"),n.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:2}),B.value=!1}function we(){let e=$.value;console.log("fl:",e),Z({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((o,s)=>{const d=Cesium.Rectangle.fromDegrees(o.bbox[0],o.bbox[1],o.bbox[2],o.bbox[3]),c=Cesium.Rectangle.center(d);let p=Cesium.Math.toDegrees(c.longitude),u=Cesium.Math.toDegrees(c.latitude);o.properties.XZDM==="370211011"?(p=120.0863,u=35.941):o.properties.XZDM==="370211003"&&(p=120.243682,u=35.97123201);const i=e[o.properties.XZMC];let a=[];i&&(a=i.map((v,x)=>v.properties)),n.entities.add({name:"point"+o.properties.XZDM,position:Cesium.Cartesian3.fromDegrees(p,u),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:a,...o.properties,lon:p,lat:u}})})}).catch(t=>{})}let $=m({});function xe(){Z({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,r={};t.forEach(o=>{let s=o.properties.town;r[s]?r[s].push(o):r[s]=[o]}),$.value=r,we()}).catch(e=>{})}function H(){if(g.value&&g.value.lon&&g.value.lat){const t=Cesium.Cartesian3.fromDegrees(Number(g.value.lon),Number(g.value.lat),0);var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(n.scene,t);if(Cesium.defined(e)){const r=document.getElementById("pop");r.style.top=e.y-10+"px",r.style.left=e.x+10+"px"}}}function X(){T="",F="",w(["village_CQL"]),w(["aaa"]),M("villageLine"),M("townLine");const e=document.getElementById("pop");e.style.display="none",n.scene.postRender.removeEventListener(H),n.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:2}),w(["gbznt"],!0),B.value=!1}function Se(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 r=b("el-input"),o=b("el-button"),s=b("ArrowLeftBold"),d=b("el-icon"),c=b("el-checkbox"),p=b("el-checkbox-group"),u=b("el-collapse-item"),i=b("el-collapse");return L(),z("div",Ge,[Qe,l("div",Ue,[l("div",qe,[je,Je,f(r,{class:"seach_input",modelValue:G.value,"onUpdate:modelValue":t[0]||(t[0]=a=>G.value=a),placeholder:"\u8BF7\u8F93\u5165\u5730\u540D",clearable:""},null,8,["modelValue"]),l("div",Ye,[f(o,{class:"seach"},{default:y(()=>[k("\u67E5\u8BE2")]),_:1}),f(o,{class:"resetting"},{default:y(()=>[k("\u91CD\u7F6E")]),_:1})]),A(' ')]),l("div",$e,[He,l("div",Ke,[l("div",et,[tt,l("p",{onClick:t[1]||(t[1]=a=>J("https://1912c.oss-cn-beijing.aliyuncs.com/egg-oss-demo/zhongzhimianjishijian.xlsx"))},[k(" \u4E0B\u8F7D \xA0 "),rt])]),l("div",{ref_key:"Farmland_area",ref:Q,class:"Farmland_area"},null,512)]),l("div",ot,[l("div",at,[lt,l("p",{onClick:t[2]||(t[2]=a=>J("https://1912c.oss-cn-beijing.aliyuncs.com/egg-oss-demo/zhongzhimianjishijian.xlsx"))},[k(" \u4E0B\u8F7D \xA0 "),st])]),l("div",{ref_key:"Delineation",ref:U,class:"Delineation"},null,512)])]),l("div",{class:"rightFoldDiv",onClick:t[3]||(t[3]=a=>me())},[f(d,null,{default:y(()=>[f(s)]),_:1})])]),nt,l("div",it,[l("div",null,I(R.value.name)+"\uFF1A",1),l("div",null,I(R.value.value)+"\u4EA9",1),l("div",{class:"cancel",onClick:X},"X")]),l("div",dt,[(L(!0),z(Ie,null,Pe(N(g).label,(a,v)=>(L(),z("div",{key:v},[l("div",null,I(a.crop)+"\uFF1A",1),l("div",null,I((a.Shape_Area/666.67).toFixed(2))+" \u4EA9",1)]))),128)),N(g).XZQMC?(L(),z("div",ct,[ut,l("div",null,I(N(g).XZQMC),1)])):A("v-if",!0),l("div",{class:"cancel",onClick:X},"X")]),B.value?(L(),Te(o,{key:0,class:"back_button",onClick:t[4]||(t[4]=a=>Ce())},{default:y(()=>[k("\u8FD4\u56DE")]),_:1})):A("v-if",!0),f(i,{class:"legend",accordion:""},{default:y(()=>[f(u,{name:"1"},{title:y(()=>[k("\u56FE\u4F8B")]),default:y(()=>[l("div",pt,[f(p,{modelValue:e.checkList,"onUpdate:modelValue":t[10]||(t[10]=a=>e.checkList=a),onChange:e.change},{default:y(()=>[A(` `),f(c,{style:{background:"rgba(255, 238, 204, 1)",border:"1px solid rgba(251, 171, 60, 1)",width:"100%"},modelValue:e.checked3,"onUpdate:modelValue":t[5]||(t[5]=a=>e.checked3=a),label:"0-200"},null,8,["modelValue"]),f(c,{style:{background:"rgba(255, 220, 153, 1)",border:"1px solid rgba(251, 219, 13, 1)",width:"100%"},modelValue:e.checked4,"onUpdate:modelValue":t[6]||(t[6]=a=>e.checked4=a),label:"200-400"},null,8,["modelValue"]),f(c,{style:{background:"rgba(255, 203, 102, 1)",border:"1px solid rgba(244, 218, 136, 1)",width:"100%"},modelValue:e.checked3,"onUpdate:modelValue":t[7]||(t[7]=a=>e.checked3=a),label:"400-600"},null,8,["modelValue"]),f(c,{style:{background:"rgba(255, 185, 51, 1)",border:"1px solid rgba(174, 83, 110, 1)",width:"100%"},modelValue:e.checked4,"onUpdate:modelValue":t[8]||(t[8]=a=>e.checked4=a),label:"600-800"},null,8,["modelValue"]),f(c,{style:{background:"rgba(255, 168, 0, 1)",border:"1px solid rgba(242, 177, 167, 1)",width:"100%"},modelValue:e.checked3,"onUpdate:modelValue":t[9]||(t[9]=a=>e.checked3=a),label:"800-1000"},null,8,["modelValue"])]),_:1},8,["modelValue","onChange"])])]),_:1})]),_:1})])}}},bt=De(mt,[["__scopeId","data-v-d061be2f"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/plough/resources/index.vue"]]);export{bt as default};