Files
egrasc/static/js/index-7188105f.js
2025-09-17 15:04:01 +08:00

2 lines
5.9 KiB
JavaScript

import{b7 as G,av as q,bf as U,aj as V,d as j,e as K,b as P,c as v,f as x,a as o,t as d,g as r,w as C,F as S,aS as W,b$ as z,c0 as Q,o as h,k as w,h as D,I as H,ax as F,p as k,i as B,s as J,q as X}from"./index-b7212742.js";import{u as I,E as Y}from"./el-overlay-98c55b7e.js";import{_ as Z}from"./base-header-41a2bb63.js";import{B as ee}from"./base-container-1b92ced7.js";import{_ as te}from"./base-loading-0fc3581c.js";import{g as se}from"./index-5b037ecd.js";import{d as ne}from"./debounce-0649b288.js";var oe="Expected a function";function O(e,s,t){var n=!0,l=!0;if(typeof e!="function")throw new TypeError(oe);return G(t)&&(n="leading"in t?!!t.leading:n,l="trailing"in t?!!t.trailing:l),ne(e,s,{leading:n,maxWait:s,trailing:l})}const A=e=>{let s=0,t=e;for(;t;)s+=t.offsetTop,t=t.offsetParent;return s},ae=(e,s)=>Math.abs(A(e)-A(s)),_="ElInfiniteScroll",le=50,ie=200,re=0,ce={delay:{type:Number,default:ie},distance:{type:Number,default:re},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},N=(e,s)=>Object.entries(ce).reduce((t,[n,l])=>{var c,u;const{type:b,default:f}=l,i=e.getAttribute(`infinite-scroll-${n}`);let m=(u=(c=s[i])!=null?c:i)!=null?u:f;return m=m==="false"?!1:m,m=b(m),t[n]=Number.isNaN(m)?f:m,t},{}),R=e=>{const{observer:s}=e[_];s&&(s.disconnect(),delete e[_].observer)},de=(e,s)=>{const{container:t,containerEl:n,instance:l,observer:c,lastScrollTop:u}=e[_],{disabled:b,distance:f}=N(e,l),{clientHeight:i,scrollHeight:m,scrollTop:p}=n,y=p-u;if(e[_].lastScrollTop=p,c||b||y<0)return;let g=!1;if(t===e)g=m-(i+p)<=f;else{const{clientTop:T,scrollHeight:E}=e,a=ae(e,n);g=p+i>=a+T+E-f}g&&s.call(l)};function L(e,s){const{containerEl:t,instance:n}=e[_],{disabled:l}=N(e,n);l||t.clientHeight===0||(t.scrollHeight<=t.clientHeight?s.call(n):R(e))}const ue={async mounted(e,s){const{instance:t,value:n}=s;q(n)||U(_,"'v-infinite-scroll' binding value must be a function"),await V();const{delay:l,immediate:c}=N(e,t),u=se(e,!0),b=u===window?document.documentElement:u,f=O(de.bind(null,e,n),l);if(u){if(e[_]={instance:t,container:u,containerEl:b,delay:l,cb:n,onScroll:f,lastScrollTop:b.scrollTop},c){const i=new MutationObserver(O(L.bind(null,e,n),le));e[_].observer=i,i.observe(e,{childList:!0,subtree:!0}),L(e,n)}u.addEventListener("scroll",f)}},unmounted(e){if(!e[_])return;const{container:s,onScroll:t}=e[_];s==null||s.removeEventListener("scroll",t),R(e)},async updated(e){if(!e[_])await V();else{const{containerEl:s,cb:t,observer:n}=e[_];s.clientHeight&&n&&L(e,t)}}},M=ue;M.install=e=>{e.directive("InfiniteScroll",M)};const fe=M;const _e={class:"mb-20 flex items-center justify-center h-100 bg-[#F5C831] xs:text-22 xs:px-20 md:text-26 font-bold"},me={class:"md:flex"},he={class:"flex-shrink-0 xs:w-full md:w-330 mr-25 rounded-20 bg-gradient-to-b from-[#F7EBDF] to-dark-300"},ve={class:"font-bold text-center py-13 text-24"},be={class:"p-10 mb-10 font-bold text-16 bg-gradient-to-r from-white/70 to-white/30"},pe={class:"mb-6"},ge={class:"text-warn"},xe={class:"text-warn"},we={class:""},ye=["onClick"],Te={class:"flex items-center py-6 px-14 border-b-1 border-dark-300"},Ee={class:"truncate text-16"},Se={class:"px-14 pt-9 pb-14"},Ce={class:"mb-4 font-bold text-16"},ke=["innerHTML"],Be={class:"flex-1"},Le={class:"mt-5 mb-10 font-bold text-24"},Me=["onClick"],Ne={class:"mb-4 text-16"},Ve={class:"text-12 text-dark-700"},Pe={class:"flex items-center mt-20 text-12 text-dark-700"},De={class:"flex-1"},He={class:"mb-4 font-bold text-16"},Fe=["innerHTML"],Ie={key:0,class:"mt-20"},je=j({__name:"index",setup(e){const s=K(W,{getCacheKey:()=>"GetApplyMediateData"});s.run();const t=I(z,{pageSize:20,getCacheKey:()=>"GetMediatePage"});t.run();const n=I(Q,{pageSize:20,getCacheKey:()=>"GetLatestCasePage"});n.run();const l=P(!1),c=P({}),u=async(f,i)=>{c.value={},f==1,c.value=i,l.value=!0},b=()=>navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);return(f,i)=>{const m=Y,p=fe;return h(),v(S,null,[x(Z),o("div",_e,d(r(w)("the-following-data-are-all-from-the-real-data-statistics-of-egra")),1),x(ee,null,{default:C(()=>{var y,g,T,E;return[o("div",me,[o("div",he,[o("h3",ve,d(r(w)("mediation-centre")),1),o("div",be,[o("p",pe,[D(d(r(w)("resolved-in-the-past-month-usd")),1),o("span",ge,"$"+d(r(H)((g=(y=r(s).data.value)==null?void 0:y[1])==null?void 0:g.dictValue)),1)]),o("p",null,[D(d(r(w)("number-of-people-solved-0")),1),o("span",xe,d(r(H)((E=(T=r(s).data.value)==null?void 0:T[2])==null?void 0:E.dictValue)),1)])]),F((h(),v("div",we,[x(te,{loading:r(t).loading.value,empty:r(t).empty.value},{default:C(()=>[(h(!0),v(S,null,k(r(t).data.value,a=>(h(),v("div",{class:"mx-10 mb-10 bg-white cursor-pointer rounded-5",onClick:$=>u(1,a)},[o("div",Te,[x(B,{src:a.platformIcon,class:"w-20 h-20 mr-4 rounded-2"},null,8,["src"]),o("div",Ee,d(a.platformName),1)]),o("div",Se,[o("div",Ce,d(a.title),1),o("div",{class:"overflow-hidden text-12 text-dark-700",innerHTML:a.contentText},null,8,ke)])],8,ye))),256))]),_:1},8,["loading","empty"])])),[[p,r(t).loadmore]])]),F((h(),v("div",Be,[o("h3",Le,d(r(w)("latest-cases")),1),(h(!0),v(S,null,k(r(n).data.value,a=>(h(),v("div",{class:"mb-10 bg-white cursor-pointer p-15 rounded-5",onClick:$=>u(2,a)},[o("div",Ne,d(a.title),1),o("div",Ve,d(a.summary),1),o("div",Pe,[x(B,{src:a.icon,class:"w-20 h-20 mr-4 overflow-hidden rounded-full"},null,8,["src"]),o("div",De,d(a.author),1),o("div",null,d(a.contentTime),1)])],8,Me))),256))])),[[p,r(n).loadmore]])]),x(m,{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=a=>l.value=a),fullscreen:b(),width:"600"},{default:C(()=>[o("div",He,d(c.value.title),1),o("div",{class:"overflow-hidden text-12 text-dark-700",innerHTML:c.value.contentText},null,8,Fe),c.value.urls?(h(),v("div",Ie,[(h(!0),v(S,null,k(c.value.urls,a=>(h(),J(B,{src:a,class:"block"},null,8,["src"]))),256))])):X("",!0)]),_:1},8,["modelValue","fullscreen"])]}),_:1}),i[1]||(i[1]=o("div",{class:"h-60"},null,-1))],64)}}});export{je as default};