You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
23 KiB
1 lines
23 KiB
var Jt=Object.defineProperty,Xt=Object.defineProperties;var Zt=Object.getOwnPropertyDescriptors;var Je=Object.getOwnPropertySymbols;var en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;var Xe=(i,l,r)=>l in i?Jt(i,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[l]=r,V=(i,l)=>{for(var r in l||(l={}))en.call(l,r)&&Xe(i,r,l[r]);if(Je)for(var r of Je(l))tn.call(l,r)&&Xe(i,r,l[r]);return i},q=(i,l)=>Xt(i,Zt(l));var E=(i,l,r)=>new Promise((L,S)=>{var f=w=>{try{h(r.next(w))}catch(C){S(C)}},u=w=>{try{h(r.throw(w))}catch(C){S(C)}},h=w=>w.done?L(w.value):Promise.resolve(w.value).then(f,u);h((r=r.apply(i,l)).next())});import{g as Ze}from"./index-e9f36657-1786523779314.js";import{A as nn}from"./assets-e9e9e2ea-1786523779314.js";/* empty css */import{f as sn,c as et,b as an,g as tt}from"./townshipBoundaries-cae3b8e0-1786523779314.js";import{a as rn,b as ln,c as nt,g as un}from"./openApi-ed147efe-1786523779314.js";import{a as on}from"./pastureApi-826909a4-1786523779314.js";import{n as cn,r as dn}from"./index-5554c2d9-1786523779314.js";import{q as st,r as vn,s as fn}from"./screen2Standard-447167ef-1786523779314.js";import{c as gn,F as mn}from"./featurePanelLayout-3e9b38ef-1786523779314.js";import{M as yn}from"./index-74449043-1786523779314.js";import{_ as hn}from"./TopicSwitcher-c573196f-1786523779314.js";import{_ as wn}from"./LayerPanel-bb27344a-1786523779314.js";import{a as at,_ as bn}from"./FeatureInfoPanel-b52dcca5-1786523779314.js";import{_ as kn,g as c,o as k,c as _,a as b,t as fe,F as xe,y as Pe,n as se,K as ge,d as m,q as _n,h as pn,w as G,A as te,b as z,j as ne,C as rt,x as it,u as Te,z as Ln}from"./index-1786523779314.js";import{_ as lt}from"./index-211f76b2-1786523779314.js";import"./geoserver-8d0689ad-1786523779314.js";const Sn="/openApi",Nn=`${Sn}/screen2/resource/grassland/ndvi-timeline`;function Tn(){return E(this,null,function*(){const i=cn(yield dn(Nn)),l=Array.isArray(i==null?void 0:i.rows)?i.rows:[];return xn(l)})}function xn(i=[]){const l=new Set;return i.map((r,L)=>{const S=Pn(ut(r,["url","layerName","layer_name","layer","name"]));if(!S)return null;const f=ut(r,["date","month","time","label"])||S,u=Mn(f);return{key:`${S}-${f||L}`,label:u,date:String(f),layerName:S,source:r}}).filter(Boolean).filter(r=>l.has(r.key)?!1:(l.add(r.key),!0))}function ut(i,l){for(const r of l)if((i==null?void 0:i[r])!==void 0&&(i==null?void 0:i[r])!==null&&(i==null?void 0:i[r])!=="")return i[r]}function Pn(i){const l=String(i||"").trim();return l?l.includes(":")||/^https?:\/\//i.test(l)?l:`ne:${l}`:""}function Mn(i){const l=String(i||"").trim();if(!l)return"";const r=l.match(/(\d{4})[-_/年. ]?(1[0-2]|0?[1-9])(?:月)?/);return r?`${r[1]}.${String(Number(r[2])).padStart(2,"0")}`:l}const $n={class:"grassland-ndvi-timeline-head"},Cn={key:0,class:"grassland-ndvi-timeline-state"},Fn={key:1,class:"grassland-ndvi-timeline-state is-error"},An={key:2,class:"grassland-ndvi-timeline-state"},In={key:3,class:"grassland-ndvi-timeline-body"},Vn=["aria-checked","title","onClick"],En={class:"grassland-ndvi-timeline-label"},Bn=42,Rn=28,qn={__name:"GrasslandNdviTimeline",props:{items:{type:Array,default:()=>[]},modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},status:{type:String,default:"idle"}},emits:["update:modelValue"],setup(i,{emit:l}){const r=i,L=l,S=c(()=>r.items.findIndex(d=>d.key===r.modelValue)),f=c(()=>S.value===-1?Math.max(0,r.items.length-1):S.value),u=c(()=>r.items[f.value]||null),h=c(()=>r.loading?"加载中":"未选择"),w=c(()=>r.items.length>7),C=c(()=>w.value?Rn:Bn),I=c(()=>X(f.value)),ae=c(()=>D(f.value));function Q(d){if(!r.items.length)return;const v=Math.min(r.items.length-1,Math.max(0,f.value+d));L("update:modelValue",r.items[v].key)}function re(d){!d||d.key===r.modelValue||L("update:modelValue",d.key)}function J(d){return!r.items.length||d<0?0:r.items.length===1?.5:d/(r.items.length-1)}function X(d){const v=J(d),P=p(v*100),y=C.value*(1-v*2);return`calc(${P}% ${y<0?"-":"+"} ${p(Math.abs(y))}px)`}function D(d){const v=J(d);return v<=0?"0px":`calc(${p(v*100)}% - ${p(C.value*2*v)}px)`}function p(d){return Number(d.toFixed(4)).toString()}return(d,v)=>{var P;return k(),_("div",{class:se(["grassland-ndvi-timeline",{"is-dense":w.value}])},[b("div",$n,[v[2]||(v[2]=b("span",null,"草地健康/退化",-1)),b("strong",null,fe(((P=u.value)==null?void 0:P.label)||h.value),1)]),i.loading?(k(),_("div",Cn,"加载月份数据")):i.status==="error"?(k(),_("div",Fn,"月份数据加载失败")):i.items.length?(k(),_("div",In,[b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"上一期",onClick:v[0]||(v[0]=y=>Q(-1))},"‹"),b("div",{class:"grassland-ndvi-timeline-track",style:ge({"--timeline-active-left":I.value,"--timeline-fill-width":ae.value,"--timeline-edge-offset":`${C.value}px`}),role:"radiogroup","aria-label":"草地健康退化月份"},[v[4]||(v[4]=b("div",{class:"grassland-ndvi-timeline-line"},null,-1)),v[5]||(v[5]=b("div",{class:"grassland-ndvi-timeline-fill"},null,-1)),v[6]||(v[6]=b("div",{class:"grassland-ndvi-timeline-thumb"},[b("i")],-1)),(k(!0),_(xe,null,Pe(i.items,(y,j)=>{var O,N;return k(),_("button",{key:y.key,class:se(["grassland-ndvi-timeline-mark",{"is-active":y.key===((O=u.value)==null?void 0:O.key),"is-past":j<=f.value,"is-staggered":w.value&&j%2===1}]),type:"button",role:"radio","aria-checked":y.key===((N=u.value)==null?void 0:N.key),style:ge({left:X(j)}),title:y.date,onClick:W=>re(y)},[v[3]||(v[3]=b("span",{class:"grassland-ndvi-timeline-tick"},null,-1)),b("span",En,fe(y.label),1)],14,Vn)}),128))],4),b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"下一期",onClick:v[1]||(v[1]=y=>Q(1))},"›")])):(k(),_("div",An,"暂无月份数据"))],2)}}},Gn=kn(qn,[["__scopeId","data-v-45f308f0"]]),zn={class:"forest-grass-wet"},Dn={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},jn={class:"fgw-left"},On={class:"fgw-side-stack is-left"},Wn={class:"fgw-right"},Hn={class:"fgw-side-stack is-right"},Kn={key:2,class:"fgw-ndvi-timeline"},Un={class:"fgw-bottom-topic"},Yn={key:0,class:"loading"},Qn={class:"loading-progress"},Jn={class:"value"},ms={__name:"index",props:{showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["topic-stats"],setup(i,{expose:l,emit:r}){const L=i,S=r,f=m(null),u=m(sn[0].key),h=m(""),w=m([]),C=m([]),I=m("idle"),ae=m(!1),Q=m({title:"业务统计",rows:[]}),re=m({title:"业务统计",rows:[]}),J=m([]),X=m([]),D=m(null),p=m(""),d=m(null),v=m(!1),P=m(!1),y=m(null),j=m(0),O=m(L.showLoading),N=m([]),W=m("idle"),F=m(""),B=m({type:"idle",text:"等待 GeoServer 图层加载"});let Z=null,$=!1,me=!1,H=!1,A=null,Me=0,$e=0,ye=0,K=0,ie=0,le=!1,he=!1;const ot={图斑编号:"patch_no",图斑号:"patch_no",湿地编号:"land_number",草地编号:"land_number",林地类型:"dlmc",地类:"landUseName",地类名称:"landUseName",所在乡镇:"townName",所在区域:"full_name",面积:"acreage",图斑面积:"acreage",湿地面积:"acreage",草场面积:"acreage",草原类:"grassTypeName",草原型:"grassMinType",草原等级:"grasslandLevel",草原类型:"basic_type_name",小斑干草产量:"xbGcYield",小斑鲜草产量:"xbXcYield",鲜草产量:"xcYield",干草产量:"gcYield",海拔:"elevation",地貌:"landformName",权属单位:"qsdwmc",坐落单位:"zldwmc",林班:"lin_ban",小班:"xiao_ban",森林类别:"sen_lin_lb",林种:"lin_zhong",公益林等级:"gjgyl_bhdj",保护等级:"bh_dj",质量等级:"zl_dj",优势树种:"you_shi_sz",起源:"qi_yuan",龄组:"ling_zu",郁闭度:"yu_bi_du",林地权属:"ld_qs",土地使用权属:"tdsyqs",林木权属:"lmqs",生态区位:"stqwmc",坡度等级:"slope"},ct=new Set(["grassland-distribution","basic-grassland","grassland-level","grassland-type","grassland-yield","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]),dt=[{topicKey:"wetland",layerKey:"wetland-distribution",name:"湿地分布",legendName:"湿地资源"},{topicKey:"grassland",layerKey:"grassland-distribution",name:"草地分布",legendName:"草地资源"},{topicKey:"woodland",layerKey:"woodland-distribution",name:"林地分布",legendName:"林地资源"}],vt=new Set(["code","msg","message","success","data","result","grassland","wetland","woodland","basicGrassland","dyColumn","geom","wkt","geometry","the_geom","theGeom","shape","shape_leng","shape_length","length","perimeter","gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].map(e=>e.toLowerCase())),ft=c(()=>et(u.value)),gt=c(()=>an(u.value)),ue=c(()=>dt.map(e=>Nt(e)).filter(Boolean)),oe=c(()=>u.value==="overview"?ue.value:gt.value),Ce=c({get(){return u.value==="overview"?w.value:h.value},set(e){if(u.value==="overview"){w.value=Array.isArray(e)?e.map(String).filter(Boolean):[];return}h.value=String(e||"")}}),ee=c(()=>h.value?tt(u.value,h.value):null),U=c(()=>u.value==="grassland"&&h.value==="grassland-health"),mt=c(()=>U.value),Fe=c(()=>N.value.find(e=>e.key===F.value)||null),Y=c(()=>{var e;return(((e=ee.value)==null?void 0:e.legends)||[]).find(t=>t.key===p.value)||null}),yt=c(()=>ue.value.flatMap(e=>e.legends||[])),we=c(()=>{var e;return u.value==="overview"?yt.value:((e=ee.value)==null?void 0:e.legends)||[]}),ht=c(()=>oe.value.length>0),Ae=c(()=>oe.value.length<=6&&we.value.length<=8),Ie=c(()=>{if(!Ae.value)return 430;const e=Math.max(1,oe.value.length),t=Math.max(1,Math.ceil(we.value.length/2)),n=e*34+Math.max(0,e-1)*5,s=30+t*28;return Math.max(220,Math.min(430,72+n+s))}),wt=c(()=>{var s,a;if(u.value==="overview"){const o=new Set(w.value),g=ue.value.filter(M=>o.has(M.key));return Tt(g)}const e=ee.value;if(!e||U.value&&!((s=Fe.value)!=null&&s.layerName))return null;let t=(a=Y.value)!=null&&a.cqlFilter?q(V({},e),{cqlFilter:Y.value.cqlFilter,activeLegend:Y.value,name:Y.value.name||e.name}):e;const n=Fe.value;return U.value&&(n!=null&&n.layerName)&&(t=q(V({},t),{layerName:n.layerName,name:`${e.name} ${n.label}`,timelineDate:n.label,timelineItem:n})),t}),Ve=m(typeof window=="undefined"?1080:window.innerHeight),Ee=st.sideCardWidth;c(()=>st.sideCardGap);const Be=c(()=>vn(Ve.value)),bt=c(()=>fn(Be.value,2)),be=c(()=>!!y.value),kt=mn,Re=c(()=>gn({point:y.value?St(y.value):null,rowCount:d.value?Se(d.value):0,loading:P.value,empty:v.value||!d.value})),_t=c(()=>Re.value.height),pt=c(()=>Re.value.style),Lt=c(()=>{var n,s,a,o,g,M,x;const e=((s=(n=d.value)==null?void 0:n.layer)==null?void 0:s.overviewTopicKey)||((o=(a=d.value)==null?void 0:a.layer)==null?void 0:o.topicKey)||u.value;return{grassland:"草地详情",wetland:"湿地详情",woodland:"林地详情"}[e]||`${((M=(g=d.value)==null?void 0:g.layer)==null?void 0:M.name)||((x=ft.value)==null?void 0:x.name)||"资源"}详情`});function St(e){const t=document.querySelector(".forest-grass-wet"),n=t==null?void 0:t.getBoundingClientRect();return!(n!=null&&n.width)||!(n!=null&&n.height)?e:{x:(e.x-n.left)/n.width*1920,y:(e.y-n.top)/n.height*1080}}function ke(){Ve.value=typeof window=="undefined"?1080:window.innerHeight}function Nt({topicKey:e,layerKey:t,name:n,legendName:s}){var g;const a=tt(e,t);if(!a||a.key!==t)return null;const o=((g=a.legends)==null?void 0:g[0])||{};return q(V({},a),{name:n,overviewTopicKey:e,legends:[q(V({},o),{key:`overview-${t}`,name:s,selectable:!1})]})}function Tt(e=[]){const t=e.filter(Boolean);if(!t.length)return null;const[n,...s]=t;return q(V({},n),{overlayLayers:s})}_n(()=>{ke(),window.addEventListener("resize",ke),document.addEventListener("pointerdown",Ke,!0),xt(),pe(u.value,""),ce(u.value,"")}),pn(()=>{$=!0,A&&window.clearTimeout(A),window.removeEventListener("resize",ke),document.removeEventListener("pointerdown",Ke,!0)}),G(u,e=>{le=!0,p.value="",h.value="",e==="overview"&&(w.value=[]),T(),B.value={type:"idle",text:"等待 GeoServer 图层加载"},pe(e,""),ce(e,"",null),te(()=>{le=!1})}),G(h,()=>{le||(he=!0,p.value="",T(),B.value={type:h.value?"loading":"idle",text:h.value?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},u.value!=="woodland"&&pe(u.value,h.value),ce(u.value,h.value,null),te(()=>{he=!1}))}),G(w,()=>{u.value==="overview"&&(p.value="",T(),B.value={type:w.value.length?"loading":"idle",text:w.value.length?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},D.value=He("overview",w.value.join(",")))},{deep:!0}),G(p,()=>{le||he||(T(),ce(u.value,h.value,Y.value))}),G(U,e=>{if(e){$t();return}F.value=""}),G(F,()=>{U.value&&T()}),G(()=>L.active,e=>{var t,n,s,a;f.value&&(e?(_e(),(n=(t=f.value).resume)==null||n.call(t)):(a=(s=f.value).pause)==null||a.call(s))});function xt(){var n;Z=new nn;const e={progress:0};Z.instance.on("onProgress",(s,a,o)=>{const g=Math.floor(a/o*100);Ze.to(e,{progress:g,onUpdate:()=>{j.value=Math.floor(e.progress)}})});const t=()=>{$||me||(me=!0,_e())};Z.instance.on("onLoad",t),(n=Z.ready)==null||n.then(t).catch(()=>{$||(B.value={type:"error",text:"地图资源加载失败"})})}function _e(){$||!L.active||!me||H||(H=!0,A&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,qe()},600))}function qe(e=0){return E(this,null,function*(){var n,s,a,o,g;if($)return;if(!L.active){H=!1;return}if(yield te(),!L.active){H=!1;return}if(!!((s=(n=f.value)==null?void 0:n.loadMap)!=null&&s.call(n,Z)||(o=(a=f.value)==null?void 0:a.hasMap)!=null&&o.call(a))){yield Qt(),yield te(),(g=f.value)==null||g.play();return}if(e<24){window.setTimeout(()=>qe(e+1),120);return}H=!1})}function Pt(){A&&(window.clearTimeout(A),A=null)}function Ge(){var e,t,n,s;(t=(e=f.value)==null?void 0:e.resume)==null||t.call(e),(s=(n=f.value)==null?void 0:n.refreshView)==null||s.call(n)}function Mt(){var e,t;if(T(),B.value={type:"loading",text:"地图正在复位"},(t=(e=f.value)==null?void 0:e.hasMap)!=null&&t.call(e)){Ge(),B.value={type:"success",text:"地图已复位"};return}Pt(),H=!1,te(()=>{_e()})}l({refreshMapView:Ge,resetMap:Mt});function pe(n){return E(this,arguments,function*(e,t=h.value){const s=e==="woodland"?"":t,a=++$e;ae.value=!0,I.value="loading";const o=yield rn(e,s);$||a!==$e||e===u.value&&(e!=="woodland"&&(s||"")!==(h.value||"")||Ct(o,e))})}function $t(e=!1){return E(this,null,function*(){if(!U.value)return;if(!e&&N.value.length){ze();return}const t=++ye;W.value="loading";try{const n=yield Tn();if($||t!==ye)return;N.value=n,W.value=n.length?"success":"empty",ze()}catch(n){if($||t!==ye)return;N.value=[],F.value="",W.value="error"}})}function ze(){if(!N.value.length){F.value="";return}N.value.some(t=>t.key===F.value)||(F.value=N.value[N.value.length-1].key)}function Ct(e,t){var s,a,o;const n=Ft(e);C.value=n.core||[],Q.value=n.left||{title:"业务统计",rows:[]},re.value=n.right||{title:"业务统计",rows:[]},J.value=(s=n.leftPanels)!=null&&s.length?n.leftPanels:[Q.value],X.value=(a=n.rightPanels)!=null&&a.length?n.rightPanels:[re.value],I.value=n.status,ae.value=!1,S("topic-stats",{topicKey:t,topicName:et(t).name,items:((o=n.top)!=null&&o.length?n.top:n.core||[]).slice(0,4)})}function Ft(e){return e||{}}function De(e,t){return`${u.value}-${t}-${(e==null?void 0:e.key)||(e==null?void 0:e.title)||"panel"}`}function Le(e){var n;const t=((n=e==null?void 0:e.rows)==null?void 0:n.length)||0;return(e==null?void 0:e.span)===1?!1:(e==null?void 0:e.span)===2?!0:(e==null?void 0:e.type)==="spotlight"||(e==null?void 0:e.type)==="metric"||(e==null?void 0:e.type)==="column"&&t<=5?!1:(e==null?void 0:e.type)==="rank"&&t>4||(e==null?void 0:e.type)==="split"&&t>4||(e==null?void 0:e.type)==="donut"&&t>5||(e==null?void 0:e.type)==="structure"&&t>4||(e==null?void 0:e.type)==="bar"&&t>4||(e==null?void 0:e.type)==="line"&&t>6}function je(e){return Le(e)?bt.value:Be.value}function Se(e){const t=(e==null?void 0:e.properties)||{};return Object.keys(t).filter(s=>Oe(s,t[s])).length}function Oe(e,t){return t==null||t===""||Array.isArray(t)||typeof t=="object"?!1:!vt.has(String(e||"").toLowerCase())}function At(){if(u.value==="overview"){const e=new Set(w.value);return ue.value.filter(t=>e.has(t.key)).slice().reverse()}return ee.value?[ee.value]:[]}function It(e={}){const t=String(e.overviewTopicKey||u.value||"").toLowerCase(),n=`${e.key||""} ${e.layerName||""} ${t}`.toLowerCase();return n.includes("basic-grassland")||n.includes("resource_basic_grassland")?"basicGrassland":t==="woodland"||n.includes("woodland")||n.includes("t_woodland")?"woodland":t==="wetland"||n.includes("wetland")||n.includes("shidi")?"wetland":t==="grassland"||n.includes("grassland")?"grassland":""}function Vt(e={}){const t=We(e.lng),n=We(e.lat);return t===""||n===""?"":`POINT(${t} ${n})`}function We(e){const t=Number(e);return Number.isFinite(t)?t.toFixed(8).replace(/\.?0+$/,""):""}function Et(){return E(this,arguments,function*(e={}){var M,x,R,Ue,de,Ye;const t=Number((M=e==null?void 0:e.lngLat)==null?void 0:M.lng),n=Number((x=e==null?void 0:e.lngLat)==null?void 0:x.lat),s=At();if(!Number.isFinite(t)||!Number.isFinite(n)||!s.length){T();return}const a=++K,o=ie,g=e.screen||{x:960,y:540};y.value=null,d.value=null,v.value=!1,P.value=!0,(Ue=(R=f.value)==null?void 0:R.clearSelectedFeature)==null||Ue.call(R);try{for(const Qe of s){const ve=yield Bt(Qe,{lng:t,lat:n});if(a!==K||$)return;if(ve){d.value=ve,y.value=Ne(ve,g),v.value=!1,(Ye=(de=f.value)==null?void 0:de.highlightFeature)==null||Ye.call(de,ve,{highlightTone:"v21"});return}}a===K&&ie===o&&T()}catch(Qe){a===K&&ie===o&&T()}finally{a===K&&(P.value=!1)}})}function Bt(e,t){return E(this,null,function*(){const n=It(e);if(!n)return null;const s=Vt(t);let a=null;n==="grassland"?a=yield nt(s,n):n==="wetland"?a=yield on({wkt:s}):n==="woodland"?a=yield un(s):n==="basicGrassland"&&(a=yield nt(s,n));const o=Rt(a,n);if(!Gt(o))return null;const g=Dt(o,e,t,n);return Se(g)>0?g:null})}function Rt(e,t){var s,a,o,g,M;const n=[e==null?void 0:e[t],e==null?void 0:e.grassland,e==null?void 0:e.wetland,e==null?void 0:e.woodland,e==null?void 0:e.basicGrassland,(s=e==null?void 0:e.data)==null?void 0:s[t],(a=e==null?void 0:e.data)==null?void 0:a.grassland,(o=e==null?void 0:e.data)==null?void 0:o.wetland,(g=e==null?void 0:e.data)==null?void 0:g.woodland,(M=e==null?void 0:e.data)==null?void 0:M.basicGrassland,e==null?void 0:e.data,e==null?void 0:e.result,e];for(const x of n){const R=qt(x);if(R)return R}return null}function qt(e){return Array.isArray(e)?e.find(t=>t&&typeof t=="object")||null:e&&typeof e=="object"?e:null}function Gt(e){return!e||typeof e!="object"?!1:Array.isArray(e.dyColumn)&&e.dyColumn.some(zt)?!0:Object.keys(e).some(t=>Oe(t,e[t]))}function zt(e={}){const t=e==null?void 0:e.value;return t==null||t===""?!1:!!String((e==null?void 0:e.field)||(e==null?void 0:e.title)||"").trim()}function Dt(e,t,n,s){const a=Ot(e),o=jt(e);return{id:e.id||e.patchNo||e.patch_no||e.landNumber||e.land_number||`${s}-${n.lng}-${n.lat}`,properties:a,feature:{type:"Feature",properties:a,geometry:o},geometry:o,layer:t,lngLat:n}}function jt(e={}){return e.geometry||e.geom||e.wkt||e.the_geom||e.theGeom||e.geo||e.geometryWkt||e.geometry_wkt||e.shape||null}function Ot(e={}){const t=V({},e);return(Array.isArray(e.dyColumn)?e.dyColumn:[]).forEach(s=>{const a=s==null?void 0:s.value;if(a==null||a==="")return;const o=ot[String((s==null?void 0:s.title)||"").trim()],g=String((s==null?void 0:s.field)||"").trim();[g,Wt(g),o].filter(Boolean).forEach(x=>{(t[x]===void 0||t[x]===null||t[x]==="")&&(t[x]=a)})}),t}function Wt(e){return String(e||"").replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function ce(s,a){return E(this,arguments,function*(e,t,n=Y.value){const o=++Me;if(!t||!Ht(t,n)){D.value=He(e,t);return}const g=yield ln(e,t,n);$||o!==Me||e!==u.value||t!==h.value||((n==null?void 0:n.key)||"")===p.value&&(D.value=q(V({},g),{hideTownLabelStats:!0}))})}function Ht(e,t=null){return!!(t!=null&&t.key)||ct.has(e)}function He(e,t){return{status:"disabled",topicKey:e,layerKey:t,title:"",unit:"",hideTownLabelStats:!0,rows:[]}}function Kt(e){var n,s;ie+=1;const t=(s=(n=e==null?void 0:e.feature)!=null?n:e)!=null?s:null;if(!t||Se(t)<=0){T();return}d.value=t,v.value=!1,y.value=Ne(t,(e==null?void 0:e.screen)||y.value)}function Ne(e,t=null){var n,s,a,o;return((s=(n=f.value)==null?void 0:n.getVectorFeatureAnchorScreen)==null?void 0:s.call(n,e))||((o=(a=f.value)==null?void 0:a.getVectorFeatureScreen)==null?void 0:o.call(a,e))||t}function Ut(){if(!be.value||!d.value)return;const e=Ne(d.value,y.value);if(!e)return;const t=y.value;t&&Math.abs(Number(t.x)-Number(e.x))<.5&&Math.abs(Number(t.y)-Number(e.y))<.5||(y.value=e)}function Yt(e){B.value=e}function T(){var e,t;K+=1,d.value=null,v.value=!1,P.value=!1,y.value=null,(t=(e=f.value)==null?void 0:e.clearSelectedFeature)==null||t.call(e)}function Ke(e){if(!be.value)return;const t=document.querySelector(".fgw-map-feature-info"),n=document.querySelector(".forest-grass-wet .cesium-map"),s=e.target;t&&s instanceof Node&&t.contains(s)||n&&s instanceof Node&&n.contains(s)||T()}function Qt(){return O.value?new Promise(e=>{Ze.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{O.value=!1,e()}})}):Promise.resolve()}return(e,t)=>(k(),_("div",zn,[z(yn,{ref_key:"mapSceneRef",ref:f,"active-layer":wt.value,"map-ranking":D.value,"admin-boundary-line-scale":1.65,"initial-zoom":9,"auto-apply-layer-map-view":!1,"max-zoom":21,"hide-town-label-stats":"","enable-imagery-feature-pick":!0,"emit-empty-feature-info-on-miss":!1,"enable-town-polygon-pick":!1,onFeatureLoading:t[0]||(t[0]=n=>P.value=n),onFeatureInfo:Kt,onMapClick:Et,onLayerStatus:Yt,onViewChange:Ut},null,8,["active-layer","map-ranking"]),b("div",Dn,[I.value==="error"||I.value==="empty"?(k(),_("div",{key:0,class:se(["fgw-data-state",{"is-error":I.value==="error"}]),role:"status"},fe(I.value==="error"?"数据库数据加载失败,请稍后重试":"数据库暂无数据"),3)):ne("",!0),b("div",jn,[b("div",On,[(k(!0),_(xe,null,Pe(J.value,n=>(k(),rt(lt,{key:De(n,"left"),class:se(["fgw-side-card left-card",{"is-double":Le(n)}]),title:n.title,width:Te(Ee),height:je(n)},{default:it(()=>[z(at,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),b("div",Wn,[b("div",Hn,[(k(!0),_(xe,null,Pe(X.value,n=>(k(),rt(lt,{key:De(n,"right"),class:se(["fgw-side-card right-card",{"is-double":Le(n)}]),title:n.title,width:Te(Ee),height:je(n)},{default:it(()=>[z(at,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),ht.value?(k(),_("div",{key:1,class:"fgw-map-layer-tools",style:ge({height:`${Ie.value}px`})},[z(wn,{modelValue:Ce.value,"onUpdate:modelValue":t[1]||(t[1]=n=>Ce.value=n),"selected-legend-key":p.value,"onUpdate:selectedLegendKey":t[2]||(t[2]=n=>p.value=n),"topic-key":u.value,layers:oe.value,legends:we.value,multiple:u.value==="overview",width:248,height:Ie.value,compact:Ae.value},null,8,["modelValue","selected-legend-key","topic-key","layers","legends","multiple","height","compact"])],4)):ne("",!0),mt.value?(k(),_("div",Kn,[z(Gn,{modelValue:F.value,"onUpdate:modelValue":t[3]||(t[3]=n=>F.value=n),items:N.value,loading:W.value==="loading",status:W.value},null,8,["modelValue","items","loading","status"])])):ne("",!0),be.value?(k(),_("div",{key:3,class:"fgw-map-feature-info",style:ge(pt.value)},[z(bn,{title:Lt.value,feature:d.value,empty:v.value,loading:P.value,width:Te(kt),height:_t.value,closable:"",onClose:T},null,8,["title","feature","empty","loading","width","height"])],4)):ne("",!0),b("div",Un,[z(hn,{modelValue:u.value,"onUpdate:modelValue":t[4]||(t[4]=n=>u.value=n)},null,8,["modelValue"])])]),O.value?(k(),_("div",Yn,[t[6]||(t[6]=Ln('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),b("div",Qn,[b("span",Jn,fe(j.value),1),t[5]||(t[5]=b("span",{class:"unit"},"%",-1))])])):ne("",!0)]))}};export{ms as default};
|
|
|