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