PageSourceSearch

https://cief.org.cn/_nuxt/Cm2Wm48k.js

js cief.org.cn collected 2026-10-02 09:55:09 UTC 9,247 bytes, 1 lines download raw bytes

1import{d as L,c as q,a as l,y,b as t,H as i,F as f,G as T,f as p,o as r,e as F,u as Z,R as J,N as O,M as Y,r as m,P as ee,w as te,B as se,S as ae,U as oe,V as ne,z as le,W as A,X as re}from"./D3L1gIDB.js";import{cmsApi as ie}from"./DPliiWLA.js";import{s as ce,a as ue}from"./Mf-UUguh.js";import{_ as pe}from"./DlAUqK2U.js";import"./DPhtfMym.js";const de={key:0,class:"flex justify-end"},me={class:"flex items-center space-x-1"},he=["disabled"],ge=["onClick"],ye={key:1,class:"px-2 text-gray-400"},ve=["disabled"],xe=L({__name:"CiefPagination",props:{page:{},totalPages:{}},emits:["update:page"],setup(R,{emit:g}){const v=R,h=g,b=n=>{n<1||n>v.totalPages||n===v.page||h("update:page",n)},S=q(()=>{const n=v.page,d=v.totalPages,a=[];if(d<=7)for(let u=1;u<=d;u++)a.push(u);else if(n<=4){for(let u=1;u<=5;u++)a.push(u);a.push("..."),a.push(d)}else if(n>=d-3){a.push(1),a.push("...");for(let u=d-4;u<=d;u++)a.push(u)}else{a.push(1),a.push("...");for(let u=n-1;u<=n+1;u++)a.push(u);a.push("..."),a.push(d)}return a});return(n,d)=>n.totalPages>1?(r(),l("div",de,[t("div",me,[t("button",{onClick:d[0]||(d[0]=a=>b(n.page-1)),disabled:n.page<=1,class:"px-3 py-2 text-sm text-gray-600 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"},i(n.$t("common.previous_page")),9,he),(r(!0),l(f,null,T(p(S),a=>(r(),l(f,{key:a},[a!=="..."?(r(),l("button",{key:0,onClick:u=>b(Number(a)),class:F(["w-8 h-8 text-sm rounded flex items-center justify-center",a===n.page?"bg-orange-500 text-white":"text-gray-600 hover:bg-gray-100"])},i(a),11,ge)):(r(),l("span",ye,i(a),1))],64))),128)),t("button",{onClick:d[1]||(d[1]=a=>b(n.page+1)),disabled:n.page>=n.totalPages,class:"px-3 py-2 text-sm text-gray-600 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"},i(n.$t("common.next_page")),9,ve)])])):y("",!0)}}),_e={class:"news-page"},fe={class:"bg-zinc-100"},be={class:"pt-24"},ke={class:"flex justify-center items-center space-x-6 mb-8 flex-col"},we={class:"relative w-80 mb-4"},$e=["placeholder"],Ce=["aria-label"],qe={key:0,class:"flex items-center space-x-3 flex-wrap justify-center"},Ne={class:"text-gray-700 text-sm"},Pe={class:"flex space-x-2 flex-wrap"},Te=["onClick"],Se={key:0,class:"ml-1 opacity-70"},Me={key:0,class:"max-w-6xl mx-auto px-4 mb-6"},je={class:"flex items-center justify-between text-sm text-gray-600 bg-white p-4"},Ve={class:"flex items-center"},ze={class:"ml-1"},Re={key:1,class:"text-center py-12"},Be={class:"text-gray-500"},De={key:2,class:"text-center py-12"},Ee={class:"text-gray-500 text-lg mb-2"},Ie={class:"text-sm text-gray-400 mb-4"},Ue={key:3,class:"text-center py-12"},Ae={class:"text-gray-500 text-lg"},He={key:0,class:"max-w-6xl mx-auto px-4 mb-8"},Le={class:"text-sm font-medium text-gray-700 mb-3"},Fe={class:"flex flex-wrap gap-3"},Ge=["onClick"],Ke={key:1,class:"text-center py-12"},Qe={class:"text-gray-500 text-lg"},We={key:2,class:"news-timeline max-w-6xl mx-auto"},Xe=["onClick"],Ze={class:"flex-1 min-w-0 mr-6"},Je={class:"text-base font-medium text-gray-900 group-hover:text-amber-600 transition-colors leading-tight"},Oe={key:0,class:"text-sm text-gray-500 mt-1 line-clamp-2"},Ye={class:"flex-shrink-0 flex items-center space-x-6 text-sm text-gray-500"},et={class:"px-2 py-0.5 bg-gray-100 rounded text-xs"},tt={key:0,class:"flex items-center"},st={class:"mt-12 pb-12 max-w-6xl mx-auto px-4"},H=10,at=L({__name:"search",setup(R){const{t:g,locale:v}=Z(),h=J(),b=O(),S=Y(),n=m(""),d=m(""),a=m(""),u=m(1),k=m([]),w=m([]),$=m([]),x=m(0),M=m(!1),N=m(!1),_=m(""),j=q(()=>v.value==="en"?"en":"zh"),V=q(()=>Math.ceil(x.value/H)),G=q(()=>w.value.reduce((e,s)=>e+s.count,0)),B=q(()=>[...[{type:"",label:g("search.all"),count:G.value}],...w.value.filter(s=>s.count>0).map(s=>({type:s.type,label:s.typeName,count:s.count}))]);ee({title:()=>`${g("search.modal_title")}${d.value?":"+d.value:""} - ${g("header.site_name")}`,meta:[{name:"robots",content:"noindex"}]});const D=()=>({q:h.query.q||"",type:h.query.type||"",page:Math.max(1,Number(h.query.page)||1)}),P=e=>{const s=D(),c={...s,...e};if(c.q===s.q&&c.type===s.type&&c.page===s.page){z();return}const o={};c.q&&(o.q=c.q),c.type&&(o.type=c.type),c.page>1&&(o.page=String(c.page)),b.push({query:o})};let C=0;const z=async()=>{const e=d.value.trim();if(!e){C++,k.value=[],w.value=[],$.value=[],x.value=0,_.value="",N.value=!1;return}const s=++C;M.value=!0,_.value="",N.value=!0;try{const c=await ie.publicSearch.search({keyword:e,lang:j.value,type:a.value||void 0,pageNum:u.value,pageSize:H});if(s!==C)return;
1if(c.code!==200||!c.data)throw new Error(c.msg||g("common.load_failed"));k.value=c.data.rows||[],w.value=c.data.groups||[],x.value=c.data.total||0,$.value=a.value?[]:ce(e,j.value),x.value>0&&u.value>V.value&&P({page:V.value})}catch(c){if(s!==C)return;k.value=[],w.value=[],$.value=[],x.value=0,_.value=(c==null?void 0:c.message)||g("common.load_failed_retry")}finally{s===C&&(M.value=!1)}},E=()=>{P({q:n.value.trim(),type:"",page:1})},K=e=>{P({type:e,page:1})},Q=e=>{P({page:e}),window.scrollTo({top:0,behavior:"smooth"})},W=e=>{I(ue(e.type,e.id))},I=e=>{re(S(e))};te(()=>[h.query.q,h.query.type,h.query.page].join("|"),()=>{const e=D();d.value=e.q,n.value=e.q,a.value=e.type,u.value=e.page,z()},{immediate:!0});const X=e=>{const s=new Date(e);return Number.isNaN(s.getTime())?e:s.toLocaleDateString(j.value==="en"?"en-US":"zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\//g,"-")};return(e,s)=>{const c=xe;return r(),l("div",_e,[t("section",fe,[t("div",be,[t("div",ke,[t("div",we,[se(t("input",{"onUpdate:modelValue":s[0]||(s[0]=o=>ne(n)?n.value=o:null),type:"text",placeholder:e.$t("search.input_placeholder"),class:"w-full pl-10 pr-20 py-3 rounded-full border transition-all duration-300 bg-white border-gray-300 text-gray-900 placeholder-gray-500",onKeyup:oe(E,["enter"])},null,40,$e),[[ae,p(n)]]),s[1]||(s[1]=t("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),t("button",{onClick:E,"aria-label":e.$t("search.button"),class:"absolute right-1 top-1/2 -translate-y-1/2 px-6 py-2 rounded-full bg-amber-600 hover:bg-amber-700 text-white text-sm font-medium transition-colors"},i(e.$t("search.button")),9,Ce)]),p(B).length>1?(r(),l("div",qe,[t("span",Ne,i(e.$t("search.filter_label")),1),t("div",Pe,[(r(!0),l(f,null,T(p(B),o=>(r(),l("button",{key:o.type,onClick:U=>K(o.type),class:F(["px-4 py-2 rounded-full text-sm font-medium transition-colors",p(a)===o.type?"bg-amber-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"])},[A(i(o.label),1),o.count!==void 0?(r(),l("span",Se,"("+i(o.count)+")",1)):y("",!0)],10,Te))),128))])])):y("",!0)]),p(N)&&!p(_)?(r(),l("div",Me,[t("div",je,[t("span",Ve,[t("span",null,i(e.$t("search.keyword_label")),1),t("span",ze,i(p(d)),1)]),t("span",null,i(e.$t("search.result_total",{count:p(x)})),1)])])):y("",!0),p(M)?(r(),l("div",Re,[s[2]||(s[2]=t("div",{class:"loading-spinner mx-auto mb-4"},null,-1)),t("p",Be,i(e.$t("common.loading")),1)])):p(_)?(r(),l("div",De,[t("p",Ee,i(e.$t("common.load_failed")),1),t("p",Ie,i(p(_)),1),t("button",{onClick:z,class:"px-5 py-2 rounded-full bg-amber-600 hover:bg-amber-700 text-white text-sm font-medium transition-colors"},i(e.$t("search.retry")),1)])):p(N)?(r(),l(f,{key:4},[p($).length>0?(r(),l("div",He,[t("h3",Le,i(e.$t("search.related_pages")),1),t("div",Fe,[(r(!0),l(f,null,T(p($),o=>(r(),l("button",{key:o.id,onClick:U=>I(o.route),class:"px-4 py-2 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:border-amber-400 hover:text-amber-600 transition-colors text-left"},i(o.title),9,Ge))),128))])])):y("",!0),p(k).length===0?(r(),l("div",Ke,[s[3]||(s[3]=t("svg",{class:"w-16 h-16 text-gray-300 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.34 0-4.47-.881-6.08-2.33"})],-1)),t("p",Qe,i(e.$t("search.no_results")),1)])):(r(),l("div",We,[(r(!0),l(f,null,T(p(k),o=>(r(),l("div",{key:`${o.type}-${o.id}`,class:"mb-4 news-item bg-white flex items-center py-4 px-6 border-b border-gray-200 cursor-pointer group hover:bg-gray-50 transition-colors",onClick:U=>W(o)},[s[5]||(s[5]=t("div",{class:"flex-shrink-0 w-3 h-3 bg-amber-600 rounded-full mr-6"},null,-1)),t("div",Ze,[t("h3",Je,i(o.title),1),o.description?(r(),l("p",Oe,i(o.description),1)):y("",!0)]),t("div",Ye,[t("span",et,i(o.typeName),1),o.publishTime?(r(),l("span",tt,[s[4]||(s[4]=t("svg",{class:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),A(" "+i(X(o.publishTime)),1)])):y("",!0)])],8,Xe))),128))])),t("div",st,[le(c,{page:p(u),"total-pages":p(V),"onUpdate:page":Q},null,8,["page","total-pages"])])],64)):(r(),l("div",Ue,[t("p",Ae,i(e.$t("search.empty_keyword")),1)]))])])])}}}),ct=pe(at,[["__scopeId","data-v-ba3405e7"]]);export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.