Agriculture-front-end/dist/assets/index.a6931be3.js
2023-06-08 09:27:01 +08:00

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 f,c as h,l,m as w,e as c,w as p,L as q,N as Z,k as B,f as d,g as z,x as v,F as xe,y as Me,p as De,q as ke}from"./index.9ec53a6c.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{g as ze}from"./classify.266268d4.js";import{g as G,a as Fe,b as Ne}from"./estimate.50b54c22.js";const y=T=>(De("data-v-08d6a053"),T=T(),ke(),T),We={class:"center"},Ee=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-08d6a053><span data-v-08d6a053><img src="'+Te+'" alt="" data-v-08d6a053></span><span data-v-08d6a053><img src="'+Ie+'" alt="" data-v-08d6a053></span><span data-v-08d6a053><img src="'+Se+'" alt="" data-v-08d6a053></span><span data-v-08d6a053><img src="'+Le+'" alt="" data-v-08d6a053></span><span data-v-08d6a053><img src="'+Pe+'" alt="" data-v-08d6a053></span><span data-v-08d6a053><img src="'+Ye+'" alt="" data-v-08d6a053></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)),ea={id:"pop"},aa={key:0},ta=y(()=>l("div",null,"\u6751\u540D\uFF1A",-1)),oa={class:"mt-4"},la={__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 F=n([]),R=n("1");let H={\u84DD\u8272\u9884\u8B66:{color:"rgba(9, 187, 222, 1)",disabled:!1},\u9EC4\u8272\u9884\u8B66:{color:"rgba(255, 235, 59, 1)",disabled:!1},\u6A59\u8272\u9884\u8B66:{color:"rgba(234, 165, 93, 1)",disabled:!1},\u7EA2\u8272\u9884\u8B66:{color:"rgba(212, 48, 48, 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 a=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:a,endTime:o}).then(t=>{console.log(t.data),F.value=t.data})});let $=n([]);we(()=>{ee(),te(),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 ae(e,a,o){e.forEach(t=>{let r=[];t[0].forEach(u=>{r.push(u[0]),r.push(u[1])}),s.entities.add({name:a,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 te(){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,a){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=a,s.imageryLayers.addImageryProvider(o)}function D(e,a){if(s){const o=s.imageryLayers._layers;for(let t=o.length-1;t>=0;t--)e.forEach(r=>{o[t]._imageryProvider&&o[t]._imageryProvider.customName&&(a?o[t]._imageryProvider.customName.indexOf(r)>-1&&s.imageryLayers.remove(o[t]):o[t]._imageryProvider.customName===r&&s.imageryLayers.remove(o[t]))})}}function le(e){if(s){let o=s.entities._entities._array;for(var a=o.length-1;a>=0;a--)o[a]._name&&o[a]._name===e&&s.entities.remove(o[a])}}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=()=>{Fe({year:2023}).then(e=>{$.value=e})},ne=()=>{Ne().then(e=>{e.forEach(a=>{Number(a.year)>=2e3&&X.value.push(a)})})},ie=()=>{G({startTime:"",endTime:""}).then(e=>{F.value=e.data})},de=()=>{if(I.arr.forEach(t=>{t.properties.XZDM==_.value}),_.value=="370211"){D(["village_CQL"]),D(["aaa"]);return}let e=[...I.arr];console.log("arr:",e),e.forEach(t=>{t.properties.XZDM==_.value&&s.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]),duration:2});let r=[...I.brr],u=[];r.forEach(g=>{g.properties.XZDM==_.value&&u.push(g.properties.XZQMC)}),[...Object.values(u)]});const o=[...I.arr].find(t=>t.properties.XZDM===_.value);o&&(le("townLine"),ae(o.geometry.coordinates,"townLine","yellow")),D(["aaa"]),oe(`XZDM=${_.value}`,"aaa"),ze({time:"2023-04-26",subregion:"1",parent:"\u9EC4\u5C9B\u533A"}).then(t=>{let r=[];t.data.map((u,g)=>{u.region==o.properties.XZMC&&r.push({crop:u.type,Shape_Area:u.area})}),M.value={label:r},ge({x:642,y:312})})};function O(e,a){let o=new Cesium.WebMapServiceImageryProvider({url:serverAPI.geoserverUrl+"/shuzisannong/wms?",layers:e,parameters:{service:"WMS",format:"image/png",transparent:!0}});o.customName=a;let t=s.imageryLayers.addImageryProvider(o);a.indexOf("gbznt")>-1&&(s.imageryLayers.lowerToBottom(t),s.imageryLayers.raise(t))}function ce(){delete M.value.XZQMC,D(["gbznt"],!0),D(["aaa"]),_.value="370211",de(),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,N()}function ue(){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(a=>{console.log("res1111:",a),a.data.features.forEach((t,r)=>{const u=Cesium.Rectangle.fromDegrees(t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]),g=Cesium.Rectangle.center(u);Cesium.Math.toDegrees(g.longitude),Cesium.Math.toDegrees(g.latitude),t.properties.XZDM==="370211011"||t.properties.XZDM;const P=e[t.properties.XZMC];P&&P.map((Y,W)=>Y.properties)})}).catch(a=>{})}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 a=e.data.features,o={};a.forEach(t=>{let r=t.properties.town;o[r]?o[r].push(t):o[r]=[t]}),J.value=o,ue()}).catch(e=>{})}function me(){if(S.value.lon&&S.value.lat){const a=Cesium.Cartesian3.fromDegrees(Number(S.value.lon),Number(S.value.lat),0);var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,a);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 N(){const e=document.getElementById("popup");e&&(e.style.display="none"),s.scene.postRender.removeEventListener(me)}function ge(e){const a=document.getElementById("popup");a&&(a.style.display="block",a.style.position="absolute",a.style.top=e.y-10+"px",a.style.left=e.x+10+"px",a.style.zIndex=99)}return(e,a)=>{const o=m("el-option"),t=m("el-select"),r=m("el-radio"),u=m("el-radio-group"),g=m("el-table-column"),P=m("el-table"),Y=m("el-button"),W=m("el-tooltip"),fe=m("el-checkbox"),ve=m("el-checkbox-group"),_e=m("el-collapse-item"),ye=m("el-collapse");return f(),h("div",We,[Ee,l("div",Ae,[l("div",qe,[w(" \u76D1\u6D4B\u65E5\u671F:\u2003 "),c(t,{modelValue:_.value,"onUpdate:modelValue":a[0]||(a[0]=i=>_.value=i),"popper-class":"select_city",class:"m-2",placeholder:"Select"},{default:p(()=>[(f(!0),h(q,null,Z(X.value,i=>(f(),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 "),c(u,{modelValue:R.value,"onUpdate:modelValue":a[1]||(a[1]=i=>R.value=i),class:"ml-4"},{default:p(()=>[c(r,{label:"1",size:"large"},{default:p(()=>[w("5km")]),_:1}),c(r,{label:"2",size:"large"},{default:p(()=>[w("10km")]),_:1})]),_:1},8,["modelValue"])]),c(P,{"cell-style":{textAlign:"center"},"header-cell-style":{"text-align":"center"},data:F.value,style:{width:"100%"}},{default:p(()=>[c(g,{prop:"createdTime",label:"\u8BBE\u5907\u53F7"}),c(g,{prop:"tyName",label:"\u9884\u8B66\u60C5\u51B5"}),c(g,{prop:"weizhi",label:"\u8054\u7CFB\u4EBA"}),c(g,{prop:"affectedArea",label:"\u8054\u7CFB\u7535\u8BDD"})]),_:1},8,["data"]),c(Y,{class:"but",type:"primary"},{default:p(()=>[w("\u53D1\u5E03\u9884\u8B66\u77ED\u4FE1")]),_:1})])]),l("div",{class:"rightFoldDiv",onClick:a[2]||(a[2]=i=>se())},[c(W,{disabled:!d(b),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u6536\u8D77",placement:"top"},{default:p(()=>[d(b)?(f(),h("img",Re)):z("v-if",!0)]),_:1},8,["disabled"]),c(W,{disabled:d(b),"show-arrow":!1,"hide-after":"0","show-after":"200",class:"box-item",effect:"dark",content:"\u5C55\u5F00",placement:"top"},{default:p(()=>[d(b)?z("v-if",!0):(f(),h("img",Oe))]),_:1},8,["disabled"])])]),Je,l("div",Ue,[l("div",null,[Ge,l("p",null,v(d(C).name),1)]),l("div",null,[Qe,l("p",null,v(d(C).fLongitude)+"\xB0E/"+v(d(C).fLatitude)+"\xB0N",1)]),l("div",null,[je,l("p",null,v(d(k)(d(C).time).format("YYYY-MM-DD HH:mm:ss")),1)]),l("div",null,[He,l("p",null,v(d(C).pressure)+"\u767E\u5E15",1)]),l("div",null,[$e,l("p",null,v(d(C).speed)+"\u7C73/\u79D2",1)]),l("div",null,[Ke,l("p",null,v(d(C).power)+"\u7EA7",1)]),l("div",{class:"cancel",onClick:N},"X")]),l("div",ea,[(f(!0),h(q,null,Z(d(M).label,(i,E)=>(f(),h("div",{key:E},[l("div",null,v(i.crop)+"\uFF1A",1),l("div",null,v((i.Shape_Area/666.67).toFixed(2))+" \u4EA9",1)]))),128)),d(M).XZQMC?(f(),h("div",aa,[ta,l("div",null,v(d(M).XZQMC),1)])):z("v-if",!0),l("div",{class:"cancel",onClick:N},"X")]),c(ye,{class:"legend",accordion:""},{default:p(()=>[c(_e,{name:"1"},{title:p(()=>[w("\u56FE\u4F8B")]),default:p(()=>[l("div",oa,[c(ve,{modelValue:V.value,"onUpdate:modelValue":a[3]||(a[3]=i=>V.value=i),onChange:e.change},{default:p(()=>[(f(!0),h(q,null,Z(d(H),(i,E,he)=>(f(),B(fe,{key:he,style:xe({backgroundColor:i.color,border:"1px solid value.color",width:"100%"}),"v-model":i.disabled,disabled:i.disabled,label:E},null,8,["style","v-model","disabled","label"]))),128))]),_:1},8,["modelValue","onChange"])])]),_:1})]),_:1}),L.value?(f(),B(Y,{key:0,class:"back_button",onClick:a[4]||(a[4]=i=>ce())},{default:p(()=>[w("\u8FD4\u56DE")]),_:1})):z("v-if",!0)])}}},pa=be(la,[["__scopeId","data-v-08d6a053"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/meteorological/monitor/FloodWarning/index.vue"]]);export{pa as default};