import{_ as v}from"./items.vue_vue_type_script_setup_true_lang.1931f4cd.js";import{a as E,by as A,W as c,f as D,w as B,N as q,o as a,h as o,i as m,u as e,t as l,aj as C,p as N,I as z,ba as F,j as y,bz as b,c as S}from"./entry.49b00e51.js";import{u as j}from"./asyncData.c6aabeab.js";import{a as I,e as V}from"./empty_news.b72a5822.js";import{g as $}from"./news.8419498b.js";import{E as L}from"./index.13415be7.js";import"./debounce.66907efb.js";import"./index.f418b033.js";import"./index.6ac3a200.js";import"./_getTag.cf814d7e.js";const T={class:"min-h-full flex flex-col"},U={class:"text-4xl mb-5"},P={key:0},R={key:1},W={key:0,class:"bg-white px-5 rounded overflow-hidden"},Y={key:0,class:"pt-5 text-tx-secondary"},G={class:"py-4 flex justify-end"},H={key:1,class:"flex-1 flex justify-center items-center"},re=E({__name:"index",async setup(J){let r,d;const t=A(),_=c(()=>t.params.source=="search"?"":t.params.source),g=c(()=>t.query.keywords||""),f=c(()=>t.query.cid||""),i=D({pageNo:1,pageSize:15,keyword:g,cid:f,sort:_}),{data:n,refresh:p,pending:h}=([r,d]=B(()=>j(()=>$(i),{initialCache:!1},"$ewxCUYuASd")),r=await r,d(),r),k=c(()=>{switch(t.params.source){case"hot":return"\u70ED\u95E8\u8D44\u8BAF";case"new":return" \u6700\u65B0\u8D44\u8BAF";default:return"\u5168\u90E8\u8D44\u8BAF"}});return q([()=>t.query.keywords,()=>t.query.cid],()=>{p()}),(K,u)=>{const w=v,x=b("loading");return a(),o("div",T,[m("div",U,[e(t).query.keywords?(a(),o("span",P,' \u67E5\u627E"'+l(e(t).query.keywords)+'" ',1)):(a(),o("span",R,l(e(t).query.name||e(k)),1))]),C((a(),o("div",null,[e(n).lists.length?(a(),o("div",W,[e(t).query.keywords?(a(),o("div",Y," \u4E3A\u60A8\u627E\u5230\u76F8\u5173\u7ED3\u679C "+l(e(n).count)+"\u4E2A ",1)):N("",!0),(a(!0),o(z,null,F(e(n).lists,s=>(a(),S(w,{key:s.id,id:s.id,title:s.title,desc:s.intro,click:s.visit,author:s.author,"create-time":s.createTime,image:s.image,"only-title":!1},null,8,["id","title","desc","click","author","create-time","image"]))),128)),m("div",G,[y(e(L),{"current-page":i.pageNo,"onUpdate:current-page":u[0]||(u[0]=s=>i.pageNo=s),total:e(n).count,"page-size":i.pageSize,"hide-on-single-page":"",onCurrentChange:u[1]||(u[1]=s=>e(p)())},null,8,["current-page","total","page-size"])])])):(a(),o("div",H,[y(e(I),{image:e(V),description:"\u6682\u65E0\u8D44\u8BAF","image-size":250},null,8,["image"])]))])),[[x,e(h)]])])}}});export{re as default};
