1import{_ as Z}from"./DrupClhV.js";import{_ as G}from"./BxPQt6NI.js";import{n as U}from"./BF7zkuD1.js";import"./DPhtfMym.js";/* empty css *//* empty css */import{d as W,u as X,M as J,c as I,r as u,P as K,R as O,N as Q,g as ee,w as S,a as r,z as M,b as s,y as z,V as te,f as c,H as i,F as A,G as T,o as d,e as se,X as q}from"./D3L1gIDB.js";import{_ as ae}from"./DlAUqK2U.js";const oe={class:"news-page"},ne={class:"bg-zinc-100"},le={class:""},ie={class:"bg-white"},re={class:"flex max-w-6xl mx-auto px-4 sm:px-0 items-center justify-between mb-4 sm:mb-8 border-b border-gray-200"},ce={key:0,class:"text-center py-12"},de={class:"text-gray-500"},ue={key:1,class:"text-center py-12"},me={class:"text-gray-500 text-lg"},pe={key:2,class:"news-timeline max-w-6xl mx-auto px-4"},ge=["onClick"],he={class:"flex sm:hidden w-full items-center mb-3"},ve={class:"flex-shrink-0 date-bg rounded-xl px-3 py-2 mr-3"},fe={class:"text-center"},xe={class:"text-2xl font-bold text-secondary-600 leading-none"},_e={class:"text-xs text-secondary-600 mt-1"},be={key:0,class:"flex-1 min-w-0 h-20 rounded overflow-hidden"},ye=["src"],we={class:"hidden sm:block flex-shrink-0 w-20 mr-8 h-full date-bg rounded-2xl"},ke={class:"text-center"},Ce={class:"text-4xl mt-6 font-bold text-secondary-600 leading-none"},Se={class:"text-base text-secondary-600 mt-2 mb-6"},Ae={class:"flex-1 min-w-0 sm:mr-6"},Pe={class:"text-base sm:text-lg font-medium text-gray-900 mb-2 sm:mb-3 group-hover:text-secondary-600 transition-colors leading-tight"},De={class:"flex items-center text-xs text-gray-500 space-x-4 mt-1 sm:mt-2 mb-1 sm:mb-2"},Ne=["innerHTML"],$e={class:"hidden sm:block flex-shrink-0 w-[200px] h-24"},Ie={class:"w-full h-full bg-gradient-to-br from-blue-100 to-blue-200 rounded flex items-center justify-center group-hover:scale-105 transition-transform duration-300 overflow-hidden"},Me=["src"],ze={key:3,class:"mt-8 sm:mt-12 pb-8 sm:pb-12 flex justify-center sm:justify-end max-w-6xl mx-auto px-4"},Te={class:"flex items-center space-x-1 flex-wrap justify-center"},qe=["disabled"],Fe=["onClick"],Le={key:1,class:"px-2 text-gray-400"},Ve=["disabled"],je=W({__name:"index",setup(Be){const{t:p,locale:F}=X(),_=J(),P=(t,e)=>{if(!t)return"";const o=F.value.toLowerCase().startsWith("en")?"En":"Zh",l=e+o,n=e+"Zh",m=t[l];if(m!=null&&m!=="")return String(m);const x=t[n];return x!=null&&x!==""?String(x):""},L=I(()=>[{id:"news",label:p("breadcrumb.news")},{id:"notice",label:p("navigation.announcements")}]),h=u("news");K({title:p("news.title")+" - "+p("header.site_name"),meta:[{name:"description",content:p("news.subtitle")},{name:"keywords",content:"æ°é»èµè®¯,æè²æ°é»,å½é
æè²,ååå¦é¢,æå交æµ,æè²åä½"}]});const g=O(),b=Q(),V=parseInt(g.query.page)||1,y=u(!1),w=u(""),k=u(""),D=u("latest"),v=u([]),a=u({page:V,pageSize:10,total:0,totalPages:0}),j=u([{id:"1",name:"åºéä¼å¨æ",slug:"foundation",createdAt:"",updatedAt:""},{id:"2",name:"ååå¦é¢",slug:"confucius",createdAt:"",updatedAt:""},{id:"3",name:"æè²åä½",slug:"cooperation",createdAt:"",updatedAt:""},{id:"4",name:"æå交æµ",slug:"culture",createdAt:"",updatedAt:""},{id:"5",name:"妿¯ç ç©¶",slug:"research",createdAt:"",updatedAt:""}]);I(()=>({keyword:w.value,category:k.value,page:a.value.page,pageSize:a.value.pageSize,sortBy:D.value}));const B=(t,e)=>t<1?1:t>e&&e>0?e:t,f=async()=>{y.value=!0;try{const t={keyword:w.value,category:k.value,pageNum:a.value.page,pageSize:a.value.pageSize,sortBy:D.value};try{const e=await U.getNewsList(t);if(console.log(e,"---"),v.value=(e==null?void 0:e.rows)||[],(e==null?void 0:e.rows.length)>0){a.value.total=e.total||0,a.value.totalPages=Math.ceil(a.value.total/a.value.pageSize);const o=B(a.value.page,a.value.totalPages);o!==a.value.page&&(a.value.page=o,b.replace({query:{...g.query,page:o.toString()}}))}}catch(e){console.warn("APIè°ç¨å¤±è´¥ï¼ä½¿ç¨æ¨¡ææ°æ®:",e),v.value=H(),a.value.total=45,a.value.totalPages=Math.ceil(a.value.total/a.value.pageSize)}}catch(t){console.error("Failed to fetch news:",t)}finally{y.value=!1}},H=()=>{const t=j.value[0];return[{id:"1",title:'ä¸å½å½é
䏿æè²åºéä¼"ææå±ç¤ºå¦ä¼"项ç®',summary:'为è¿ä¸æ¥æ¨è¿ä¸ææå交æµï¼æ°å"ä¸å¸¦ä¸è·¯"å¡è®®ä¸ä¸ææè²åºéä¼åä½å¼å±ä¸ææè²åºéä¼ï¼å¼å±å¦æ¯äº¤æµæ´»å¨çéè¦ä¸¾æªã
1éè¿å¦æ¯äº¤æµä¸ä¸ææè²åºéä¼åä½ï¼è®©æ´å¤å¦è
äºè§£ä¸æã',publishDate:"2022-08-18",viewCount:1250,newsId:1},{id:"2",title:"å¼å±ä»¥ä¸æä¸ºä¸»è¦åªä»çåæ°æ§å¦ç§å»ºè®¾çæ°å¦ç§ç 项ç®",summary:'为è¿ä¸æ¥æ¨è¿ä¸ææå交æµï¼æ°å"ä¸å¸¦ä¸è·¯"å¡è®®ä¸ä¸ææè²åºéä¼åä½å¼å±ä¸ææè²åºéä¼ï¼å¼å±å¦æ¯äº¤æµæ´»å¨çéè¦ä¸¾æªãéè¿å¦æ¯äº¤æµä¸ä¸ææè²åºéä¼åä½ï¼è®©æ´å¤å¦è
äºè§£ä¸æã',publishDate:"2022-08-15",viewCount:980,newsId:2},{id:"3",title:"ææç§é¨å¤è¨æ¿åºå·¥ä½è
代表å¢è®¿é®ä¸å½å½é
䏿æè²åºéä¼",summary:'为è¿ä¸æ¥æ¨è¿ä¸ææå交æµï¼æ°å"ä¸å¸¦ä¸è·¯"å¡è®®ä¸ä¸ææè²åºéä¼åä½å¼å±ä¸ææè²åºéä¼ï¼å¼å±å¦æ¯äº¤æµæ´»å¨çéè¦ä¸¾æªãéè¿å¦æ¯äº¤æµä¸ä¸ææè²åºéä¼åä½ï¼è®©æ´å¤å¦è
äºè§£ä¸æã',publishDate:"2022-08-13",viewCount:756,newsId:3},{id:"4",title:"ä¸å½å½é
䏿æè²åºéä¼å¯çäºé¿çè³è³è®¿é®é¿æ ¹å»·ç½è¨é奥",summary:'为è¿ä¸æ¥æ¨è¿ä¸ææå交æµï¼æ°å"ä¸å¸¦ä¸è·¯"å¡è®®ä¸ä¸ææè²åºéä¼åä½å¼å±ä¸ææè²åºéä¼ï¼å¼å±å¦æ¯äº¤æµæ´»å¨çéè¦ä¸¾æªãéè¿å¦æ¯äº¤æµä¸ä¸ææè²åºéä¼åä½ï¼è®©æ´å¤å¦è
äºè§£ä¸æã',publishDate:"2022-08-10",viewCount:1120,newsId:4},{id:"5",title:'ä¸å½å½é
䏿æè²åºéä¼"ææå±ç¤ºå¦ä¼"项ç®',summary:'为è¿ä¸æ¥æ¨è¿ä¸ææå交æµï¼æ°å"ä¸å¸¦ä¸è·¯"å¡è®®ä¸ä¸ææè²åºéä¼åä½å¼å±ä¸ææè²åºéä¼ï¼å¼å±å¦æ¯äº¤æµæ´»å¨çéè¦ä¸¾æªãéè¿å¦æ¯äº¤æµä¸ä¸ææè²åºéä¼åä½ï¼è®©æ´å¤å¦è
äºè§£ä¸æã',publishDate:"2022-08-08",viewCount:890,newsId:5}].map(o=>({...o,content:"",coverImage:`/images/news/news-${Math.floor(Math.random()*4)+1}.jpg`,author:"News Center",category:t,tags:["ååå¦é¢","å½é
æè²"],isPublished:!0,isFeatured:!1,slug:`news-${o.id}`,createdAt:o.publishDate,updatedAt:o.publishDate}))},C=t=>{a.value.page=t,b.push({query:{...g.query,page:t.toString()}}),f(),window.scrollTo({top:0,behavior:"smooth"})},R=t=>{const e=a.value.page;b.push({path:_(`/news/${t.newsId}`),query:{from:"news",page:e.toString()}})},N=t=>{const e=new Date(t);return String(e.getDate()).padStart(2,"0")},$=t=>{const e=new Date(t),o=e.getFullYear(),l=String(e.getMonth()+1).padStart(2,"0");return`${o}-${l}`},E=t=>new Date(t).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\//g,"-"),Y=()=>{const t=a.value.page,e=a.value.totalPages,o=[];if(e<=7)for(let l=1;l<=e;l++)o.push(l);else if(t<=4){for(let l=1;l<=5;l++)o.push(l);o.push("..."),o.push(e)}else if(t>=e-3){o.push(1),o.push("...");for(let l=e-4;l<=e;l++)o.push(l)}else{o.push(1),o.push("...");for(let l=t-1;l<=t+1;l++)o.push(l);o.push("..."),o.push(e)}return o};return ee(()=>{f()}),S(()=>g.query,t=>{t.category&&(k.value=t.category),t.q&&(w.value=t.q),f()},{immediate:!0}),S(()=>g.query.page,t=>{if(t){const e=parseInt(t);e!==a.value.page&&e>0&&(a.value.page=e,f())}},{immediate:!1}),S(h,t=>{t==="news"?q(_("/news")):t==="notice"&&q(_("/notice"))}),(t,e)=>{const o=Z,l=G;return d(),r("div",oe,[M(o,{"title-image":"/images/news/title.png",alt:"æ°é»å¨æ","background-image":"/images/news/banner.png"}),s("section",ne,[s("div",le,[s("div",ie,[s("div",re,[M(l,{items:c(L),modelValue:c(h),"onUpdate:modelValue":e[0]||(e[0]=n=>te(h)?h.value=n:null),class:"flex space-x-4 sm:space-x-8 py-3 sm:py-4"},null,8,["items","modelValue"])])]),c(y)?(d(),r("div",ce,[e[3]||(e[3]=s("div",{class:"loading-spinner mx-auto mb-4"},null,-1)),s("p",de,i(t.$t("common.loading")),1)])):c(v).length===0?(d(),r("div",ue,[e[4]||(e[4]=s("svg",{class:"w-16 h-16 text-gray-300 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("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)),s("p",me,i(t.$t("common.no_news")),1)])):(d(),r("div",pe,[(d(!0),r(A,null,T(c(v),n=>(d(),r("div",{key:n.newsId,class:"news-item rounded-xl bg-white flex flex-col sm:flex-row items-start mb-4 sm:mb-8 p-4 sm:p-8 border-2 border-gray-100 cursor-pointer group hover:border-secondary-600",onClick:m=>R(n)}
1,[s("div",he,[s("div",ve,[s("div",fe,[s("div",xe,i(N(n.publishTime)),1),s("div",_e,i($(n.publishTime)),1)])]),n.webCover?(d(),r("div",be,[s("img",{src:n.webCover,alt:"",class:"w-full h-full object-cover"},null,8,ye)])):z("",!0)]),s("div",we,[s("div",ke,[s("div",Ce,i(N(n.publishTime)),1),s("div",Se,i($(n.publishTime)),1)])]),s("div",Ae,[s("h3",Pe,i(P(n,"title")),1),s("div",De,[s("span",null,i(t.$t("common.creating_time"))+"ï¼"+i(E(n.publishTime)),1)]),s("p",{class:"text-gray-600 text-sm leading-relaxed mb-2 sm:mb-4 line-clamp-2 sm:line-clamp-none",innerHTML:P(n,"description")},null,8,Ne)]),s("div",$e,[s("div",Ie,[s("img",{src:n.webCover,alt:"",class:"w-full h-full object-cover"},null,8,Me)])])],8,ge))),128))])),c(a).totalPages>1?(d(),r("div",ze,[s("div",Te,[s("button",{onClick:e[1]||(e[1]=n=>C(c(a).page-1)),disabled:c(a).page<=1,class:"px-3 py-2 text-sm text-gray-600 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"},i(t.$t("common.previous_page")),9,qe),(d(!0),r(A,null,T(Y(),n=>(d(),r(A,{key:n},[n!=="..."?(d(),r("button",{key:0,onClick:m=>C(Number(n)),class:se(["w-8 h-8 text-sm rounded flex items-center justify-center",n===c(a).page?"bg-orange-500 text-white":"text-gray-600 hover:bg-gray-100"])},i(n),11,Fe)):(d(),r("span",Le,i(n),1))],64))),128)),s("button",{onClick:e[2]||(e[2]=n=>C(c(a).page+1)),disabled:c(a).page>=c(a).totalPages,class:"px-3 py-2 text-sm text-gray-600 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"},i(t.$t("common.next_page")),9,Ve)])])):z("",!0)])])])}}}),Xe=ae(je,[["__scopeId","data-v-9cdb81cf"]]);export{Xe 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.