Agriculture-front-end/dist/assets/Site.3131275c.js

2 lines
47 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{Q as e,_ as a,I as t,r as o,u as r,a2 as l,a7 as n,x as i,ad as s,H as u,d,o as c,c as m,l as g,f as h,O as p,K as v,M as b,n as f,e as y,w,m as S,k as x,V as _,W as k,A as z,J as L,N as E,aa as $,S as A,q as C,s as W}from"./index.e5c8b0d6.js";import{_ as N}from"./fh.7489c25e.js";import j from"./downloads.e955445d.js";import{_ as T}from"./qx.88a5ecd3.js";import{_ as V,a as M}from"./zhankaiss.6870329f.js";import{_ as I}from"./dow.b4b83e88.js";import"./index.2809c208.js";import{T as B}from"./TimeLine.89abb5b7.js";import{u as O,w as G}from"./xlsx.881b8a71.js";import{u as q}from"./useEcharts.31b48034.js";import"./linesGL.76a64914.js";import{e as F}from"./element-resize-detector.d4d1cd8d.js";import"./browser-detector.d146ab9e.js";import{ai as P,aj as Q}from"./linkSeriesData.e74eae00.js";/* empty css */function D(a){return e({url:"crops/farmland",method:"get",params:a})}function J(a){return e({url:"crops/highStandards",method:"get",params:a})}function R(a){return e({url:"crops/gradeStatistics",method:"get",params:a})}function Z(a){return e({url:"crops/administrativeDivisions",method:"get",params:a})}function Y(a){return e({url:"crops/growthTime",method:"get",params:a})}const U=e=>(C("data-v-a07d4b0a"),e=e(),W(),e),X={class:"fatherDiv"},H={class:"centerBox"},K=U((()=>g("div",{style:{width:"100%",height:"100%"},id:"cesiumContainer"},null,-1))),ee={class:"rightWra"},ae=[U((()=>g("img",{src:N},null,-1))),U((()=>g("span",null,"返回",-1)))],te={class:"tabar"},oe={class:"leftTop"},re={class:"title"},le=U((()=>g("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}},null,-1))),ne=U((()=>g("span",null,"作物长势等级面积统计",-1))),ie=U((()=>g("img",{src:j,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1))),se={class:"leftbottom"},ue={class:"title"},de=U((()=>g("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}},null,-1))),ce=U((()=>g("span",null,"作物长势等级面积占比",-1))),me=U((()=>g("img",{src:j,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1))),ge={class:"tableDiv"},he={class:"rightTop"},pe={class:"title"},ve=U((()=>g("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}},null,-1))),be=U((()=>g("span",null,"作物长势等级统计-高标准农田",-1))),fe=U((()=>g("img",{src:j,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1))),ye={key:0},we=[U((()=>g("img",{src:T},null,-1)))],Se={class:"rightbottom"},xe={class:"title"},_e=U((()=>g("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}},null,-1))),ke=U((()=>g("span",null,"作物长势等级统计-行政区划",-1))),ze=U((()=>g("img",{src:j,style:{width:"14px",height:"14px",cursor:"pointer"}},null,-1))),Le=U((()=>g("img",{src:V},null,-1))),Ee=U((()=>g("img",{src:M},null,-1))),$e={class:"bottom_center"},Ae={id:"popup",class:"ol-popup"},Ce=U((()=>g("div",{class:"pophead",style:{width:"100%"}},[g("div",{id:"popup-title",style:{"font-size":"20px","font-weight":"400","letter-spacing":"1px","line-height":"42px","padding-left":"20px","border-radius":"8px",margin:"20px",background:"rgba(100, 195, 164, 0.05)"}}),g("a",{href:"#",id:"popup-closer",class:"ol-popup-closer"})],-1))),We={id:"popup-content",style:{padding:"10px"}},Ne={class:"perform"},je={class:"perform_children"},Te=U((()=>g("div",{class:"label"},"好:",-1))),Ve={class:"perform_children"},Me=U((()=>g("div",{class:"label"},"较好:",-1))),Ie={class:"perform"},Be={class:"perform_children"},Oe=U((()=>g("div",{class:"label"},"适中:",-1))),Ge={class:"perform_children"},qe=U((()=>g("div",{class:"label"},"较差:",-1))),Fe={class:"perform"},Pe={class:"perform_children"},Qe=U((()=>g("div",{class:"label"},"差:",-1))),De=U((()=>g("div",{id:"popup-pagination"},null,-1))),Je={id:"pop"},Re={key:0},Ze=U((()=>g("div",null,"村名:",-1))),Ye={class:"mt-4"},Ue={class:"mt-4"},Xe={class:"tabulation"},He={class:"searchDiv"},Ke=U((()=>g("img",{src:I,alt:""},null,-1))),ea={class:"tableBox"},aa={class:"tableBorder"},ta={class:"example-pagination-block"},oa={class:"chartMode"},ra=a({__name:"Site",setup(a){let C={};const W=t({"小麦":{disabled:!1},"玉米":{disabled:!1},"大豆":{disabled:!1},"花生":{disabled:!1}}),N=o("小麦");function j(e){}const T=r();o(null);const V=o(null),M=o(null),I=o(null);o(null);const U=o(null),ra=o("");ra.value=window.localStorage.getItem("divisions"),o(null);let la=t({arr:[],brr:[],crr:[]});t({arr:[]}),o({}),o([]),o([]);const na=o(!1);o(!0);let ia=o(!1);o("{x:765,y:191}");let sa=o([]),ua=o([]),da=o(0);o([]);let ca=o(["false"]),ma=o([]);const ga=o(0);let ha=o([]),pa=o(!0);const va=o(null);let ba=o(1),fa=o(12),ya=o([]),wa=o([]),Sa=o(!0);o(null),o(null),o("");let xa=o([]),_a=o([]),ka=o(""),za=o(""),La=o(0),Ea=o([]),$a=o(""),Aa=o(5),Ca=o([]),Wa=o(!0),Na=!(window.localStorage.getItem("divisions").length>6),ja="青岛西海岸新区"==window.localStorage.getItem("deptName")?"黄岛区":window.localStorage.getItem("deptName"),Ta=o([{"好":0,"较好":0,"适中":0,"较差":0,"差":0}]),Va=o([]),Ma=["2019年高标准农田片区1","2019年高标准农田片区2","2019年高标准农田片区3","2019年高标准农田片区4","2020年高标准农田片区","2021年高标准农田片区","2022年高标准农田片区1","2022年高标准农田片区2","2022年高标准农田片区3","2022年高标准农田片区4","2022年高标准农田片区5","2022年高标准农田片区6","2022年高标准农田片区7"],Ia={good:[],better:[],moderate:[],poor:[],difference:[]};const Ba=o([]);let Oa=o({cropperType:"花生",time:"",statistical:"镇",droughtRating:"",area:ga.value}),Ga=o([]),qa={"好":{color:"rgba(49, 235, 7, 1)",disabled:!1},"较好":{color:"rgba(84, 170, 255, 1)",disabled:!1},"适中":{color:"rgba(255, 251, 0, 1)",disabled:!1},"较差":{color:"rgba(255, 168, 8, 1)",disabled:!1},"差":{color:"rgba(255, 0, 255, 1)",disabled:!1}},Fa=0;const Pa=e=>{let a=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:`${serverAPI.geoserverUrl}/map-${e.time}_${e.ZuoWu}/rest/maps/${e.name}@${e.setOf}`,cacheEnabled:!1}),name:e.name,projection:"EPSG:4326"});Ya.addLayer(a)};var Qa={title:[]};let Da=o({good:[],better:[],difference:[],moderate:[],poor:[]}),Ja=o(null),Ra=o([]);function Za(){var e,a;ht(),e=document.querySelector(".centerBox"),a=document.getElementById("cesiumContainer"),Ya=new ol.Map({target:"cesiumContainer",controls:[],view:new ol.View({center:[119.86763411957472,35.88435182141938],zoom:11,maxZoom:16.5,projection:"EPSG:4326"}),layers:[new ol.layer.Tile({source:new ol.source.XYZ({url:`${serverAPI.tiandituLayers}`,projection:serverAPI.flag?"EPSG:4326":"EPSG:3857"}),preload:20})]}),Ya.on("moveend",(function(e){Ya.getView().getZoom()>=13?Ja.setVisible(!0):Ja.setVisible(!1)})),Ya.on("singleclick",(function(e){var a=e.coordinate;if(Na){var t=a[0],o=a[1],r=Ya.getView(),l=Ya.getView().getZoom();r.animate({center:[t,o],duration:1e3});let n=!1;if(["CJQY3702112019WGS84","XJQY3702112019WGS84"].forEach((e=>{Ya.getLayers().getArray().forEach(((a,t)=>{e!=a.A.name||(n=!0)}))})),n)l>=13?Ha(e,"CJQY3702112019WGS84@huangdaoqu_bianjie",`${serverAPI.geoserverUrl}/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84%40huangdaoqu_bianjie`,"村"):Ha(e,"XJQY3702112019WGS84@huangdaoqu_bianjie",`${serverAPI.geoserverUrl}/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84%40huangdaoqu_bianjie`,"镇");else{let t=`${serverAPI.geoserverUrl}/data-2019-2022gaobiaozhunnongtian/rest/data`,o=new ol.supermap.GetFeaturesBySQLParameters({queryParameter:{name:"T2019_2022高标准农田片区@2019-2022gaobiaozhunnongtian",attributeFilter:`DKMC = '${za.value}'`},datasetNames:["2019-2022gaobiaozhunnongtian:T2019_2022高标准农田片区"]});new ol.supermap.FeatureService(t).getFeaturesBySQL(o,(function(t){let o=(new ol.format.GeoJSON).readFeatures(t.result.features),r=new ol.source.Vector;r.addFeatures(o);let l=new ol.layer.Vector({source:r}).getSource().getFeatures();for(var n=0;n<l.length;n++)l[n].getGeometry().intersectsCoordinate(a)&&Ha(e,"T2019_2022高标准农田片区@2019-2022gaobiaozhunnongtian",`${serverAPI.geoserverUrl}/map-2019-2022gaobiaozhunnongtian/rest/maps/T2019_2022%E9%AB%98%E6%A0%87%E5%87%86%E5%86%9C%E7%94%B0%E7%89%87%E5%8C%BA@2019-2022gaobiaozhunnongtian`,"高标准")}))}}else{let t=`${serverAPI.geoserverUrl}/data-huangdaoqu_bianjie/rest/data`,o=new ol.supermap.GetFeaturesBySQLParameters({queryParameter:{name:"XJQY3702112019WGS84@huangdaoqu_bianjie",attributeFilter:`XJQYMC = '${ja}'`},datasetNames:["huangdaoqu_bianjie:XJQY3702112019WGS84"]});new ol.supermap.FeatureService(t).getFeaturesBySQL(o,(function(t){let o=(new ol.format.GeoJSON).readFeatures(t.result.features),r=new ol.source.Vector;r.addFeatures(o);let l=new ol.layer.Vector({source:r}).getSource().getFeatures();for(var n=0;n<l.length;n++)if(l[n].getGeometry().intersectsCoordinate(a)){var i=a[0],s=a[1],u=Ya.getView(),d=Ya.getView().getZoom();u.animate({center:[i,s],duration:1e3});let t=!1;["CJQY3702112019WGS84","XJQY3702112019WGS84"].forEach((e=>{Ya.getLayers().getArray().forEach(((a,o)=>{e!=a.A.name||(t=!0)}))})),t?d>=13?Ha(e,"CJQY3702112019WGS84@huangdaoqu_bianjie",`${serverAPI.geoserverUrl}/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84%40huangdaoqu_bianjie`,"村"):Ha(e,"XJQY3702112019WGS84@huangdaoqu_bianjie",`${serverAPI.geoserverUrl}/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84%40huangdaoqu_bianjie`,"镇"):Ha(e,"T2019_2022高标准农田片区@2019-2022gaobiaozhunnongtian",`${serverAPI.geoserverUrl}/map-2019-2022gaobiaozhunnongtian/rest/maps/T2019_2022%E9%AB%98%E6%A0%87%E5%87%86%E5%86%9C%E7%94%B0%E7%89%87%E5%8C%BA@2019-2022gaobiaozhunnongtian`,"高标准")}}))}})),new ResizeObserver((function(e){e.forEach((function(e){var t=e.contentRect.width,o=e.contentRect.height;a.style.width=t+"px",a.style.height=o+"px",Ya.updateSize()}))})).observe(e),function(e){let a="",t="",o="",r="",l="";t=`${serverAPI.geoserverUrl}/data-huangdaoqu_bianjie/rest/data`,a=e,o="XJQY3702112019WGS84",r="huangdaoqu_bianjie",l="XJQYMC";var n=new ol.supermap.GetFeaturesBySQLParameters({queryParameter:{name:`${o}@${r}`,attributeFilter:`${l} like '%${a}%'`},datasetNames:[`${r}:${o}`]});new ol.supermap.FeatureService(t).getFeaturesBySQL(n,(function(e){if(0!=e.result.featureCount){var a=Ya.getLayers().getArray().find((e=>"zhezhao"===e.get("id")));Ya.removeLayer(a);var t=Ya.getLayers().getArray().find((e=>"dianjigaoliang"===e.get("id")));Ya.removeLayer(t);var o=(new ol.format.GeoJSON).readFeatures(e.result.features);Ka(e.result.features.features[0].geometry.coordinates,"qu","rgba( 105, 105, 105, 1)",9999);var r=new ol.source.Vector;r.addFeatures(o);const n=new ol.style.Style({stroke:new ol.style.Stroke({color:"rgba(85, 255, 255, 1.0)",width:2})});var l=new ol.layer.Vector({id:"dianjigaoliang",source:r});l.setStyle(n),Ya.addLayer(l),Ya.getView().fit(r.getExtent())}}))}(ja),$.get("/json/huangdao.json").then((({data:e})=>{(new ol.format.GeoJSON).readFeatures(e)[0]})),at();for(const t in qa)!0!==qa[t].disabled&&ma.value.push(t);ca.value=ma.value,localStorage.setItem(T.currentRoute.value.path,!0),document.querySelector(".rightWra").style.transform="translate(101%,0)",localStorage.setItem(T.currentRoute.value.path,!0)}let Ya=o(null);o(null),o(null);let Ua=o(null),Xa=o(null);function Ha(a,t,r,l){var n=new ol.geom.Point(a.coordinate),i=new ol.supermap.QueryByGeometryParameters({queryParams:{name:t},geometry:n});let s=[],u=document.querySelector("#popup-title"),d=o(null),c=o(null);new ol.supermap.QueryService(r).queryByGeometry(i,(function(a){let t="";if(c=Ya.getLayers().getArray().find((e=>"zhezhao"===e.get("id"))),Ya.removeLayer(c),"镇"==l){let e=a.result.recordsets[0].features.features[0].properties.XJQYDM;ra.value=e,R({type:N.value,divisions:"370211",yearMonth:ka.value.name}).then((a=>{a.data.length>0?a.data.forEach((a=>{a.subregion==e&&(t=a.subregionName,xa.value=a)})):xa.value={},r()}))}else if("村"==l){let l=a.result.recordsets[0].features.features[0].properties.CJQYDM;(o={type:N.value,divisions:l,yearMonth:ka.value.name},e({url:"crops/administrativeDivisionsChun",method:"get",params:o})).then((e=>{e.data.length>0?(e.data.forEach((e=>{xa.value=e})),t=e.data[0].subregionName):(xa.value={},t=""),r()}))}else if("高标准"==l&&a.result.recordsets[0].features.features[0].properties.DKMC){let e=a.result.recordsets[0].features.features[0].properties.DKMC;J({type:N.value,divisions:"370211",yearMonth:ka.value.name}).then((a=>{a.data.forEach((a=>{a.region==e&&(xa.value=a)})),t=e,r()}))}var o;function r(e){if(a.result.currentCount>0){a.result.recordsets[0].features&&(Xa.setPosition(n.flatCoordinates),u.innerHTML=t),d=Ya.getLayers().getArray().find((e=>"dianjigaoliang"===e.get("id"))),Ya.removeLayer(d);var o=(new ol.format.GeoJSON).readFeatures(a.result.recordsets[0].features);s=a.result.recordsets[0].features.features[0].geometry.coordinates,Ka(a.result.recordsets[0].features.features[0].geometry.coordinates);var r=new ol.source.Vector;r.addFeatures(o);const e=new ol.style.Style({stroke:new ol.style.Stroke({color:"rgba(255, 219, 113, 1.0)",width:5})});var l=new ol.layer.Vector({id:"dianjigaoliang",source:r,zIndex:9999});l.setStyle(e),Ya.addLayer(l)}}})),Ua.addEventListener("click",(function(){c=Ya.getLayers().getArray().find((e=>"zhezhao"===e.get("id"))),Ya.removeLayer(c),et(s),ra.value=window.localStorage.getItem("divisions"),d=Ya.getLayers().getArray().find((e=>"dianjigaoliang"===e.get("id"))),Ya.removeLayer(d),d=Ya.getLayers().getArray().find((e=>"gao"===e.get("id"))),Ya.removeLayer(d),Xa.setPosition(void 0)}))}function Ka(e,a,t,o){let r=new ol.source.Vector;var l=new ol.layer.Vector({id:a||"zhezhao",source:r,zIndex:o||50,style:new ol.style.Style({fill:new ol.style.Fill({color:t||"rgba( 105, 105, 105, 0.9)"})})});const n=et(e),i=new ol.Feature({geometry:n});l.getSource().addFeature(i),Ya.addLayer(l)}function et(e){const a=ol.geom.Polygon.fromExtent([-180,-90,180,90]);return e.forEach((e=>{const t=new ol.geom.LinearRing(e[0]);a.appendLinearRing(t)})),a}const at=()=>{document.getElementById("popup"),document.getElementById("popup-content"),Ua=document.getElementById("popup-closer"),Xa=new ol.Overlay({element:document.getElementById("popup"),positioning:"bottom-center",stopEvent:!0,offset:[0,-10]}),Ya.addOverlay(Xa)};const tt=()=>{Ja=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:serverAPI.geoserverUrl+"/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84%40huangdaoqu_bianjie",cacheEnabled:!1}),name:"CJQY3702112019WGS84",projection:"EPSG:4326",zIndex:9999}),Ya.addLayer(Ja)},ot=()=>{var e=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:serverAPI.geoserverUrl+"/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84%40huangdaoqu_bianjie",cacheEnabled:!1}),name:"XJQY3702112019WGS84",projection:"EPSG:4326",zIndex:9999});Ya.addLayer(e)};let rt=o({label:[]});const lt=e=>{Wa.value=e,e?(Lt(),Et()):($t(),At())};const nt=()=>{Oa.value.time=ha.value[ha.value.length-1],Oa.value.statistical="镇",Oa.value.cropperType="小麦",Oa.value.droughtRating="",Oa.value.area=0,ga.value=0,Sa.value=!0,ut()},it=()=>{pa.value=!pa.value;const e=va.value;e.style.width=window.innerWidth-200+"px",e.style.height=window.innerHeight-200+"px";const a=P(e);window.addEventListener("resize",(()=>{e.style.width=window.innerWidth-200+"px",e.style.height=window.innerHeight-200+"px",a.resize()})),Ct()},st=e=>{Oa.value.area=e},ut=()=>{var a;ba.value=1,(a={type:Oa.value.cropperType,time:Oa.value.time,statistical:Oa.value.statistical,droughtRating:Oa.value.droughtRating,area:Oa.value.area},e({url:"crops/growthList",method:"get",params:a})).then((e=>{wa.value=[{lable:"",value:"区域名称"},{lable:"好",value:"好"},{lable:"较好",value:"较好"},{lable:"适中",value:"适中"},{lable:"较差",value:"较差"},{lable:"差",value:"差"}],Sa.value=!1,Ba.value=e.data,ya.value=e.data.slice((ba.value-1)*fa.value,(ba.value-1)*fa.value+fa.value),Va=o([]),e.data.forEach((e=>{Va.value.push({"区域名称":e.subName,"好":e.good,"较好":e.better,"适中":e.moderate,"较差":e.poor,"差":e.difference})})),Ta.value[0]["好"]=0,Ta.value[0]["较好"]=0,Ta.value[0]["适中"]=0,Ta.value[0]["较差"]=0,Ta.value[0]["差"]=0,Ta.value[0]["区域名称"]="合计",e.data.forEach((e=>{e.good&&(Ta.value[0]["好"]+=NaN!==Number(e.good)?Number(e.good):0),e.better&&(Ta.value[0]["较好"]+=NaN!==Number(e.better)?Number(e.better):0),e.moderate&&(Ta.value[0]["适中"]+=NaN!==Number(e.moderate)?Number(e.moderate):0),e.poor&&(Ta.value[0]["较差"]+=NaN!==Number(e.poor)?Number(e.poor):0),e.difference&&(Ta.value[0]["差"]+=NaN!==Number(e.difference)?Number(e.difference):0)}));for(const o in Ta.value[0])"合计"!==Ta.value[0][o]&&(Ta.value[0][o]=Ta.value[0][o].toFixed(2));const a=va.value;a.style.width=window.innerWidth-100+"px",a.style.height=window.innerHeight-100+"px";const t=P(a);window.addEventListener("resize",(()=>{a.style.width=window.innerWidth-200+"px",a.style.height=window.innerHeight-200+"px",t.resize()})),Ct()}))},dt=e=>{ba.value=e,ya.value=Ba.value.slice((ba.value-1)*fa.value,(ba.value-1)*fa.value+fa.value)},ct=e=>e+1+(ba.value-1)*fa.value,mt=e=>{La.value+=1,ma.value=[];for(const o in qa)!0!==qa[o].disabled&&ma.value.push(o);ca.value=ma.value;for(const o in C)Ya.getLayers().getArray().forEach(((e,a)=>{e.A.name==C[o].name&&Ya.getLayers().removeAt(a)}));ka.value=e;let a=e.name.replace(/-/g,"_"),t="";switch(N.value){case"小麦":t="xiaomaizhangshi";break;case"玉米":t="yumizhangshi";break;case"大豆":t="dadouzhangshi";break;case"花生":t="huashengzhangshi"}C={"好":{setOf:`${e.name}_${t}`,name:`T${a}_hao`,time:e.name,ZuoWu:t},"较好":{setOf:`${e.name}_${t}`,name:`T${a}_jiaohao`,time:e.name,ZuoWu:t},"适中":{setOf:`${e.name}_${t}`,name:`T${a}_shizhong`,time:e.name,ZuoWu:t},"较差":{setOf:`${e.name}_${t}`,name:`T${a}_jiaocha`,time:e.name,ZuoWu:t},"差":{setOf:`${e.name}_${t}`,name:`T${a}_cha`,time:e.name,ZuoWu:t}},ca.value.forEach((e=>{Pa(C[e])}))},gt=e=>{_a.value=Ca.value.slice((e-1)*Aa.value,e*Aa.value)},ht=()=>{Y().then((e=>{ka.value={name:e.data[e.data.length-1]},ha.value=e.data;let a=[];e.data.forEach((e=>{a.push({name:e})})),Ca.value=a,Ea.value=Math.ceil(Ca.value.length/5),$a=Math.ceil(a.length/5),_a.value=Ca.value.slice(($a-1)*Aa.value,$a*Aa.value),Oa.value.time=e.data[e.data.length-1],ut();let t=ka.value.name.replace(/-/g,"_"),o="";switch(N.value){case"小麦":o="xiaomaizhangshi";break;case"玉米":o="yumizhangshi";break;case"大豆":o="dadouzhangshi";break;case"花生":o="huashengzhangshi"}C={"好":{setOf:`${ka.value.name}_${o}`,name:`T${t}_hao`,time:ka.value.name,ZuoWu:o},"较好":{setOf:`${ka.value.name}_${o}`,name:`T${t}_jiaohao`,time:ka.value.name,ZuoWu:o},"适中":{setOf:`${ka.value.name}_${o}`,name:`T${t}_shizhong`,time:ka.value.name,ZuoWu:o},"较差":{setOf:`${ka.value.name}_${o}`,name:`T${t}_jiaocha`,time:ka.value.name,ZuoWu:o},"差":{setOf:`${ka.value.name}_${o}`,name:`T${t}_cha`,time:ka.value.name,ZuoWu:o}}}))},pt=(e,a,t)=>{sa=o([]),ua=o([]),D({type:e,divisions:a,yearMonth:t}).then((a=>{if(0==a.data.length)W[e].disabled=!0;else{W[e].disabled=!1;for(const e in a.data[0])a.data[0][e]&&(sa.value.push(e),ua.value.push(a.data[0][e]));Lt()}}))},vt=(a,t,r)=>{var l;(l={type:a,divisions:t,yearMonth:r},e({url:"crops/statistics",method:"get",params:l})).then((e=>{Ga=o([]);let a=o([]);da=o(0),e.data.length>0?e.data.forEach((e=>{da.value=Number(e.sum);for(const t in e){"sum"!==t&&Number.isFinite(e[t])&&(Ga.value.push({name:t,value:e[t]}),a.value.push({date:t,name:e[t]})),a.value.forEach((a=>{void 0!==e[`${a.date}Zb`]&&(a.address=(100*e[`${a.date}Zb`]).toFixed(2)+"%")}));let o=JSON.parse(JSON.stringify(a.value));o.forEach((e=>{switch(e.date){case"good":e.date="好";break;case"better":e.date="较好";break;case"moderate":e.date="适中";break;case"poor":e.date="较差";break;case"difference":e.date="差"}})),Ra.value=o}})):(a.value=[],Ra.value=[]),Et()}))};let bt=()=>{document.querySelector(".tool").style.display="none",tt(),Ja.setVisible(!1),ot();["2019-2022gaobiaozhunnongtian","gbz","dianjigaoliang","dianjigaoliangs","gao","zhezhao"].forEach((e=>{Ya.getLayers().getArray().forEach(((a,t)=>{a.A.name!=e&&a.A.id!=e||Ya.getLayers().removeAt(t)}))})),Ya.getView().animate({center:["119.88661841637813","35.85667692242919"],duration:1e3,zoom:11})};const ft=(e,a)=>{Da.value.better=[],Da.value.difference=[],Da.value.good=[],Da.value.moderate=[],Da.value.poor=[],R({type:N.value,divisions:e,yearMonth:a}).then((e=>{la.brr=e.data,la.arr=e.data.sort(((e,a)=>e.subregionName.length-a.subregionName.length)),la.arr.unshift({subregion:"370211",subregionName:"全部"});let a=[...e.data],t=[];a.splice(0,1),a.forEach((e=>{-1==t.indexOf(e.subregionName)&&t.push(e.subregionName)})),Qa.title=[...Object.values(t)],Qa.title.forEach(((a,t)=>{e.data.map((e=>{if(a===e.subregionName)return Da.value.better.push(e.better),Da.value.difference.push(e.difference),Da.value.good.push(e.good),Da.value.moderate.push(e.moderate),Da.value.poor.push(e.poor),e}))})),At()}))},yt=(e,a,t)=>{let o={good:[],better:[],difference:[],moderate:[],poor:[]};Z({type:e,divisions:a,yearMonth:t}).then((e=>{la.brr=e.data;let a=[...e.data],t=[];a.forEach((e=>{-1==t.indexOf(e.subregionName)&&t.push(e.subregionName)})),Qa.title=[...Object.values(t)],Qa.title.forEach(((a,t)=>{e.data.map((e=>{if(a===e.subregionName)return o.better.push(e.better),o.difference.push(e.difference),o.good.push(e.good),o.moderate.push(e.moderate),o.poor.push(e.poor),e}))})),Da.value=o,At()}))},wt=()=>{"370211"!==ra.value&&(yt(N.value,ra.value,ka.value.name),pt(N.value,ra.value,ka.value.name),vt(N.value,ra.value,ka.value.name)),"370211"==ra.value&&(ft("370211",ka.value.name),pt(N.value,"370211",ka.value.name),vt(N.value,"370211",ka.value.name))};const St=()=>{let e=JSON.parse(JSON.stringify(Ta.value[0]));e.region="合计",Va.value.push(e),zt(Va.value,"长势面积统计表","Sheet1")},xt=(e,a)=>e.map((e=>{const t={};for(const o in e)a[o]&&(t[a[o]]=e[o]);return t})),_t=(e,a="用户列表",t="Sheet1")=>{const o=xt(e,{region:"区域名称",good:"好(亩)",better:"较好(亩)",moderate:"适中(亩)",poor:"较差(亩)",difference:"差(亩)"}),r=O.json_to_sheet(o),l=O.book_new();O.book_append_sheet(l,r,t),G(l,a+"("+N.value+")"+".xlsx")},kt=(e,a="用户列表",t="Sheet1")=>{const o=xt(e,{date:"类型",name:"面积(亩)",address:"占比"}),r=O.json_to_sheet(o),l=O.book_new();O.book_append_sheet(l,r,t),G(l,a+"("+N.value+")"+".xlsx")},zt=(e,a="用户列表",t="Sheet1")=>{const o=xt(e,{"区域名称":"区域名称","好":"好(亩)","较好":"较好(亩)","适中":"适中(亩)","较差":"较差(亩)","差":"差(亩)"}),r=O.json_to_sheet(o),l=O.book_new();O.book_append_sheet(l,r,t),G(l,a+"("+N.value+")"+".xlsx")};function Lt(){const e=P(V.value);let a=ua.value,t=!1;t=a.length>14;var o={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{top:"13%",right:"5%",left:"18%",bottom:"10%"},xAxis:[{type:"category",data:["好","较好","适中","较差","差"],axisLine:{lineStyle:{color:"rgba(66, 192, 255, .3)"}},axisLabel:{interval:0,margin:10,color:"rgba(153, 153, 153, 1)",textStyle:{fontSize:14},rotate:"0"},axisTick:{show:!1}}],yAxis:{name:"面积(亩)",nameTextStyle:{color:"rgba(153, 153, 153, 1)",fontSize:14},type:"value",axisLabel:{color:"rgba(153, 153, 153, 1)"},splitLine:{lineStyle:{type:"dashed",color:"rgba(235, 238, 245, 1)"},show:!0},minInterval:1,axisLine:{show:!1},axisTick:{show:!1}},dataZoom:[{show:t,zoomLock:!0,type:"slider",realtime:!0,startValue:0,endValue:14,xAxisIndex:[0],bottom:"10",left:"30",height:10,borderColor:"rgba(0,0,0,0)",textStyle:{color:"#05D5FF"}}],series:[{type:"bar",data:a,barWidth:"15",itemStyle:{normal:{color:new Q(0,0,0,1,[{offset:0,color:"rgba(76, 183, 255, 1)"},{offset:.98,color:"rgba(62, 122, 255, 1)"}],!1),shadowColor:"rgba(5, 213, 255, 1)",shadowBlur:4,borderRadius:[20,20,0,0]}},label:{normal:{show:!0,lineHeight:10,formatter:"{c}",position:"top",textStyle:{color:"#fff",fontSize:10}}}}]};o&&e.setOption(o),window.addEventListener("resize",(function(){e.resize()})),F().listenTo(V.value,(()=>{A((()=>{e.resize()}))}))}function Et(){const e=P(M.value);Ga.value.forEach((e=>{switch(e.name){case"good":e.name="好";break;case"better":e.name="较好";break;case"moderate":e.name="适中";break;case"poor":e.name="较差";break;case"difference":e.name="差"}}));var a=Ga.value;let t={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:"总面积",subtext:`${da.value}`,textStyle:{color:"rgba(51, 51, 51, 1)",fontSize:14},subtextStyle:{fontSize:14,color:["#ff9d19"]},x:"center",y:"center"},grid:{top:0},legend:{orient:"vertical",top:"middle",right:"10%",textStyle:{color:"#333333",fontSize:14},icon:"roundRect",data:a},tooltip:{trigger:"item",axisPointer:{type:"shadow"},formatter:"{a} <br/>{b} : {c}亩 <br/>百分比 : {d}%"},series:[{radius:["60%","81%"],center:["50%","50%"],type:"pie",label:{normal:{show:!1}},labelLine:{normal:{show:!1}},name:"作物长势等级面积占比",data:a},{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)"}}]}]};q(e,t),F().listenTo(M.value,(()=>{A((()=>{e.resize()}))}))}function $t(){const e=P(I.value);let a={title:{text:"",subtext:""},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{top:"15%",left:"5%",right:"5%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:Ma,axisLine:{lineStyle:{color:"rgba(153, 153, 153, 1)",width:1,type:"solid"}},axisLabel:{color:"rgba(153, 153, 153, 1)",fontWeight:400,fontFamily:"SourceHanSansCN-Regular, SourceHanSansCN",fontSize:14}},yAxis:{name:"面积(亩)",nameTextStyle:{color:"rgba(153, 153, 153, 1)",fontSize:14},type:"value",axisLabel:{color:"rgba(153, 153, 153, 1)"},splitLine:{lineStyle:{type:"dashed",color:"rgba(235, 238, 245, 1)"},show:!0},minInterval:1,axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"好",type:"bar",barWidth:14,stack:"数量",data:Ia.good,itemStyle:{normal:{borderWidth:1,borderColor:"rgba(49, 235, 7, 1)",color:new Q(0,0,0,1,[{offset:0,color:"rgba(49, 235, 7, 1)"},{offset:1,color:"rgba(49, 235, 7, 1)"}])}}},{name:"较好",type:"bar",barWidth:14,stack:"数量",data:Ia.better,itemStyle:{normal:{borderWidth:1,borderColor:"rgba(84, 170, 255, 1)",color:new Q(0,0,0,1,[{offset:0,color:"rgba(84, 170, 255, 1)"},{offset:1,color:"rgba(84, 170, 255, 1)"}])}}},{name:"适中",type:"bar",barWidth:14,stack:"数量",data:Ia.moderate,itemStyle:{normal:{borderWidth:1,borderColor:"rgba(255, 251, 0, 1)",color:new Q(0,0,0,1,[{offset:0,color:"rgba(255, 251, 0, 1)"},{offset:1,color:"rgba(255, 251, 0, 1)"}])}}},{name:"较差",type:"bar",barWidth:14,stack:"数量",data:Ia.poor,itemStyle:{normal:{borderWidth:1,borderColor:"rgba(255, 168, 8, 1)",color:new Q(0,0,0,1,[{offset:0,color:"rgba(255, 168, 8, 1)"},{offset:1,color:"rgba(255, 168, 8, 1)"}])}}},{name:"差",type:"bar",barWidth:14,stack:"数量",data:Ia.difference,itemStyle:{normal:{borderWidth:1,borderColor:"rgba(255, 0, 255, 1)",color:new Q(0,0,0,1,[{offset:0,color:"rgba(255, 0, 255, 1)"},{offset:1,color:"rgba(255, 0, 255, 1)"}])}}}]};e.on("click",(function(e){var a=window.location.host;if(!/^(([-\u4E00-\u9FA5a-z0-9]{1,63})\.)+([\u4E00-\u9FA5a-z]{2,63})\.?$/.test(a)){document.querySelector(".tool").style.display="block",za.value=e.name;let a=["XJQY3702112019WGS84","CJQY3702112019WGS84"];!function(e){let a="",t="",o="",r="",l="";t=`${serverAPI.geoserverUrl}/data-2019-2022gaobiaozhunnongtian/rest/data`,a=e,o="T2019_2022高标准农田片区",r="2019-2022gaobiaozhunnongtian",l="DKMC";var n=new ol.supermap.GetFeaturesBySQLParameters({queryParameter:{name:`${o}@${r}`,attributeFilter:`DKMC like '%${a}%'`},datasetNames:[`${r}:${o}`]});new ol.supermap.FeatureService(t).getFeaturesBySQL(n,(function(e){if(0!=e.result.featureCount){var a=Ya.getLayers().getArray().find((e=>"zhezhao"===e.get("id")));Ya.removeLayer(a);var t=Ya.getLayers().getArray().find((e=>"gbz"===e.get("id")));Ya.removeLayer(t);var o=Ya.getLayers().getArray().find((e=>"dianjigaoliang"===e.get("id")));Ya.removeLayer(o);var r=Ya.getLayers().getArray().find((e=>"dianjigaoliangs"===e.get("id")));Ya.removeLayer(r);var l=(new ol.format.GeoJSON).readFeatures(e.result.features);Ka(e.result.features.features[0].geometry.coordinates,"gbz","rgba( 105, 105, 105, 1)",9999);var n=new ol.source.Vector;n.addFeatures(l);const s=new ol.style.Style({stroke:new ol.style.Stroke({color:"rgba(85, 255, 255, 1.0)",width:2})});var i=new ol.layer.Vector({id:"dianjigaoliang",source:n});i.setStyle(s),Ya.addLayer(i),Ya.getView().fit(n.getExtent())}}))}(e.name),a.forEach((e=>{Ya.getLayers().getArray().forEach(((a,t)=>{a.A.name==e&&Ya.getLayers().removeAt(t)}))})),["2019-2022gaobiaozhunnongtian","gbz","dianjigaoliang","dianjigaoliangs","gao"].forEach((e=>{Ya.getLayers().getArray().forEach(((a,t)=>{a.A.name!=e&&a.A.id!=e||Ya.getLayers().removeAt(t)}))})),Ja=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:`${serverAPI.geoserverUrl}/map-2019-2022gaobiaozhunnongtian/rest/maps/T2019_2022%E9%AB%98%E6%A0%87%E5%87%86%E5%86%9C%E7%94%B0%E7%89%87%E5%8C%BA@2019-2022gaobiaozhunnongtian`,cacheEnabled:!1}),name:"2019-2022gaobiaozhunnongtian",projection:"EPSG:4326",zIndex:9999}),Ya.addLayer(Ja)}})),a&&e.setOption(a,{notMerge:!0,grid:{bottom:20}}),q(e,a),F().listenTo(I.value,(()=>{A((()=>{e.resize()}))}))}function At(){const e=P(U.value);var a={grid:{bottom:"8%",left:"10%",right:"6%",top:"5%",containLabel:!0},tooltip:{formatter:function(e){return e.seriesName+'<span style="font-size: 14px; color: #f00;">'+e.value.toFixed(2)+"</span>亩"}},dataZoom:[{type:"slider",show:!1,zoomLock:!0,width:8,yAxisIndex:[0],bottom:30,top:20,right:10,startValue:0,endValue:4,handleIcon:"M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z",handleSize:"100%",handleStyle:{color:"#DBDBDB",height:"100%"},backgroundColor:"transparent",fillerColor:"#DBDBDB",textStyle:{color:"transparent"},dataBackground:{lineStyle:{color:"transparent"},areaStyle:{color:"transparent"}},borderColor:"transparent"},{type:"inside",id:"insideY",yAxisIndex:0,start:0,end:50,zoomOnMouseWheel:!1,moveOnMouseMove:!0,moveOnMouseWheel:!0}],xAxis:{type:"value",axisTick:{show:!1},axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}},yAxis:[{type:"category",axisTick:{show:!1},axisLine:{show:!1,lineStyle:{color:"#cdd3ee"}},splitLine:{show:!1},axisLabel:{show:!0,fontSize:12,color:"rgba(51, 51, 51, 1)",formatter:"{value}"},data:Qa.title,inverse:!0}],series:[{type:"bar",name:"好",stack:"总量",barMaxWidth:30,label:{show:!1,position:"好",textStyle:{fontSize:12,fontWeight:"bolder",color:"rgba(255,255,255,1)"}},itemStyle:{barBorderRadius:[0,0,0,0],barBorderRadius:[0,0,0,0],color:{colorStops:[{offset:0,color:"rgba(49, 235, 7, 1)"},{offset:1,color:"rgba(49, 235, 7, 1)"}]}},data:Da.value.good},{type:"bar",name:"较好",stack:"总量",barMaxWidth:30,label:{show:!1,position:"inside",formatter:"较好",textStyle:{fontSize:12,fontWeight:"bolder",color:"rgba(255,255,255,1)"}},itemStyle:{barBorderRadius:[0,0,0,0],color:{colorStops:[{offset:0,color:"rgba(84, 170, 255, 1)"},{offset:1,color:"rgba(84, 170, 255, 1)"}]}},data:Da.value.better},{type:"bar",name:"适中",stack:"总量",barMaxWidth:30,label:{show:!1,position:"inside",formatter:"适中",textStyle:{fontSize:12,fontWeight:"bolder",color:"rgba(255,255,255,1)"}},itemStyle:{barBorderRadius:[0,0,0,0],barBorderRadius:[0,0,0,0],color:{colorStops:[{offset:0,color:"rgba(255, 251, 0, 1)"},{offset:1,color:"rgba(255, 251, 0, 1)"}]}},data:Da.value.moderate},{type:"bar",name:"较差",stack:"总量",barMaxWidth:30,label:{show:!1,position:"inside",formatter:"较差",textStyle:{fontSize:12,fontWeight:"bolder",color:"rgba(255,255,255,1)"}},itemStyle:{barBorderRadius:[0,0,0,0],barBorderRadius:[0,0,0,0],color:{colorStops:[{offset:0,color:"rgba(255, 168, 8, 1)"},{offset:1,color:"rgba(255, 168, 8, 1)"}]}},data:Da.value.poor},{type:"bar",name:"差",stack:"总量",barMaxWidth:30,label:{show:!1,position:"inside",formatter:"差",textStyle:{fontSize:12,fontWeight:"bolder",color:"rgba(255,255,255,1)"}},itemStyle:{barBorderRadius:[0,0,0,0],barBorderRadius:[0,0,0,0],color:{colorStops:[{offset:0,color:"rgba(255, 0, 255, 1)"},{offset:1,color:"rgba(255, 0, 255, 1)"}]}},data:Da.value.difference}]};q(e,a),F().listenTo(U.value,(()=>{A((()=>{e.resize()}))}))}function Ct(){const e=P(va.value);let a=[],t=[],o=[],r=[],l=[],n=[];Ba.value.forEach((e=>{a.push(e.subName),null!==e.good?t.push(e.good):t.push(0),null!==e.better?o.push(e.better):o.push(0),null!==e.moderate?r.push(e.moderate):r.push(0),null!==e.poor?l.push(e.poor):l.push(0),null!==e.difference?n.push(e.difference):n.push(0)}));let i={tooltip:{trigger:"axis",formatter:function(e){let a=e[0].axisValueLabel+"</br>",t=0;for(let o=0;o<e.length;o++)t+=e[o].value,"合计"!==e[o].seriesName&&(a+=e[o].seriesName+""+e[o].value+"</br>");for(let o=0;o<e.length;o++)t+=Number(e[o].value),"合计"===e[o].seriesName&&(a+="合计:"+t);return a},axisPointer:{type:"shadow"}},legend:{top:5,left:10,icon:"rect",itemWidth:4,itemHeight:12,data:[]},dataZoom:[{type:"slider",width:"40%",top:"90%",zoomLock:!0,start:0,end:10/a.length*100,showDataShadow:!1,showDetail:!1,fillerColor:"rgba(64, 158, 255)",borderRadius:"50%",moveHandleSize:0,moveHandleStyle:{},left:"30%",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:"3%",right:"10%",bottom:"15%",top:"5%",containLabel:!0},xAxis:{type:"category",name:"区域",axisLabel:{fontSize:12,interval:0,rotate:0},axisLine:{lineStyle:{}},data:a},yAxis:[{type:"value",name:"面积(亩)",axisLabel:{},axisLine:{lineStyle:{}},splitLine:{lineStyle:{},show:!0}}],series:[{name:"好",type:"bar",barWidth:13,stack:"分类",itemStyle:{color:"rgba(49, 235, 7, 1)"},data:t},{name:"较好",type:"bar",barWidth:13,stack:"分类",itemStyle:{color:"rgba(84, 170, 255, 1)"},data:o},{name:"适中",type:"bar",barWidth:13,stack:"分类",itemStyle:{color:"rgba(255, 251, 0, 1)"},data:r},{name:"较差",type:"bar",barWidth:13,stack:"分类",itemStyle:{color:"rgba(255, 168, 8, 1)"},data:l},{name:"差",type:"bar",barWidth:13,stack:"分类",itemStyle:{color:"rgba(255, 0, 255, 1)"},data:n}]};i.tooltip.formatter=function(e){let a=e[0].axisValueLabel+"</br>",t=0;for(let o=0;o<e.length;o++)if("合计"!==e[o].seriesName){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${e[o].color}"></span>`;t+=e[o].value,a+=r+e[o].seriesName+""+e[o].value+"</br>"}for(let o=0;o<e.length;o++)"合计"===e[o].seriesName&&(a+="合计:"+t);return a},q(e,i)}l((()=>ra.value),(()=>{wt()})),l([()=>ka.value,()=>N.value],(([e,a])=>{var t,r;Wa.value=!0,xa.value=[],ra.value=window.localStorage.getItem("divisions"),pt(N.value,ra.value,ka.value.name),vt(N.value,ra.value,ka.value.name),Na?ft(ra.value,ka.value.name):yt(N.value,ra.value,ka.value.name),t=N.value,r=ka.value.name,o([]),Ia={good:[],better:[],moderate:[],poor:[],difference:[]},J({type:t,yearMonth:r,divisions:window.localStorage.getItem("divisions")}).then((e=>{Ma.forEach(((a,t)=>{e.data.map((e=>{if(a===e.region)for(const a in e)Ia[a]&&Ia[a].push(e[a])}))})),e.data.length>0&&$t()}));let l=ka.value.name.replace(/-/g,"_"),n="";switch(N.value){case"小麦":n="xiaomaizhangshi";break;case"玉米":n="yumizhangshi";break;case"大豆":n="dadouzhangshi";break;case"花生":n="huashengzhangshi"}C={"好":{setOf:`${ka.value.name}_${n}`,name:`T${l}_hao`,time:e.name,ZuoWu:n},"较好":{setOf:`${ka.value.name}_${n}`,name:`T${l}_jiaohao`,time:e.name,ZuoWu:n},"适中":{setOf:`${ka.value.name}_${n}`,name:`T${l}_shizhong`,time:e.name,ZuoWu:n},"较差":{setOf:`${ka.value.name}_${n}`,name:`T${l}_jiaocha`,time:e.name,ZuoWu:n},"差":{setOf:`${ka.value.name}_${n}`,name:`T${l}_cha`,time:e.name,ZuoWu:n}}}));const Wt=()=>{La.value=0};function Nt(e,a){let t=[],o=[];return null!==e&&null!==a&&(t=Object.keys(e),o=t.reduce(((e,t)=>(-1==a.findIndex((e=>e.type===t))&&e.push(t),e)),[])),o}return l([()=>ca.value,()=>N.value],(([e,a],[t,o])=>{if(a==o){if(e.length>=t.length&&La.value<1){e.filter((e=>{if(t.findIndex((a=>a===e))<0)return e})).forEach((e=>{C[e]&&Pa(C[e])}))}else if(e.length<t.length){t.filter((a=>{if(e.findIndex((e=>e===a))<0)return a})).forEach((e=>{C[e]&&Ya.getLayers().getArray().forEach(((a,t)=>{a.A.name&&a.A.name==C[e].name&&Ya.getLayers().removeAt(t)}))}))}}else["好","较好","适中","较差","差"].forEach((e=>{C[e]&&Ya.getLayers().getArray().forEach(((a,t)=>{a.A.name&&a.A.name==C[e].name&&Ya.getLayers().removeAt(t)}))})),setTimeout((()=>{e.forEach((e=>{C[e]&&Pa(C[e])}))}),0);Fa++,1==Fa&&(tt(),ot())})),n((()=>{Y().then((e=>{let a=e.data[e.data.length-1];D({type:"",divisions:ra.value,yearMonth:a}).then((e=>{let a=Nt(W,e.data);a.forEach((e=>{W[e].disabled=!0})),a.includes(N.value)&&(N.value=Object.keys(W).find((e=>!a.includes(e))))}))}))})),i((()=>{Za()})),s((()=>{ka.value.name&&ra.value&&D({type:"",divisions:ra.value,yearMonth:ka.value.name}).then((e=>{let a=Nt(W,e.data);Object.keys(W).forEach((e=>{W[e].disabled=!1})),a.forEach((e=>{W[e].disabled=!0})),a.includes(N.value)&&(N.value=Object.keys(W).find((e=>!a.includes(e))))}))})),u((()=>{"false"==localStorage.getItem(T.currentRoute.value.path)?(document.querySelector(".mode").style.display="block",document.querySelector(".mode").innerText="地图模式",window.document.querySelector("#screenfull").style.display="none"):(document.querySelector(".mode").style.display="block",document.querySelector(".mode").innerText="列表模式",window.document.querySelector("#screenfull").style.display="block")})),(e,a)=>{const t=d("el-table-column"),o=d("el-table"),r=d("el-option"),l=d("el-select"),n=d("el-icon"),i=d("el-tooltip"),s=d("el-radio"),u=d("el-radio-group"),$=d("el-collapse-item"),A=d("el-collapse"),C=d("el-checkbox"),T=d("el-checkbox-group"),O=d("el-button"),G=d("el-form-item"),q=d("el-input-number"),F=d("el-form"),P=d("el-pagination");return c(),m("div",X,[g("div",H,[K,g("div",ee,[g("div",{class:"tool",onClick:a[0]||(a[0]=e=>h(bt)())},ae),g("div",te,[g("div",{class:p(h(Wa)?"tabarS":""),onClick:a[1]||(a[1]=e=>lt(!0))}," 黄岛区 ",2),g("div",{class:p(h(Wa)?"":"tabarS"),onClick:a[2]||(a[2]=e=>lt(!1))}," 行政区 ",2)]),v(g("div",oe,[g("div",re,[le,ne,g("p",{onClick:a[3]||(a[3]=e=>(()=>{let e="";la.arr.forEach((a=>{a.subregion==ra.value&&(e="全部"==a.subregionName?"黄岛区":a.subregionName)})),D({type:N.value,divisions:ra.value,yearMonth:ka.value.name}).then((a=>{let t=[{region:"全部"==e?"黄岛区":e,good:a.data[0].good,better:a.data[0].better,moderate:a.data[0].moderate,poor:a.data[0].poor,difference:a.data[0].difference}];_t(t,`${t[0].region}作物长势等级面积统计`,`Sheet1-${N.value}`)}))})())},[f(" 下载   "),ie])]),g("div",{ref_key:"areaDiv",ref:V,class:"areaDiv"},null,512)],512),[[b,h(Wa)]]),v(g("div",se,[g("div",ue,[de,ce,g("p",{onClick:a[4]||(a[4]=e=>(()=>{let e="";la.arr.forEach((a=>{a.subregion==ra.value&&(e="全部"==a.subregionName?"黄岛区":a.subregionName)})),kt(Ra.value,`${e}作物长势等级面积占比`,`Sheet1-${N.value}`)})())},[f(" 下载   "),me])]),g("div",{ref_key:"typesofDiv",ref:M,class:"typesofDiv"},null,512),g("div",ge,[y(o,{data:h(Ra),style:{width:"100%,color:'red'"}},{default:w((()=>[y(t,{prop:"date",label:"类型"}),y(t,{prop:"name",label:"面积(亩)"}),y(t,{prop:"address",label:"占比"})])),_:1},8,["data"])])],512),[[b,h(Wa)]]),v(g("div",he,[g("div",pe,[ve,be,h(Na)?(c(),m("p",{key:0,onClick:a[5]||(a[5]=e=>(()=>{let e=[];J({type:N.value,yearMonth:ka.value.name,divisions:"370211"}).then((a=>{a.data.forEach((a=>{e.push({region:a.region,good:a.good,better:a.better,moderate:a.moderate,poor:a.poor,difference:a.difference})})),_t(e,"作物长势等级统计-高标准农田列表",`Sheet1-${N.value}`)}))})())},[f(" 下载   "),fe])):S("",!0)]),v(g("div",{ref_key:"farmlandDiv",ref:I,class:"farmlandDiv"},null,512),[[b,h(Na)]]),h(Na)?S("",!0):(c(),m("div",ye,we))],512),[[b,!h(Wa)]]),v(g("div",Se,[g("div",xe,[_e,ke,g("p",{onClick:a[6]||(a[6]=e=>(()=>{let e="",a=[];la.arr.forEach((a=>{a.subregion==ra.value&&(e="全部"==a.subregionName?"黄岛区":a.subregionName)})),"370211"===ra.value?R({type:N.value,divisions:ra.value,yearMonth:ka.value.name,whetherToDownload:!1}).then((t=>{t.data.forEach((e=>{a.push({region:e.subregionName,good:e.good,better:e.better,moderate:e.moderate,poor:e.poor,difference:e.difference})})),_t(a,`${e}作物长势等级统计-行政区划`,`Sheet1-${N.value}`)})):Z({type:N.value,divisions:ra.value,yearMonth:ka.value.name,whetherToDownload:!1}).then((t=>{t.data.forEach((e=>{a.push({region:e.subregionName,good:e.good,better:e.better,moderate:e.moderate,poor:e.poor,difference:e.difference})})),_t(a,`${e}作物长势等级统计-行政区划`,"Sheet1")}))})())},[f(" 下载   "),ze])]),h(Na)?(c(),x(l,{key:0,"popper-class":"select_citys",style:{width:"300px"},onChange:a[7]||(a[7]=a=>wt(e.item)),modelValue:ra.value,"onUpdate:modelValue":a[8]||(a[8]=e=>ra.value=e),placeholder:"全部"},{default:w((()=>[(c(!0),m(_,null,k(h(la).arr,(e=>(c(),x(r,{key:e.subregion,label:e.subregionName,value:e.subregion},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])):S("",!0),g("div",{ref_key:"ASdivisionDiv",ref:U,class:"ASdivision"},null,512)],512),[[b,!h(Wa)]]),g("div",{class:"rightFoldDiv",onClick:a[9]||(a[9]=e=>(ia.value=!ia.value,void(ia.value?document.querySelector(".rightWra").style.transform="translate(0,0)":document.querySelector(".rightWra").style.transform="translate(101%,0)")))},[y(i,{disabled:!h(ia),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"收起",placement:"top"},{default:w((()=>[h(ia)?(c(),x(n,{key:0},{default:w((()=>[Le])),_:1})):S("",!0)])),_:1},8,["disabled"]),y(i,{disabled:h(ia),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"展开",placement:"top"},{default:w((()=>[h(ia)?S("",!0):(c(),x(n,{key:0},{default:w((()=>[Ee])),_:1}))])),_:1},8,["disabled"])])]),g("div",$e,[h(_a).length>0?(c(),x(B,{key:0,dataSource:h(_a),onDataHandle:mt,allCount:h(Ea),onGetcurrentPage:gt},null,8,["dataSource","allCount"])):S("",!0)]),g("div",Ae,[Ce,g("div",We,[g("div",Ne,[g("div",je,[Te,g("span",null,z(h(xa).good)+"亩",1)]),g("div",Ve,[Me,g("span",null,z(h(xa).better)+"亩",1)])]),g("div",Ie,[g("div",Be,[Oe,g("span",null,z(h(xa).moderate)+"亩",1)]),g("div",Ge,[qe,g("span",null,z(h(xa).poor)+"亩",1)])]),g("div",Fe,[g("div",Pe,[Qe,g("span",null,z(h(xa).difference)+"亩",1)])])]),De]),g("div",Je,[(c(!0),m(_,null,k(h(rt).label,((e,a)=>(c(),m("div",{key:a},[g("div",null,z(e.crop)+"",1),g("div",null,z(e.Shape_Area.toFixed(2))+" 亩",1)])))),128)),h(rt).XZQMC?(c(),m("div",Re,[Ze,g("div",null,z(h(rt).XZQMC),1)])):S("",!0),g("div",{class:"cancel",onClick:a[10]||(a[10]=(...a)=>e.hiddenOverlayChart&&e.hiddenOverlayChart(...a))},"X")]),y(A,{class:"legend2",accordion:"",style:{"box-shadow":"5px 5px 5px rgba(0, 0, 0, 0.2)"}},{default:w((()=>[y($,{name:"2"},{title:w((()=>[f(z(N.value),1)])),default:w((()=>[g("div",Ye,[y(u,{modelValue:N.value,"onUpdate:modelValue":a[11]||(a[11]=e=>N.value=e),onChange:j},{default:w((()=>[(c(!0),m(_,null,k(W,((e,a,t)=>(c(),x(s,{key:t,"v-model":e.disabled,disabled:e.disabled,label:a},{default:w((()=>[f(z(a),1)])),_:2},1032,["v-model","disabled","label"])))),128))])),_:1},8,["modelValue"])])])),_:1})])),_:1}),y(A,{class:"legend1",accordion:""},{default:w((()=>[y($,{name:"1"},{title:w((()=>[f("图例")])),default:w((()=>[g("div",Ue,[y(T,{modelValue:h(ca),"onUpdate:modelValue":a[12]||(a[12]=e=>L(ca)?ca.value=e:ca=e),onChange:Wt},{default:w((()=>[(c(!0),m(_,null,k(h(qa),((e,a,t)=>(c(),x(C,{key:t,"v-model":e.disabled,disabled:e.disabled,label:a},{default:w((()=>[g("span",{style:E({background:e.color,border:`1px solid ${e.color}`,width:"10px",height:"10px",display:"flex","margin-right":"5px"})},null,4),f(" "+z(a),1)])),_:2},1032,["v-model","disabled","label"])))),128))])),_:1},8,["modelValue"])])])),_:1})])),_:1}),na.value?(c(),x(O,{key:0,class:"back_button",onClick:a[13]||(a[13]=e=>(ft("370211"),delete rt.value.XZQMC,deleteEntityByName("townLine"),deleteEntityByName("villageLine"),ra.value="370211",wt(),na.value=!1,void hiddenOverlayChart()))},{default:w((()=>[f("返回")])),_:1})):S("",!0)]),g("div",Xe,[g("div",He,[y(F,{inline:!0,model:h(Oa),class:"demo-form-inline"},{default:w((()=>[y(G,{label:"时间:"},{default:w((()=>[y(l,{"popper-class":"selectCity",modelValue:h(Oa).time,"onUpdate:modelValue":a[14]||(a[14]=e=>h(Oa).time=e),placeholder:"请选择"},{default:w((()=>[(c(!0),m(_,null,k(h(ha),((a,t)=>(c(),x(r,{key:t,label:e.Zitem,value:a},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),y(G,{label:"统计方式:"},{default:w((()=>[y(l,{"popper-class":"selectCity",modelValue:h(Oa).statistical,"onUpdate:modelValue":a[15]||(a[15]=e=>h(Oa).statistical=e),placeholder:"请选择"},{default:w((()=>[y(r,{label:"镇级",value:"镇"}),y(r,{label:"村级",value:"村"}),h(Na)?(c(),x(r,{key:0,label:"高标准农田",value:"高标准农田"})):S("",!0)])),_:1},8,["modelValue"])])),_:1}),y(G,{label:"作物类型"},{default:w((()=>[y(l,{"popper-class":"selectCity",modelValue:h(Oa).cropperType,"onUpdate:modelValue":a[16]||(a[16]=e=>h(Oa).cropperType=e)},{default:w((()=>[(c(!0),m(_,null,k(W,((e,a,t)=>(c(),x(r,{label:a,value:a},null,8,["label","value"])))),256))])),_:1},8,["modelValue"])])),_:1}),y(G,{label:"长势等级"},{default:w((()=>[y(l,{modelValue:h(Oa).droughtRating,"onUpdate:modelValue":a[17]||(a[17]=e=>h(Oa).droughtRating=e),"popper-class":"selectCity",placeholder:"请选择"},{default:w((()=>[y(r,{label:"全部",value:""}),y(r,{label:"好",value:"好"}),y(r,{label:"较好",value:"较好"}),y(r,{label:"适中",value:"适中"}),y(r,{label:"较差",value:"较差"}),y(r,{label:"差",value:"差"})])),_:1},8,["modelValue"])])),_:1}),y(G,{label:"面积(亩)>"},{default:w((()=>[y(q,{modelValue:ga.value,"onUpdate:modelValue":a[18]||(a[18]=e=>ga.value=e),min:0,onChange:st},null,8,["modelValue"])])),_:1}),y(G,null,{default:w((()=>[y(O,{type:"primary",onClick:ut},{default:w((()=>[f("查询")])),_:1}),y(O,{plain:"",onClick:nt},{default:w((()=>[f("重置")])),_:1}),h(Sa)?S("",!0):(c(),x(O,{key:0,type:"primary",text:"",onClick:St},{default:w((()=>[Ke,f(" 下载 ")])),_:1}))])),_:1})])),_:1},8,["model"]),g("div",{class:"modeDiv",onClick:it},[g("div",{class:p(h(pa)?"Selected":"")},"表格模式",2),g("div",{class:p(h(pa)?"":"Selecteds")},"图表模式",2)])]),v(g("div",ea,[g("div",aa,[h(Sa)?S("",!0):(c(),x(o,{key:0,data:h(Ta),"header-cell-style":{"text-align":"center"},"cell-style":{"text-align":"center"},style:{width:"100%"},"highlight-current-row":"","header-row-class-name":"tabth"},{default:w((()=>[y(t,{prop:"",width:"80"}),(c(!0),m(_,null,k(h(wa),((e,a)=>(c(),x(t,{key:a,prop:e.value,label:0==a?e.lable:e.lable+"(亩)"},null,8,["prop","label"])))),128))])),_:1},8,["data"]))]),y(o,{data:h(ya),"header-cell-style":{"text-align":"center"},"cell-style":{"text-align":"center"},height:"80%","highlight-current-row":"","header-row-class-name":"tabth"},{default:w((()=>[y(t,{type:"index",width:"80",label:"序号",index:ct}),y(t,{prop:"subName",label:"区域名称"}),y(t,{prop:"good",label:"好(亩)"}),y(t,{prop:"better",label:"较好(亩)"}),y(t,{prop:"moderate",label:"适中(亩)"}),y(t,{prop:"poor",label:"较差(亩)"}),y(t,{prop:"difference",label:"差(亩)"})])),_:1},8,["data"]),g("div",ta,[f(" 共"+z(Ba.value.length)+"条 ",1),y(P,{background:"",layout:"prev, pager, next",total:Ba.value.length,"current-page":h(ba),"page-size":h(fa),onCurrentChange:dt},null,8,["total","current-page","page-size"])])],512),[[b,h(pa)]]),v(g("div",oa,[g("div",{ref_key:"chartModeDiv",ref:va,class:"chartModeDiv"},null,512)],512),[[b,!h(pa)]])])])}}},[["__scopeId","data-v-a07d4b0a"]]);export{ra as default};