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
5.0 KiB
1 lines
5.0 KiB
var W=Object.defineProperty;var L=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var N=(t,e,n)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,b=(t,e)=>{for(var n in e||(e={}))O.call(e,n)&&N(t,n,e[n]);if(L)for(var n of L(e))z.call(e,n)&&N(t,n,e[n]);return t};var D=(t,e,n)=>new Promise((u,r)=>{var i=l=>{try{s(n.next(l))}catch(a){r(a)}},c=l=>{try{s(n.throw(l))}catch(a){r(a)}},s=l=>l.done?u(l.value):Promise.resolve(l.value).then(i,c);s((n=n.apply(t,e)).next())});import{r as T,n as J}from"./index-e33f4373-1785726778446.js";const v="/jsyApi";function C(t,e){return/^https?:\/\//.test(e)?e:`${t}${e.startsWith("/")?e:`/${e}`}`}function j(t){if((t==null?void 0:t.success)===!1||(t==null?void 0:t.code)!==void 0&&![0,200,"0","200"].includes(t.code)){const n=new Error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"接口请求失败");throw n.code=t==null?void 0:t.code,n}return J(t)}function o(t,e,n={}){return T(C(v,t),{params:e,timeout:n.timeout||12e3}).then(j)}function y(t,e,n={}){return T(C(v,t),{method:"POST",params:e,timeout:n.timeout||12e3}).then(j)}function U(){return y("/api/dataItem?group=pastures").then(f)}function X(){return y("/api/muhu/distribution").then(f)}function q(){return y("/api/muhu/age").then(f)}function K(){return y("/api/muhu/upline_rate").then(f)}function f(t){return Array.isArray(t)?t:Array.isArray(t==null?void 0:t.rows)?t.rows:Array.isArray(t==null?void 0:t.list)?t.list:Array.isArray(t==null?void 0:t.data)?t.data:t!=null&&t.data?f(t.data):t!=null&&t.result?f(t.result):[]}function V(t="",e=1,n=80){return o("/api/home/muhu_list",{query:t,page:e,pageSize:n}).then(f)}function ut(t){return t==null||t===""?Promise.resolve([]):o("/api/home/grasslandByPastureId",{id:t},{timeout:2e4}).then(f)}function rt(t){return t?o("/api/pastureDetails",{wkt:t},{timeout:2e4}).then(e=>e||null):Promise.resolve(null)}function $(t,e=[]){const n=[...e.map(u=>t==null?void 0:t[u]),...e.map(u=>{var r;return(r=t==null?void 0:t.data)==null?void 0:r[u]}),t==null?void 0:t.data,t==null?void 0:t.result,t];for(const u of n)if(Array.isArray(u)){const r=u.find(i=>i&&typeof i=="object");if(r)return r}else if(u&&typeof u=="object")return u;return null}function it(t={}){return o("/api/grasslandDetails",t,{timeout:2e4}).then(e=>$(e,["grassland"]))}function st(t={}){return o("/api/wetlandDetails",t,{timeout:2e4}).then(e=>$(e,["wetland"]))}function lt(t){return t?o("/api/map/projectDetail",{wkt:t},{timeout:2e4}).then(e=>e||null):Promise.resolve(null)}function ct(t){return o("/api/pastureDetailsById",{id:t}).then(e=>(e==null?void 0:e.data)||e||{})}function at(t){return o("/api/pasturesDetails",{id:t}).then(e=>(e==null?void 0:e.data)||e||{})}function Y(){return o("/api/pasturesList").then(f)}function ft(){return D(this,null,function*(){const[t,e,n,u,r,i]=yield Promise.allSettled([U(),X(),q(),K(),Y(),V("",1,20)]),c=r.status==="fulfilled"?r.value:[],s=i.status==="fulfilled"?i.value:[],l=H(s)?s:H(c)?c:s.length?s:c,a=Q(l,c,s);return{core:t.status==="fulfilled"?t.value:[],distribution:e.status==="fulfilled"?e.value:[],age:n.status==="fulfilled"?n.value:[],online:u.status==="fulfilled"?u.value:[],list:a}})}function Q(t=[],...e){const n=new Map;return e.flat().forEach(u=>{B(u).forEach(r=>{const i=n.get(r)||{};n.set(r,R(i,u))})}),(Array.isArray(t)?t:[]).map(u=>{const r=B(u).map(i=>n.get(i)).find(Boolean);return r?R(u,r):u})}function R(t={},e={}){const n=b({},t);return Object.entries(e||{}).forEach(([u,r])=>{(n[u]===void 0||n[u]===null||n[u]==="")&&(n[u]=r)}),n}function B(t={}){return[t.id,t.pastureId,t.pasturesId,t.pastures_id,t.muhuId,t.muhu_id,t.name,t.pasturesName,t.pastures_name,t.muhuName,t.muhu_name,t.pastureName,t.pasture_name].map(e=>String(e||"").trim()).filter(Boolean)}function H(t=[]){return(Array.isArray(t)?t:[]).some(e=>{var r,i,c,s,l,a;const n=(l=(s=(c=(i=(r=e==null?void 0:e.grasslandArea)!=null?r:e==null?void 0:e.grassland_area)!=null?i:e==null?void 0:e.acreage)!=null?c:e==null?void 0:e.area)!=null?s:e==null?void 0:e.areaRange)!=null?l:e==null?void 0:e.area_range;if(typeof n=="number")return n>0;const u=Number((a=String(n!=null?n:"").replace(/,/g,"").match(/-?\d+(?:\.\d+)?/))==null?void 0:a[0]);return Number.isFinite(u)&&u>0})}const m=480,x=1920,Z=1080,I=176,S=112,k=272,w=18;function p(t,e,n){return Math.min(Math.max(t,e),n)}function ot({point:t,rowCount:e=0,loading:n=!1,empty:u=!1,safeLeft:r=448,safeRight:i=1472,preferredTop:c=196,safeTop:s=94}){if(!t)return{width:m,height:I,style:{}};const l=p(Number(e)||0,0,10),a=n||u?I:58+Math.max(l,1)*27,P=p(a,I,k),h=p(t.y-w,72,Z-28),_=h-c,E=h-s;let g=P,A=h-P;_>=S?(g=Math.min(P,_),A=h-g):E>=S?(g=Math.min(P,E),A=h-g):(g=Math.max(112,Math.min(P,h-72)),A=h-g);const d=p(r,24,x-m-24),F=p(i,d+m,x-24),M=p(t.x-m/2,d,F-m),G=p(t.x-M,28,m-28);return{width:m,height:Math.round(g),style:{left:`${Math.round(M)}px`,top:`${Math.round(A)}px`,right:"auto",bottom:"auto",width:`${m}px`,"--feature-panel-anchor-x":`${Math.round(G)}px`}}}export{m as F,st as a,lt as b,ot as c,ft as d,at as e,ut as f,it as g,ct as h,rt as i};
|
|
|