2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
import{H as W,_ as ke,r as c,A as Ce,V as Le,W as Ee,U as Y,a1 as ze,d as w,o as p,c as C,l as i,m as T,e as G,w as x,L as J,N as O,f as v,k as I,g as M,F as De,x as Ae,y as Ge,p as qe,q as je}from"./index.afd881ee.js";import Ve from"./downloads.4cdbbcc5.js";import{_ as le}from"./close1.45635d81.js";import{_ as Ne,a as Fe,b as Te,c as Ie}from"./position.a021215f.js";import{_ as Me,a as We}from"./TimeLine.vue_vue_type_style_index_0_scoped_26e8a223_lang.891b9335.js";import"./index.6098b0aa.js";import"./linesGL.306b5757.js";import{T as Be}from"./TimeLine.7d9e99e3.js";import{u as ae}from"./useEcharts.a1c5140e.js";import{i as re,L as Pe}from"./install.6cb28b74.js";function ne(d){return W({url:"equipment/nonGrain",method:"get",params:d})}function Re(d){return W({url:"equipment/nonGrainChun",method:"get",params:d})}function Ye(d){return W({url:"equipment/nonGrainHuoChun",method:"get",params:d})}function Je(d){return W({url:"equipment/fnYear ",method:"get",params:d})}const L=d=>(qe("data-v-cd47b039"),d=d(),je(),d),Oe={class:"center"},Qe=L(()=>i("div",{style:{width:"100%",height:"100%"},id:"cesiumContainer"},null,-1)),$e={class:"rightWra"},He={class:"rightbottom"},Ue={class:"title"},Xe=L(()=>i("span",null,"\u975E\u519C\u5316\u8015\u5730\u9762\u79EF\u7EDF\u8BA1",-1)),Ze=L(()=>i("img",{src:Ve,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1)),Ke={class:"rightbottom"},et=L(()=>i("div",{class:"title"},[i("span",null,"\u975E\u519C\u5316\u8015\u5730\u9762\u79EF\u5360\u6BD4")],-1)),tt={key:0,src:le,alt:""},ot={key:0,class:"imgrotate",src:le,alt:""},at={class:"mt-4"},rt={class:"bottom_center"},nt=Ge('<div class="tool" data-v-cd47b039><span data-v-cd47b039><img src="'+Ne+'" alt="" data-v-cd47b039></span><span data-v-cd47b039><img src="'+Fe+'" alt="" data-v-cd47b039></span><span data-v-cd47b039><img src="'+Te+'" alt="" data-v-cd47b039></span><span data-v-cd47b039><img src="'+Me+'" alt="" data-v-cd47b039></span><span data-v-cd47b039><img src="'+We+'" alt="" data-v-cd47b039></span><span data-v-cd47b039><img src="'+Ie+'" alt="" data-v-cd47b039></span></div>',1),lt={id:"popup",class:"ol-popup"},st=L(()=>i("div",{class:"pophead",style:{width:"100%",height:"20px"}},[i("div",{id:"popup-title",style:{font:"bold 15px sans-serif",align:"left",position:"absolute",left:"17px",color:"#fff"}}),i("a",{href:"#",id:"popup-closer",class:"ol-popup-closer",style:{color:"#8e908c"}})],-1)),it={id:"popup-content",style:{padding:"10px"}},ct=L(()=>i("span",null,"\u975E\u519C\u5316",-1)),dt=L(()=>i("div",{id:"popup-pagination"},null,-1)),ut={__name:"index",setup(d){c(null);const Q=c(null),$=c(null);let E=Ce({arr:[],brr:[],crr:[]}),g=c([]);const h=c("370211");c({info:[]});const se=c(!1);c(!0);let S=c(!0);const j=c([]);let H=c([]),B=c([]),P=c([]),k=c("");const ie=e=>{ce(e)},ce=e=>{let t=document.createElement("a");t.style.display="none",t.href=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)};let R={\u975E\u519C\u5316:{color:"rgba(255, 255, 0, 1)",disabled:!1}},z={\u975E\u519C\u5316:{setOf:"2022-06-01-gengdi",name:"T2022_06_01_feinonghua"}},V=c(null);Le(()=>{ye(),de()});function de(){ue(),he(),ge();for(const e in R)R[e].disabled!==!0&&H.value.push(e);j.value=H.value}Ee(()=>{document.querySelector(".mode").style.display="none",window.document.querySelector("#screenfull").style.display="block"}),Y(()=>k.value,(e,t)=>{h.value="370211",ee(k.value.name)});let s=c(null);c(null),c(null);let U=c(null),N=c(null);function ue(){var e=document.querySelector(".center"),t=document.getElementById("cesiumContainer");s=new ol.Map({target:"cesiumContainer",controls:[],view:new ol.View({center:[119.86763411957472,35.88435182141938],zoom:11,projection:"EPSG:4326"}),layers:[new ol.layer.Tile({source:new ol.source.Tianditu({layerType:"img",key:"1d109683f4d84198e37a38c442d68311"})})]}),pe(),fe(),s.on("moveend",function(o){var a=s.getView().getZoom();a>=13?V.setVisible(!0):V.setVisible(!1)}),s.on("singleclick",function(o){var a=o.coordinate,l=a[0],f=a[1],q=s.getView(),y=s.getView().getZoom();console.log(l,f),q.animate({center:[l,f],duration:1e3}),y>=13?X(o,"CJQY3702112019WGS84@huangdaoqu_bianjie","http://36.134.44.75:8090/iserver/services/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84@huangdaoqu_bianjie","\u6751"):X(o,"XJQY3702112019WGS84@huangdaoqu_bianjie","http://36.134.44.75:8090/iserver/services/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84@huangdaoqu_bianjie","\u9547")});var n=new ResizeObserver(function(o){o.forEach(function(a){var l=a.contentRect.width,f=a.contentRect.height;t.style.width=l+"px",t.style.height=f+"px",s.updateSize()})});n.observe(e)}const pe=()=>{V=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:"http://36.134.44.75:8090/iserver/services/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84@huangdaoqu_bianjie",cacheEnabled:!1}),name:"huangdaoqu_village",projection:"EPSG:4326",zIndex:9999}),s.addLayer(V)},fe=()=>{var e=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:"http://36.134.44.75:8090/iserver/services/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84@huangdaoqu_bianjie",cacheEnabled:!1}),projection:"EPSG:4326",zIndex:9999});s.addLayer(e)},me=e=>{let t=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:serverAPI.geoserverUrl+`/map-${e.setOf}/rest/maps/${e.name}@${e.setOf}`,cacheEnabled:!1}),name:e.name,projection:"EPSG:4326"});s.addLayer(t)};function X(e,t,n,o){let a=[];var l=new ol.geom.Point(e.coordinate),f=new ol.supermap.QueryByGeometryParameters({queryParams:{name:t},geometry:l});let q=document.querySelector("#popup-title"),y=c(null),D=c(null);new ol.supermap.QueryService(n).queryByGeometry(f,function(r){D=s.getLayers().getArray().find(u=>u.get("id")==="zhezhao"),s.removeLayer(D);let b="";if(o=="\u9547"&&r.result.recordsets[0].features.features[0].properties.XJQYDM){let u=r.result.recordsets[0].features.features[0].properties.XJQYDM;h.value=u;let _=[];ne({divisions:"370211",yearMonth:k.value.name}).then(A=>{A.data.forEach(m=>{m.subregionCode==u&&(b=m.subregionName,_.push(m))}),F(),B.value=_})}else if(o=="\u6751"&&r.result.recordsets[0].features.features[0].properties.CJQYDM){let u=r.result.recordsets[0].features.features[0].properties.CJQYDM,_=[];Ye({divisions:u,yearMonth:k.value.name}).then(A=>{A.data.forEach(m=>{m.subregionCode==u&&(b=m.subregionName,console.log(m),_.push(m))}),B.value=_,F()})}function F(){if(r.result.currentCount>0){console.log(r.result.recordsets[0].features),r.result.recordsets[0].features&&(N.setPosition(l.flatCoordinates),console.log(b),q.innerHTML=b),y=s.getLayers().getArray().find(Se=>Se.get("id")==="dianjigaoliang"),s.removeLayer(y);var u=new ol.format.GeoJSON().readFeatures(r.result.recordsets[0].features);a=r.result.recordsets[0].features.features[0].geometry.coordinates,Z(r.result.recordsets[0].features.features[0].geometry.coordinates);var _=new ol.source.Vector;_.addFeatures(u);const m=new ol.style.Style({stroke:new ol.style.Stroke({color:"rgba(255, 219, 113, 1.0)",width:5})});var A=new ol.layer.Vector({id:"dianjigaoliang",source:_,zIndex:9999});A.setStyle(m),s.addLayer(A)}}}),U.addEventListener("click",function(){D=s.getLayers().getArray().find(r=>r.get("id")==="zhezhao"),s.removeLayer(D),K(a),h.value="370211",y=s.getLayers().getArray().find(r=>r.get("id")==="dianjigaoliang"),s.removeLayer(y),N.setPosition(void 0)})}const ge=()=>{document.getElementById("popup"),document.getElementById("popup-content"),U=document.getElementById("popup-closer"),N=new ol.Overlay({element:document.getElementById("popup"),positioning:"bottom-center",stopEvent:!0,offset:[0,-10]}),s.addOverlay(N)};function he(){ze.get("/json/huangdao.json").then(({data:e})=>{const n=new ol.format.GeoJSON().readFeatures(e)[0];Z(n.getGeometry().getCoordinates(),"huandao")})}function Z(e,t){let n=new ol.source.Vector;var o=new ol.layer.Vector({id:t||"zhezhao",source:n,style:new ol.style.Style({fill:new ol.style.Fill({color:"rgba( 105, 105, 105, 0.9)"})})});const a=K(e),l=new ol.Feature({geometry:a});o.getSource().addFeature(l),s.addLayer(o)}function K(e){console.log(e);const t=[-180,-90,180,90],n=ol.geom.Polygon.fromExtent(t),o=e;return console.log(o),o.forEach(a=>{const l=new ol.geom.LinearRing(a[0]);n.appendLinearRing(l)}),n}Y(()=>h.value,()=>{_e()}),Y(()=>j.value,(e,t)=>{e.length>t.length?e.filter(o=>{if(t.findIndex(l=>l===o)<0)return o}).forEach(o=>{z[o]&&(console.log(z[o]),me(z[o]))}):e.length<t.length&&t.filter(o=>{if(e.findIndex(l=>l===o)<0)return o}).forEach(o=>{z[o]&&(s.getLayers().getArray().indexOf(z[o].name),console.log(s.getLayers().getArray()),s.getLayers().getArray().forEach((a,l)=>{a.A.name&&a.A.name==z[o].name&&s.getLayers().removeAt(l)}))})});function ve(){if(S.value=!S.value,S.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 ye=()=>{Je().then(e=>{k.value={name:e.data[0]},e.data.forEach(t=>{P.value.push({name:t})})})},ee=e=>{E.arr=[],g.value=[],ne({yearMonth:e}).then(t=>{console.log(t.data),t.data.forEach(a=>{a.farm>0&&(E.arr.push(a),g.value.push(a))}),E.arr.unshift({subregionCode:"370211",subregionName:"\u5168\u90E8"}),console.log(E.arr);let n=[...t.data],o=[];n.splice(0,1),n.forEach(a=>{o.push(a.subregionCode)}),[...Object.values(o)],te(E.arr),oe()})},be=(e,t)=>{g.value=[],Re({divisions:e,yearMonth:t}).then(n=>{n.data.forEach(o=>{o.farm>0&&g.value.push(o)}),te(),oe()})},_e=()=>{h.value=="370211"?ee():h.value&&be(h.value,k.value.name)},we=e=>{k.value=e};function te(){const e=re(Q.value);console.log(g.value),g.value.sort((l,f)=>f.farm-l.farm);var t=[],n=[];g.value.forEach(l=>{t.push(l.subregionName),n.push(Number(l.farm).toFixed(2))}),console.log(n);let o=3/g.value.length*100;var a={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!0,top:"10",right:"5%",textStyle:{color:"rgba(255,255,255,.9)"},itemWidth:20,itemHeight:12.5,icon:"rect",backgroundColor:"transparent"},dataZoom:[{type:"slider",width:"40%",zoomLock:!0,top:"90%",start:0,end:o,show:!1,showDataShadow:!1,showDetail:!1,fillerColor:"rgba(64, 158, 255)",borderRadius:"50%",moveHandleSize:0,moveHandleStyle:{},left:"35%",height:12,handleSize:"80%",handleIcon:"path://M512,512m-448,0a448,448,0,1,0,896,0a448,448,0,1,0,-896,0Z",handleStyle:{borderWidth:0,color:"rgba(64, 158, 255)"}},{type:"inside"}],grid:{left:"5%",right:"5%",bottom:"9%",top:"10%",containLabel:!0},xAxis:{data:t,triggerEvent:!0,axisTick:{show:!1},axisLine:{show:!0,lineStyle:{color:"#70F5FE"}},axisLabel:{show:!0,rotate:0,interval:0,textStyle:{padding:[8,0,0,0],fontSize:14,color:"rgba(21, 222, 255, 0.8)"}}},yAxis:{name:"",triggerEvent:!0,nameTextStyle:{color:"rgba(255,255,255,1)",fontSize:16,padding:[0,0,10,-20]},splitLine:{show:!0,lineStyle:{color:"#A6D9F6",type:"dashed"}},axisTick:{show:!1},axisLine:{show:!1},axisLabel:{show:!0,textStyle:{color:"rgba(24, 255, 255, 0.8)",fontSize:14}}},series:[{name:"\u9762\u79EF(\u4EA9)",barMinHeight:10,type:"pictorialBar",barCategoryGap:"60%",symbolOffset:[1,-5],symbol:"path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",itemStyle:{normal:{color:new Pe(0,0,0,1,[{offset:0,color:"rgba(255, 255, 0, 1)"},{offset:1,color:"rgba(255, 255, 0, 1)"}])}},label:{show:!0,position:"top",textStyle:{color:"#ffffff"}},data:n,z:0}]};e.on("click",l=>xe(l)),ae(e,a)}function oe(){const e=re($.value);let t=g.value,n=0;t.forEach(a=>{a.name=a.subregionName,a.value=Number(a.farm).toFixed(2),n+=a.farm});let o={color:["rgba(49, 235, 7, 1)","rgba(84, 170, 255, 1)","rgba(255, 251, 0, 1)","rgba(255, 168, 8, 1)","rgba(255, 0, 255, 1)"],title:{text:"\u975E\u519C\u5316\u603B\u9762\u79EF",subtext:`${n.toFixed(2)}\u4EA9`,textStyle:{color:"#f2f2f2",fontSize:14},subtextStyle:{fontSize:14,color:["#ff9d19"]},x:"center",y:"center"},grid:{top:0},tooltip:{trigger:"item",axisPointer:{type:"shadow"},formatter:"{a} <br/>{b} : {c}\u4EA9 <br/>\u767E\u5206\u6BD4 : {d}%"},series:[{radius:["50%","71%"],center:["50%","50%"],type:"pie",label:{normal:{show:!1}},labelLine:{normal:{show:!1}},name:"\u975E\u519C\u5316\u9762\u79EF\u5360\u6BD4",data:t},{radius:["50%","54%"],center:["50%","50%"],type:"pie",label:{normal:{show:!1},emphasis:{show:!1}},labelLine:{normal:{show:!1},emphasis:{show:!1}},animation:!1,tooltip:{show:!1},data:[{value:1,itemStyle:{color:"rgba(250,250,250,0.3)"}}]},{name:"\u5916\u8FB9\u6846",type:"pie",clockWise:!1,hoverAnimation:!1,center:["50%","50%"],radius:["85%","85%"],tooltip:{show:!1},label:{normal:{show:!1}},data:[{value:9,name:"",itemStyle:{normal:{borderWidth:2,borderColor:"#0b5263"}}}]}]};ae(e,o)}function xe(e){console.log("\u53F3\u4E0B\u70B9\u51FB",e)}return(e,t)=>{const n=w("el-option"),o=w("el-select"),a=w("el-tooltip"),l=w("el-checkbox"),f=w("el-checkbox-group"),q=w("el-collapse-item"),y=w("el-collapse"),D=w("el-button");return p(),C("div",Oe,[Qe,i("div",$e,[i("div",He,[i("div",Ue,[Xe,i("p",{onClick:t[0]||(t[0]=r=>ie("https://1912c.oss-cn-beijing.aliyuncs.com/egg-oss-demo/zhongzhimianjishijian.xlsx"))},[T(" \u4E0B\u8F7D \xA0 "),Ze])]),G(o,{"popper-class":"select_city",modelValue:h.value,"onUpdate:modelValue":t[1]||(t[1]=r=>h.value=r),clearable:"",placeholder:"\u5168\u90E8"},{default:x(()=>[(p(!0),C(J,null,O(v(E).arr,r=>(p(),I(n,{key:r.subregionCode,label:r.subregionName,value:r.subregionCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),i("div",{ref_key:"ASdivisionDiv",ref:Q,class:"ASdivision"},null,512)]),i("div",Ke,[et,i("div",{ref_key:"typesofDiv",ref:$,class:"typesofDiv"},null,512)]),i("div",{class:"rightFoldDiv",onClick:t[2]||(t[2]=r=>ve())},[G(a,{disabled:!v(S),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"\u6536\u8D77",placement:"top"},{default:x(()=>[v(S)?(p(),C("img",tt)):M("v-if",!0)]),_:1},8,["disabled"]),G(a,{disabled:v(S),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"\u5C55\u5F00",placement:"top"},{default:x(()=>[v(S)?M("v-if",!0):(p(),C("img",ot))]),_:1},8,["disabled"])])]),G(y,{class:"legend",accordion:""},{default:x(()=>[G(q,{name:"1"},{title:x(()=>[T("\u56FE\u4F8B")]),default:x(()=>[i("div",at,[G(f,{modelValue:j.value,"onUpdate:modelValue":t[4]||(t[4]=r=>j.value=r),onChange:e.change},{default:x(()=>[(p(!0),C(J,null,O(v(R),(r,b,F)=>(p(),I(l,{key:F,style:De({background:r.color,border:`1px solid ${r.color}`,width:"100%"}),modelValue:e.checked3,"onUpdate:modelValue":t[3]||(t[3]=u=>e.checked3=u),disabled:r.disabled,label:b},null,8,["style","modelValue","disabled","label"]))),128))]),_:1},8,["modelValue","onChange"])])]),_:1})]),_:1}),i("div",rt,[v(P).length>0?(p(),I(Be,{key:0,dataSource:v(P),onDataHandle:we},null,8,["dataSource"])):M("v-if",!0)]),nt,i("div",lt,[st,i("div",it,[(p(!0),C(J,null,O(v(B),(r,b)=>(p(),C("div",{key:b},[i("p",null,[ct,T(" : "),i("span",null,Ae(Number(r.farm).toFixed(2))+"(\u4EA9)",1)])]))),128))]),dt]),se.value?(p(),I(D,{key:0,class:"back_button",onClick:t[5]||(t[5]=r=>e.back())},{default:x(()=>[T("\u8FD4\u56DE")]),_:1})):M("v-if",!0)])}}},xt=ke(ut,[["__scopeId","data-v-cd47b039"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/plough/agriculturization/index.vue"]]);export{xt as default};
|