2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
import{_ as be,r as n,A as U,U as Ce,V as we,W as A,d as m,o as g,c as h,l,m as w,e as u,w as p,L as q,N as Z,k as B,f as c,g as z,x as v,F as xe,y as Me,p as De,q as ke}from"./index.48137ccf.js";import{_ as Q}from"./close1.45635d81.js";import{_ as Te,a as Ie,b as Se,c as Le,d as Pe,e as Ye}from"./linesGL.90f708a5.js";import"./index.c9f5bd8b.js";import{h as k}from"./moment.9709ab41.js";import{a as ze}from"./classify.9cf5ad7c.js";import{g as G,a as Ne,b as Fe}from"./estimate.3fe34455.js";const y=T=>(De("data-v-363f1f9f"),T=T(),ke(),T),Ee={class:"center"},We=y(()=>l("div",{style:{width:"100%",height:"100%"},id:"cesiumContainer"},null,-1)),Ae={class:"rightWra"},qe={class:"farmlandHeader"},Ze={class:"rightTop"},Be=y(()=>l("div",{class:"title"},[l("span",null,"\u9884\u8B66\u4FE1\u606F\u53D1\u5E03")],-1)),Ve={class:"farmlandDiv"},Xe={class:"radioDiv"},Re={key:0,src:Q,alt:""},Oe={key:0,class:"imgrotate",src:Q,alt:""},Je=Me('<div class="tool" data-v-363f1f9f><span data-v-363f1f9f><img src="'+Te+'" alt="" data-v-363f1f9f></span><span data-v-363f1f9f><img src="'+Ie+'" alt="" data-v-363f1f9f></span><span data-v-363f1f9f><img src="'+Se+'" alt="" data-v-363f1f9f></span><span data-v-363f1f9f><img src="'+Le+'" alt="" data-v-363f1f9f></span><span data-v-363f1f9f><img src="'+Pe+'" alt="" data-v-363f1f9f></span><span data-v-363f1f9f><img src="'+Ye+'" alt="" data-v-363f1f9f></span></div>',1),Ue={id:"popup"},Ge=y(()=>l("span",null,"\u540D\u79F0\uFF1A",-1)),Qe=y(()=>l("span",null,"\u5F53\u524D\u4F4D\u7F6E\uFF1A",-1)),je=y(()=>l("span",null,"\u65F6\u95F4\uFF1A",-1)),He=y(()=>l("span",null,"\u6C14\u538B\uFF1A",-1)),$e=y(()=>l("span",null,"\u6700\u5927\u98CE\u901F\uFF1A",-1)),Ke=y(()=>l("span",null,"\u98CE\u529B\uFF1A",-1)),et={id:"pop"},tt={key:0},at=y(()=>l("div",null,"\u6751\u540D\uFF1A",-1)),ot={class:"mt-4"},lt={__name:"index",setup(T){let s=n(null);const _=n("2023");let I=U({arr:[],brr:[],crr:[]}),S=n({name:"",value:""});const j=n([]),L=n(!1);let b=n(!1);const V=n(["false"]);n(null);const x=n(""),X=n([]);let C=n([]);n([]),n([]),n([]);const N=n([]),R=n("1");let H={\u8F7B\u5EA6\u5E72\u65F1:{color:"rgba(9, 187, 222, 1)",disabled:!1},\u4E2D\u5EA6\u5E72\u65F1:{color:"rgba(255, 235, 59, 1)",disabled:!1},\u4E25\u91CD\u5E72\u65F1:{color:"rgba(234, 165, 93, 1)",disabled:!1},\u7279\u5927\u5E72\u65F1:{color:"rgba(215, 25, 28, 1)",disabled:!1}};U({power:[{required:!0,message:"Please select Activity zone",trigger:"change"}],count:[{required:!0,message:"Please select Activity count",trigger:"change"}],date1:[{type:"date",required:!0,message:"Please pick a date",trigger:"change"}],date2:[{type:"date",required:!0,message:"Please pick a time",trigger:"change"}],type:[{type:"array",required:!0,message:"Please select at least one activity type",trigger:"change"}],resource:[{required:!0,message:"Please select activity resource",trigger:"change"}],desc:[{required:!0,message:"Please input activity form",trigger:"blur"}]}),Ce(()=>x.value,e=>{let t=k(x.value[0]).format("YYYY-MM-DD")?k(x.value[0]).format("YYYY-MM-DD "):"",o=k(x.value[1]).format("YYYY-MM-DD")?k(x.value[1]).format("YYYY-MM-DD"):"";G({startTime:t,endTime:o}).then(a=>{console.log(a.data),N.value=a.data})});let $=n([]);we(()=>{ee(),ae(),re(),ne(),ie();let e=document.querySelector(".rightWra");e.style.transform="translate(107%,0)"});const K={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 ee(){s=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({...K})}),s.cesiumWidget.creditContainer.style.display="none",O("shuzisannong:huangdaoqu_town","tl"),s.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:0}),pe()}function te(e,t,o){e.forEach(a=>{let r=[];a[0].forEach(d=>{r.push(d[0]),r.push(d[1])}),s.entities.add({name:t,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(r),width:6,material:new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:o?Cesium.Color.fromCssColorString(o):Cesium.Color.fromBytes(250,128,114)}),clampToGround:!0}})})}function ae(){A({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),j.value=e.data.features}).catch(e=>{})}let M=n({label:[]});function oe(e,t){let o=new Cesium.WebMapServiceImageryProvider({url:`${serverAPI.geoserverUrl}/shuzisannong/wms`,layers:"shuzisannong:huangdaoqu_village",parameters:{service:"WMS",format:"image/png",transparent:!0,CQL_FILTER:e}});o.customName=t,s.imageryLayers.addImageryProvider(o)}function D(e,t){if(s){const o=s.imageryLayers._layers;for(let a=o.length-1;a>=0;a--)e.forEach(r=>{o[a]._imageryProvider&&o[a]._imageryProvider.customName&&(t?o[a]._imageryProvider.customName.indexOf(r)>-1&&s.imageryLayers.remove(o[a]):o[a]._imageryProvider.customName===r&&s.imageryLayers.remove(o[a]))})}}function le(e){if(s){let o=s.entities._entities._array;for(var t=o.length-1;t>=0;t--)o[t]._name&&o[t]._name===e&&s.entities.remove(o[t])}}function se(){if(b.value=!b.value,b.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 re=()=>{Ne({year:2023}).then(e=>{$.value=e})},ne=()=>{Fe().then(e=>{e.forEach(t=>{Number(t.year)>=2e3&&X.value.push(t)})})},ie=()=>{G({startTime:"",endTime:""}).then(e=>{N.value=e.data})},ce=()=>{if(I.arr.forEach(a=>{a.properties.XZDM==_.value}),_.value=="370211"){D(["village_CQL"]),D(["aaa"]);return}let e=[...I.arr];console.log("arr:",e),e.forEach(a=>{a.properties.XZDM==_.value&&s.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(a.bbox[0],a.bbox[1],a.bbox[2],a.bbox[3]),duration:2});let r=[...I.brr],d=[];r.forEach(f=>{f.properties.XZDM==_.value&&d.push(f.properties.XZQMC)}),[...Object.values(d)]});const o=[...I.arr].find(a=>a.properties.XZDM===_.value);o&&(le("townLine"),te(o.geometry.coordinates,"townLine","yellow")),D(["aaa"]),oe(`XZDM=${_.value}`,"aaa"),ze({time:"2023-04-26",subregion:"1",parent:"\u9EC4\u5C9B\u533A"}).then(a=>{let r=[];a.data.map((d,f)=>{d.region==o.properties.XZMC&&r.push({crop:d.type,Shape_Area:d.area})}),M.value={label:r},fe({x:642,y:312})})};function O(e,t){let o=new Cesium.WebMapServiceImageryProvider({url:serverAPI.geoserverUrl+"/shuzisannong/wms?",layers:e,parameters:{service:"WMS",format:"image/png",transparent:!0}});o.customName=t;let a=s.imageryLayers.addImageryProvider(o);t.indexOf("gbznt")>-1&&(s.imageryLayers.lowerToBottom(a),s.imageryLayers.raise(a))}function ue(){delete M.value.XZQMC,D(["gbznt"],!0),D(["aaa"]),_.value="370211",ce(),L.value==="1"&&(console.log(L.value),O("shuzisannong:huangdaoqu_town","tl")),s.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(119.5091,35.5671,120.3285,36.1455),duration:2}),L.value=!1,F()}function de(){let e=J.value;console.log("fl:",e),A({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((a,r)=>{const d=Cesium.Rectangle.fromDegrees(a.bbox[0],a.bbox[1],a.bbox[2],a.bbox[3]),f=Cesium.Rectangle.center(d);Cesium.Math.toDegrees(f.longitude),Cesium.Math.toDegrees(f.latitude),a.properties.XZDM==="370211011"||a.properties.XZDM;const P=e[a.properties.XZMC];P&&P.map((Y,E)=>Y.properties)})}).catch(t=>{})}let J=n({});function pe(){A({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,o={};t.forEach(a=>{let r=a.properties.town;o[r]?o[r].push(a):o[r]=[a]}),J.value=o,de()}).catch(e=>{})}function me(){if(S.value.lon&&S.value.lat){const t=Cesium.Cartesian3.fromDegrees(Number(S.value.lon),Number(S.value.lat),0);var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,t);if(Cesium.defined(e)){const o=document.getElementById("popup");o&&(o.style.top=e.y-10+"px",o.style.left=e.x+10+"px")}}}function F(){const e=document.getElementById("popup");e&&(e.style.display="none"),s.scene.postRender.removeEventListener(me)}function fe(e){const t=document.getElementById("popup");t&&(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 o=m("el-option"),a=m("el-select"),r=m("el-radio"),d=m("el-radio-group"),f=m("el-table-column"),P=m("el-table"),Y=m("el-button"),E=m("el-tooltip"),ge=m("el-checkbox"),ve=m("el-checkbox-group"),_e=m("el-collapse-item"),ye=m("el-collapse");return g(),h("div",Ee,[We,l("div",Ae,[l("div",qe,[w(" \u76D1\u6D4B\u65E5\u671F:\u2003 "),u(a,{modelValue:_.value,"onUpdate:modelValue":t[0]||(t[0]=i=>_.value=i),"popper-class":"select_city",class:"m-2",placeholder:"Select"},{default:p(()=>[(g(!0),h(q,null,Z(X.value,i=>(g(),B(o,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),l("div",Ze,[Be,l("div",Ve,[l("div",Xe,[w(" \u9884\u8B66\u8303\u56F4\uFF1A "),u(d,{modelValue:R.value,"onUpdate:modelValue":t[1]||(t[1]=i=>R.value=i),class:"ml-4"},{default:p(()=>[u(r,{label:"1",size:"large"},{default:p(()=>[w("5km")]),_:1}),u(r,{label:"2",size:"large"},{default:p(()=>[w("10km")]),_:1})]),_:1},8,["modelValue"])]),u(P,{"cell-style":{textAlign:"center"},"header-cell-style":{"text-align":"center"},data:N.value,style:{width:"100%"}},{default:p(()=>[u(f,{prop:"createdTime",label:"\u8BBE\u5907\u53F7"}),u(f,{prop:"tyName",label:"\u9884\u8B66\u60C5\u51B5"}),u(f,{prop:"weizhi",label:"\u8054\u7CFB\u4EBA"}),u(f,{prop:"affectedArea",label:"\u8054\u7CFB\u7535\u8BDD"})]),_:1},8,["data"]),u(Y,{class:"but",type:"primary"},{default:p(()=>[w("\u53D1\u5E03\u9884\u8B66\u77ED\u4FE1")]),_:1})])]),l("div",{class:"rightFoldDiv",onClick:t[2]||(t[2]=i=>se())},[u(E,{disabled:!c(b),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u6536\u8D77",placement:"top"},{default:p(()=>[c(b)?(g(),h("img",Re)):z("v-if",!0)]),_:1},8,["disabled"]),u(E,{disabled:c(b),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u5C55\u5F00",placement:"top"},{default:p(()=>[c(b)?z("v-if",!0):(g(),h("img",Oe))]),_:1},8,["disabled"])])]),Je,l("div",Ue,[l("div",null,[Ge,l("p",null,v(c(C).name),1)]),l("div",null,[Qe,l("p",null,v(c(C).fLongitude)+"\xB0E/"+v(c(C).fLatitude)+"\xB0N",1)]),l("div",null,[je,l("p",null,v(c(k)(c(C).time).format("YYYY-MM-DD HH:mm:ss")),1)]),l("div",null,[He,l("p",null,v(c(C).pressure)+"\u767E\u5E15",1)]),l("div",null,[$e,l("p",null,v(c(C).speed)+"\u7C73/\u79D2",1)]),l("div",null,[Ke,l("p",null,v(c(C).power)+"\u7EA7",1)]),l("div",{class:"cancel",onClick:F},"X")]),l("div",et,[(g(!0),h(q,null,Z(c(M).label,(i,W)=>(g(),h("div",{key:W},[l("div",null,v(i.crop)+"\uFF1A",1),l("div",null,v((i.Shape_Area/666.67).toFixed(2))+" \u4EA9",1)]))),128)),c(M).XZQMC?(g(),h("div",tt,[at,l("div",null,v(c(M).XZQMC),1)])):z("v-if",!0),l("div",{class:"cancel",onClick:F},"X")]),u(ye,{class:"legend",accordion:""},{default:p(()=>[u(_e,{name:"1"},{title:p(()=>[w("\u56FE\u4F8B")]),default:p(()=>[l("div",ot,[u(ve,{modelValue:V.value,"onUpdate:modelValue":t[3]||(t[3]=i=>V.value=i),onChange:e.change},{default:p(()=>[(g(!0),h(q,null,Z(c(H),(i,W,he)=>(g(),B(ge,{key:he,style:xe({backgroundColor:i.color,border:"1px solid value.color",width:"100%"}),"v-model":i.disabled,disabled:i.disabled,label:W},null,8,["style","v-model","disabled","label"]))),128))]),_:1},8,["modelValue","onChange"])])]),_:1})]),_:1}),L.value?(g(),B(Y,{key:0,class:"back_button",onClick:t[4]||(t[4]=i=>ue())},{default:p(()=>[w("\u8FD4\u56DE")]),_:1})):z("v-if",!0)])}}},pt=be(lt,[["__scopeId","data-v-363f1f9f"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/meteorological/monitor/drought/index.vue"]]);export{pt as default};
|