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 Qt=Object.defineProperty,Xt=Object.defineProperties;var Zt=Object.getOwnPropertyDescriptors;var Qe=Object.getOwnPropertySymbols;var Jt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var Xe=(l,a,i)=>a in l?Qt(l,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[a]=i,V=(l,a)=>{for(var i in a||(a={}))Jt.call(a,i)&&Xe(l,i,a[i]);if(Qe)for(var i of Qe(a))en.call(a,i)&&Xe(l,i,a[i]);return l},q=(l,a)=>Xt(l,Zt(a));var E=(l,a,i)=>new Promise((k,S)=>{var f=y=>{try{w(i.next(y))}catch(C){S(C)}},u=y=>{try{w(i.throw(y))}catch(C){S(C)}},w=y=>y.done?k(y.value):Promise.resolve(y.value).then(f,u);w((i=i.apply(l,a)).next())});import{g as Ze}from"./index-e9f36657-1786515885761.js";import{A as tn}from"./assets-cb0bc798-1786515885761.js";/* empty css */import{f as nn,c as Je,b as sn,g as et}from"./townshipBoundaries-887ecf27-1786515885761.js";import{a as an,b as rn,g as ln,c as un}from"./openApi-3a1e1e33-1786515885761.js";import{g as on,a as cn}from"./pastureApi-d7c2dd37-1786515885761.js";import{q as tt,r as dn,s as vn}from"./screen2Standard-fc4c4b8d-1786515885761.js";import{c as fn,F as gn}from"./featurePanelLayout-3e9b38ef-1786515885761.js";import{M as mn}from"./index-3a516f22-1786515885761.js";import{_ as hn}from"./TopicSwitcher-2a8a4223-1786515885761.js";import{_ as wn}from"./LayerPanel-5bbc8201-1786515885761.js";import{a as nt,_ as yn}from"./FeatureInfoPanel-12415fbd-1786515885761.js";import{_ as bn,g as c,o as p,c as _,a as b,t as fe,F as Ne,y as Pe,n as se,K as ge,d as m,q as kn,h as pn,w as G,A as te,b as j,j as ne,C as st,x as at,u as xe,z as _n}from"./index-1786515885761.js";import{_ as rt}from"./index-5fcd057f-1786515885761.js";import"./index-bb4d300c-1786515885761.js";import"./geoserver-49cbec99-1786515885761.js";const Ln="/jsyApi/api/map/ndvi_timeline";function Sn(){return E(this,null,function*(){const l=yield fetch(Ln,{credentials:"include",headers:{Accept:"application/json"}});if(!l.ok){const k=new Error(`HTTP ${l.status}`);throw k.status=l.status,k}const a=yield l.json().catch(()=>({}));if((a==null?void 0:a.code)===401||(a==null?void 0:a.code)==="401"){const k=new Error((a==null?void 0:a.msg)||(a==null?void 0:a.message)||"NDVI 时间轴未授权");throw k.status=401,k}const i=Array.isArray(a==null?void 0:a.data)?a.data:Array.isArray(a)?a:[];return Tn(i)})}function Tn(l=[]){const a=new Set;return l.map((i,k)=>{const S=xn(it(i,["url","layerName","layer_name","layer","name"]));if(!S)return null;const f=it(i,["date","month","time","label"])||S,u=Nn(f);return{key:`${S}-${f||k}`,label:u,date:String(f),layerName:S,source:i}}).filter(Boolean).filter(i=>a.has(i.key)?!1:(a.add(i.key),!0))}function it(l,a){for(const i of a)if((l==null?void 0:l[i])!==void 0&&(l==null?void 0:l[i])!==null&&(l==null?void 0:l[i])!=="")return l[i]}function xn(l){const a=String(l||"").trim();return a?a.includes(":")||/^https?:\/\//i.test(a)?a:`ne:${a}`:""}function Nn(l){const a=String(l||"").trim();if(!a)return"";const i=a.match(/(\d{4})[-_/年. ]?(0?[1-9]|1[0-2])(?:月)?/);return i?`${i[1]}.${String(Number(i[2])).padStart(2,"0")}`:a}const Pn={class:"grassland-ndvi-timeline-head"},Mn={key:0,class:"grassland-ndvi-timeline-state"},Cn={key:1,class:"grassland-ndvi-timeline-state"},$n={key:2,class:"grassland-ndvi-timeline-body"},Fn=["aria-checked","title","onClick"],An={class:"grassland-ndvi-timeline-label"},In=42,Vn=28,En={__name:"GrasslandNdviTimeline",props:{items:{type:Array,default:()=>[]},modelValue:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(l,{emit:a}){const i=l,k=a,S=c(()=>i.items.findIndex(d=>d.key===i.modelValue)),f=c(()=>S.value===-1?Math.max(0,i.items.length-1):S.value),u=c(()=>i.items[f.value]||null),w=c(()=>i.loading?"加载中":"未选择"),y=c(()=>i.items.length>7),C=c(()=>y.value?Vn:In),I=c(()=>Q(f.value)),ae=c(()=>D(f.value));function U(d){if(!i.items.length)return;const v=Math.min(i.items.length-1,Math.max(0,f.value+d));k("update:modelValue",i.items[v].key)}function re(d){!d||d.key===i.modelValue||k("update:modelValue",d.key)}function Y(d){return!i.items.length||d<0?0:i.items.length===1?.5:d/(i.items.length-1)}function Q(d){const v=Y(d),P=L(v*100),h=C.value*(1-v*2);return`calc(${P}% ${h<0?"-":"+"} ${L(Math.abs(h))}px)`}function D(d){const v=Y(d);return v<=0?"0px":`calc(${L(v*100)}% - ${L(C.value*2*v)}px)`}function L(d){return Number(d.toFixed(4)).toString()}return(d,v)=>{var P;return p(),_("div",{class:se(["grassland-ndvi-timeline",{"is-dense":y.value}])},[b("div",Pn,[v[2]||(v[2]=b("span",null,"草地健康/退化",-1)),b("strong",null,fe(((P=u.value)==null?void 0:P.label)||w.value),1)]),l.loading?(p(),_("div",Mn,"加载月份数据")):l.items.length?(p(),_("div",$n,[b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"上一期",onClick:v[0]||(v[0]=h=>U(-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)),(p(!0),_(Ne,null,Pe(l.items,(h,z)=>{var W,T;return p(),_("button",{key:h.key,class:se(["grassland-ndvi-timeline-mark",{"is-active":h.key===((W=u.value)==null?void 0:W.key),"is-past":z<=f.value,"is-staggered":y.value&&z%2===1}]),type:"button",role:"radio","aria-checked":h.key===((T=u.value)==null?void 0:T.key),style:ge({left:Q(z)}),title:h.date,onClick:X=>re(h)},[v[3]||(v[3]=b("span",{class:"grassland-ndvi-timeline-tick"},null,-1)),b("span",An,fe(h.label),1)],14,Fn)}),128))],4),b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"下一期",onClick:v[1]||(v[1]=h=>U(1))},"›")])):(p(),_("div",Cn,"暂无月份数据"))],2)}}},Bn=bn(En,[["__scopeId","data-v-3b86bca9"]]),Rn={class:"forest-grass-wet"},qn={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},Gn={class:"fgw-left"},jn={class:"fgw-side-stack is-left"},Dn={class:"fgw-right"},zn={class:"fgw-side-stack is-right"},Wn={key:2,class:"fgw-ndvi-timeline"},On={class:"fgw-bottom-topic"},Hn={key:0,class:"loading"},Kn={class:"loading-progress"},Un={class:"value"},vs={__name:"index",props:{showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["topic-stats"],setup(l,{expose:a,emit:i}){const k=l,S=i,f=m(null),u=m(nn[0].key),w=m(""),y=m([]),C=m([]),I=m("idle"),ae=m(!1),U=m({title:"业务统计",rows:[]}),re=m({title:"业务统计",rows:[]}),Y=m([]),Q=m([]),D=m(null),L=m(""),d=m(null),v=m(!1),P=m(!1),h=m(null),z=m(0),W=m(k.showLoading),T=m([]),X=m("idle"),$=m(""),B=m({type:"idle",text:"等待 GeoServer 图层加载"});let Z=null,M=!1,me=!1,O=!1,F=null,Me=0,Ce=0,he=0,H=0,ie=0,le=!1,we=!1;const lt={图斑编号:"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"},ut=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]),ot=[{topicKey:"wetland",layerKey:"wetland-distribution",name:"湿地分布",legendName:"湿地资源"},{topicKey:"grassland",layerKey:"grassland-distribution",name:"草地分布",legendName:"草地资源"},{topicKey:"woodland",layerKey:"woodland-distribution",name:"林地分布",legendName:"林地资源"}],ct=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())),dt=c(()=>Je(u.value)),vt=c(()=>sn(u.value)),ue=c(()=>ot.map(e=>St(e)).filter(Boolean)),oe=c(()=>u.value==="overview"?ue.value:vt.value),$e=c({get(){return u.value==="overview"?y.value:w.value},set(e){if(u.value==="overview"){y.value=Array.isArray(e)?e.map(String).filter(Boolean):[];return}w.value=String(e||"")}}),J=c(()=>w.value?et(u.value,w.value):null),ee=c(()=>u.value==="grassland"&&w.value==="grassland-health"),ft=c(()=>ee.value),gt=c(()=>T.value.find(e=>e.key===$.value)||null),K=c(()=>{var e;return(((e=J.value)==null?void 0:e.legends)||[]).find(t=>t.key===L.value)||null}),mt=c(()=>ue.value.flatMap(e=>e.legends||[])),ye=c(()=>{var e;return u.value==="overview"?mt.value:((e=J.value)==null?void 0:e.legends)||[]}),ht=c(()=>oe.value.length>0),Fe=c(()=>oe.value.length<=6&&ye.value.length<=8),Ae=c(()=>{if(!Fe.value)return 430;const e=Math.max(1,oe.value.length),t=Math.max(1,Math.ceil(ye.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;if(u.value==="overview"){const r=new Set(y.value),o=ue.value.filter(g=>r.has(g.key));return Tt(o)}const e=J.value;if(!e)return null;let t=(s=K.value)!=null&&s.cqlFilter?q(V({},e),{cqlFilter:K.value.cqlFilter,activeLegend:K.value,name:K.value.name||e.name}):e;const n=gt.value;return ee.value&&(n!=null&&n.layerName)&&(t=q(V({},t),{layerName:n.layerName,name:`${e.name} ${n.label}`,timelineDate:n.label,timelineItem:n})),t}),Ie=m(typeof window=="undefined"?1080:window.innerHeight),Ve=tt.sideCardWidth;c(()=>tt.sideCardGap);const Ee=c(()=>dn(Ie.value)),yt=c(()=>vn(Ee.value,2)),be=c(()=>!!h.value),bt=gn,Be=c(()=>fn({point:h.value?Lt(h.value):null,rowCount:d.value?Se(d.value):0,loading:P.value,empty:v.value||!d.value})),kt=c(()=>Be.value.height),pt=c(()=>Be.value.style),_t=c(()=>{var n,s,r,o,g,A,N;const e=((s=(n=d.value)==null?void 0:n.layer)==null?void 0:s.overviewTopicKey)||((o=(r=d.value)==null?void 0:r.layer)==null?void 0:o.topicKey)||u.value;return{grassland:"草地详情",wetland:"湿地详情",woodland:"林地详情"}[e]||`${((A=(g=d.value)==null?void 0:g.layer)==null?void 0:A.name)||((N=dt.value)==null?void 0:N.name)||"资源"}详情`});function Lt(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(){Ie.value=typeof window=="undefined"?1080:window.innerHeight}function St({topicKey:e,layerKey:t,name:n,legendName:s}){var g;const r=et(e,t);if(!r||r.key!==t)return null;const o=((g=r.legends)==null?void 0:g[0])||{};return q(V({},r),{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})}kn(()=>{ke(),window.addEventListener("resize",ke),document.addEventListener("pointerdown",He,!0),xt(),_e(u.value,""),ce(u.value,"")}),pn(()=>{M=!0,F&&window.clearTimeout(F),window.removeEventListener("resize",ke),document.removeEventListener("pointerdown",He,!0)}),G(u,e=>{le=!0,L.value="",w.value="",e==="overview"&&(y.value=[]),x(),B.value={type:"idle",text:"等待 GeoServer 图层加载"},_e(e,""),ce(e,"",null),te(()=>{le=!1})}),G(w,()=>{le||(we=!0,L.value="",x(),B.value={type:w.value?"loading":"idle",text:w.value?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},u.value!=="woodland"&&_e(u.value,w.value),ce(u.value,w.value,null),te(()=>{we=!1}))}),G(y,()=>{u.value==="overview"&&(L.value="",x(),B.value={type:y.value.length?"loading":"idle",text:y.value.length?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},D.value=Oe("overview",y.value.join(",")))},{deep:!0}),G(L,()=>{le||we||(x(),ce(u.value,w.value,K.value))}),G(ee,e=>{if(e){Mt();return}$.value=""}),G($,()=>{ee.value&&x()}),G(()=>k.active,e=>{var t,n,s,r;f.value&&(e?(pe(),(n=(t=f.value).resume)==null||n.call(t)):(r=(s=f.value).pause)==null||r.call(s))});function xt(){var n;Z=new tn;const e={progress:0};Z.instance.on("onProgress",(s,r,o)=>{const g=Math.floor(r/o*100);Ze.to(e,{progress:g,onUpdate:()=>{z.value=Math.floor(e.progress)}})});const t=()=>{M||me||(me=!0,pe())};Z.instance.on("onLoad",t),(n=Z.ready)==null||n.then(t).catch(()=>{M||(B.value={type:"error",text:"地图资源加载失败"})})}function pe(){M||!k.active||!me||O||(O=!0,F&&window.clearTimeout(F),F=window.setTimeout(()=>{F=null,Re()},600))}function Re(e=0){return E(this,null,function*(){var n,s,r,o,g;if(M)return;if(!k.active){O=!1;return}if(yield te(),!k.active){O=!1;return}if(!!((s=(n=f.value)==null?void 0:n.loadMap)!=null&&s.call(n,Z)||(o=(r=f.value)==null?void 0:r.hasMap)!=null&&o.call(r))){yield Yt(),yield te(),(g=f.value)==null||g.play();return}if(e<24){window.setTimeout(()=>Re(e+1),120);return}O=!1})}function Nt(){F&&(window.clearTimeout(F),F=null)}function qe(){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 Pt(){var e,t;if(x(),B.value={type:"loading",text:"地图正在复位"},(t=(e=f.value)==null?void 0:e.hasMap)!=null&&t.call(e)){qe(),B.value={type:"success",text:"地图已复位"};return}Nt(),O=!1,te(()=>{pe()})}a({refreshMapView:qe,resetMap:Pt});function _e(n){return E(this,arguments,function*(e,t=w.value){const s=e==="woodland"?"":t,r=++Ce;ae.value=!0,I.value="loading";const o=yield an(e,s);M||r!==Ce||e===u.value&&(e!=="woodland"&&(s||"")!==(w.value||"")||Ct(o,e))})}function Mt(e=!1){return E(this,null,function*(){if(!ee.value)return;if(!e&&T.value.length){Ge();return}const t=++he;X.value="loading";try{const n=yield Sn();if(M||t!==he)return;T.value=n,X.value=n.length?"success":"empty",Ge()}catch(n){if(M||t!==he)return;T.value=[],$.value="",X.value="error"}})}function Ge(){if(!T.value.length){$.value="";return}T.value.some(t=>t.key===$.value)||($.value=T.value[T.value.length-1].key)}function Ct(e,t){var s,r,o;const n=$t(e);C.value=n.core||[],U.value=n.left||{title:"业务统计",rows:[]},re.value=n.right||{title:"业务统计",rows:[]},Y.value=(s=n.leftPanels)!=null&&s.length?n.leftPanels:[U.value],Q.value=(r=n.rightPanels)!=null&&r.length?n.rightPanels:[re.value],I.value=n.status,ae.value=!1,S("topic-stats",{topicKey:t,topicName:Je(t).name,items:((o=n.top)!=null&&o.length?n.top:n.core||[]).slice(0,4)})}function $t(e){return e||{}}function je(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 De(e){return Le(e)?yt.value:Ee.value}function Se(e){const t=(e==null?void 0:e.properties)||{};return Object.keys(t).filter(s=>ze(s,t[s])).length}function ze(e,t){return t==null||t===""||Array.isArray(t)||typeof t=="object"?!1:!ct.has(String(e||"").toLowerCase())}function Ft(){if(u.value==="overview"){const e=new Set(y.value);return ue.value.filter(t=>e.has(t.key)).slice().reverse()}return J.value?[J.value]:[]}function At(e={}){const t=String(e.overviewTopicKey||u.value||"").toLowerCase(),n=`${e.key||""} ${e.layerName||""} ${t}`.toLowerCase();return n.includes("basic-grassland")||n.includes("t_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")||n.includes("caodi")?"grassland":""}function It(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 Vt(){return E(this,arguments,function*(e={}){var A,N,R,Ke,de,Ue;const t=Number((A=e==null?void 0:e.lngLat)==null?void 0:A.lng),n=Number((N=e==null?void 0:e.lngLat)==null?void 0:N.lat),s=Ft();if(!Number.isFinite(t)||!Number.isFinite(n)||!s.length){x();return}const r=++H,o=ie,g=e.screen||{x:960,y:540};h.value=null,d.value=null,v.value=!1,P.value=!0,(Ke=(R=f.value)==null?void 0:R.clearSelectedFeature)==null||Ke.call(R);try{for(const Ye of s){const ve=yield Et(Ye,{lng:t,lat:n});if(r!==H||M)return;if(ve){d.value=ve,h.value=Te(ve,g),v.value=!1,(Ue=(de=f.value)==null?void 0:de.highlightFeature)==null||Ue.call(de,ve,{highlightTone:"v21"});return}}r===H&&ie===o&&x()}catch(Ye){r===H&&ie===o&&x()}finally{r===H&&(P.value=!1)}})}function Et(e,t){return E(this,null,function*(){const n=At(e);if(!n)return null;const s=It(t);let r=null;n==="grassland"?r=yield on({wkt:s}):n==="wetland"?r=yield cn({wkt:s}):n==="woodland"?r=yield ln(s):n==="basicGrassland"&&(r=yield un(s));const o=Bt(r,n);if(!qt(o))return null;const g=jt(o,e,t,n);return Se(g)>0?g:null})}function Bt(e,t){var s,r,o,g,A;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],(r=e==null?void 0:e.data)==null?void 0:r.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,(A=e==null?void 0:e.data)==null?void 0:A.basicGrassland,e==null?void 0:e.data,e==null?void 0:e.result,e];for(const N of n){const R=Rt(N);if(R)return R}return null}function Rt(e){return Array.isArray(e)?e.find(t=>t&&typeof t=="object")||null:e&&typeof e=="object"?e:null}function qt(e){return!e||typeof e!="object"?!1:Array.isArray(e.dyColumn)&&e.dyColumn.some(Gt)?!0:Object.keys(e).some(t=>ze(t,e[t]))}function Gt(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 jt(e,t,n,s){const r=zt(e),o=Dt(e);return{id:e.id||e.patchNo||e.patch_no||e.landNumber||e.land_number||`${s}-${n.lng}-${n.lat}`,properties:r,feature:{type:"Feature",properties:r,geometry:o},geometry:o,layer:t,lngLat:n}}function Dt(e={}){return e.geometry||e.geom||e.wkt||e.the_geom||e.theGeom||e.geo||e.geometryWkt||e.geometry_wkt||e.shape||null}function zt(e={}){const t=V({},e);return(Array.isArray(e.dyColumn)?e.dyColumn:[]).forEach(s=>{const r=s==null?void 0:s.value;if(r==null||r==="")return;const o=lt[String((s==null?void 0:s.title)||"").trim()],g=String((s==null?void 0:s.field)||"").trim();[g,Wt(g),o].filter(Boolean).forEach(N=>{(t[N]===void 0||t[N]===null||t[N]==="")&&(t[N]=r)})}),t}function Wt(e){return String(e||"").replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function ce(s,r){return E(this,arguments,function*(e,t,n=K.value){const o=++Me;if(!t||!Ot(t,n)){D.value=Oe(e,t);return}const g=yield rn(e,t,n);M||o!==Me||e!==u.value||t!==w.value||((n==null?void 0:n.key)||"")===L.value&&(D.value=q(V({},g),{hideTownLabelStats:!0}))})}function Ot(e,t=null){return!!(t!=null&&t.key)||ut.has(e)}function Oe(e,t){return{status:"disabled",topicKey:e,layerKey:t,title:"",unit:"",hideTownLabelStats:!0,rows:[]}}function Ht(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){x();return}d.value=t,v.value=!1,h.value=Te(t,(e==null?void 0:e.screen)||h.value)}function Te(e,t=null){var n,s,r,o;return((s=(n=f.value)==null?void 0:n.getVectorFeatureAnchorScreen)==null?void 0:s.call(n,e))||((o=(r=f.value)==null?void 0:r.getVectorFeatureScreen)==null?void 0:o.call(r,e))||t}function Kt(){if(!be.value||!d.value)return;const e=Te(d.value,h.value);if(!e)return;const t=h.value;t&&Math.abs(Number(t.x)-Number(e.x))<.5&&Math.abs(Number(t.y)-Number(e.y))<.5||(h.value=e)}function Ut(e){B.value=e}function x(){var e,t;H+=1,d.value=null,v.value=!1,P.value=!1,h.value=null,(t=(e=f.value)==null?void 0:e.clearSelectedFeature)==null||t.call(e)}function He(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)||x()}function Yt(){return W.value?new Promise(e=>{Ze.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{W.value=!1,e()}})}):Promise.resolve()}return(e,t)=>(p(),_("div",Rn,[j(mn,{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:Ht,onMapClick:Vt,onLayerStatus:Ut,onViewChange:Kt},null,8,["active-layer","map-ranking"]),b("div",qn,[I.value==="error"||I.value==="empty"?(p(),_("div",{key:0,class:se(["fgw-data-state",{"is-error":I.value==="error"}]),role:"status"},fe(I.value==="error"?"数据库数据加载失败,请稍后重试":"数据库暂无数据"),3)):ne("",!0),b("div",Gn,[b("div",jn,[(p(!0),_(Ne,null,Pe(Y.value,n=>(p(),st(rt,{key:je(n,"left"),class:se(["fgw-side-card left-card",{"is-double":Le(n)}]),title:n.title,width:xe(Ve),height:De(n)},{default:at(()=>[j(nt,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),b("div",Dn,[b("div",zn,[(p(!0),_(Ne,null,Pe(Q.value,n=>(p(),st(rt,{key:je(n,"right"),class:se(["fgw-side-card right-card",{"is-double":Le(n)}]),title:n.title,width:xe(Ve),height:De(n)},{default:at(()=>[j(nt,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),ht.value?(p(),_("div",{key:1,class:"fgw-map-layer-tools",style:ge({height:`${Ae.value}px`})},[j(wn,{modelValue:$e.value,"onUpdate:modelValue":t[1]||(t[1]=n=>$e.value=n),"selected-legend-key":L.value,"onUpdate:selectedLegendKey":t[2]||(t[2]=n=>L.value=n),"topic-key":u.value,layers:oe.value,legends:ye.value,multiple:u.value==="overview",width:248,height:Ae.value,compact:Fe.value},null,8,["modelValue","selected-legend-key","topic-key","layers","legends","multiple","height","compact"])],4)):ne("",!0),ft.value?(p(),_("div",Wn,[j(Bn,{modelValue:$.value,"onUpdate:modelValue":t[3]||(t[3]=n=>$.value=n),items:T.value,loading:X.value==="loading"},null,8,["modelValue","items","loading"])])):ne("",!0),be.value?(p(),_("div",{key:3,class:"fgw-map-feature-info",style:ge(pt.value)},[j(yn,{title:_t.value,feature:d.value,empty:v.value,loading:P.value,width:xe(bt),height:kt.value,closable:"",onClose:x},null,8,["title","feature","empty","loading","width","height"])],4)):ne("",!0),b("div",On,[j(hn,{modelValue:u.value,"onUpdate:modelValue":t[4]||(t[4]=n=>u.value=n)},null,8,["modelValue"])])]),W.value?(p(),_("div",Hn,[t[6]||(t[6]=_n('<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",Kn,[b("span",Un,fe(z.value),1),t[5]||(t[5]=b("span",{class:"unit"},"%",-1))])])):ne("",!0)]))}};export{vs as default};
|
|
|