1import{_ as W}from"./I7pChOUJ.js";import{d as b,r as l,L,o as M,N as S,v as c,x as i,y as d,ak as E,aV as R,E as u,a0 as j,z as C,I as q,A,F as B,C as F,P as _,D as I}from"./BMN2TF57.js";import{_ as P}from"./DlAUqK2U.js";import"./Dvz-EoXG.js";import"./CWshvhv0.js";import"./D9eyxN6n.js";import"./D-fNHCiE.js";import"./CQVM4fOa.js";const z={class:"search-page-wrapper"},U={class:"search"},G={key:0,class:"result-info"},H={class:"content"},J={key:1,class:"loading-container"},K={key:1,class:"no-more"},O=b({__name:"index",setup(Q){const p=l([]),k=L(),o=l(k.query.k),y=l(""),v=l(),f=l(!0),h=l(!1),w=l(1),g=l("");function D(){o.value&&(w.value=1,f.value=!0,_.news.searchNews({channelId:g.value,keyword:o.value,pageNum:1}).then(([s])=>{v.value=s,y.value=o.value,s.status==="200"&&(s.list=s.list.filter(e=>{var t;return((t=e==null?void 0:e.data)==null?void 0:t.contentType)!==20}),s.list=s.list.filter(e=>{var a,n;if(((a=e==null?void 0:e.data)==null?void 0:a.linkType)!==1)return!0;const t=(n=e==null?void 0:e.data)==null?void 0:n.url;return!(!t||typeof t!="string"||!t.startsWith("http://")&&!t.startsWith("https://"))}),p.value=s.list)}))}const V=async()=>{var s;if(!(h.value||!f.value))try{h.value=!0,w.value+=1;const e=await _.news.searchNews({channelId:g.value,keyword:o.value,pageNum:w.value});let t=((s=e[0])==null?void 0:s.list)||[];if(!t||t.length===0){console.warn("No news data available in response:",e),f.value=!1;return}t=t.filter(a=>{var n;return((n=a==null?void 0:a.data)==null?void 0:n.contentType)!==20}),t=t.filter(a=>{var r,T;if(((r=a==null?void 0:a.data)==null?void 0:r.linkType)!==1)return!0;const n=(T=a==null?void 0:a.data)==null?void 0:T.url;return!(!n||typeof n!="string"||!n.startsWith("http://")&&!n.startsWith("https://"))}),p.value=p.value.concat(t)}catch(e){console.error("Error fetching more news:",e),f.value=!1}finally{h.value=!1}};async function N(s){const[e]=await _.news.searchNews({channelId:s,keyword:o.value,pageNum:1});e.list=e.list.filter(t=>{var a;return((a=t==null?void 0:t.data)==null?void 0:a.contentType)!==20}),e.list=e.list.filter(t=>{var n,r;if(((n=t==null?void 0:t.data)==null?void 0:n.linkType)!==1)return!0;const a=(r=t==null?void 0:t.data)==null?void 0:r.url;return!(!a||typeof a!="string"||!a.startsWith("http://")&&!a.startsWith("https://"))}),p.value=e.list,y.value=o.value,v.value=e}async function x(s){var t,a,n,r;I("websiteConfig"),I("websiteAppId");const[e]=await _.global.getClienttplData();console.log("resresres",e),g.value=(a=(t=e==null?void 0:e.json)==null?void 0:t.footList[0])==null?void 0:a.channelId,s&&s((r=(n=e==null?void 0:e.json)==null?void 0:n.footList[0])==null?void 0:r.channelId)}return M(()=>{console.log("onMountedonMounted"),x(s=>{N(s)})}),S(()=>k.query.k,s=>{s&&(o.value=s,x(e=>{N(e)}))},{immediate:!0}),(s,e)=>{const t=W;return c(),i("div",z,[d("div",U,[E(d("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>j(o)?o.value=a:null),class:"search-input",placeholder:"请è¾å
¥å
³é®å"},null,512),[[R,u(o)]]),d("div",{class:"search-btn",onClick:D},"æç´¢")]),u(v)?(c(),i("div",G," â"+C(u(y))+"âççæç´¢ç»æï¼å
±"+C(u(v).total)+"æ¡ ",1)):q("",!0),d("div",H,[A(t,{showTitleStyle:!0,items:u(p)},null,8,["items"]),u(f)?(c(),i("div",{key:0,class:"loadmore",onClick:V},[u(h)?(c(),i("div",J,e[1]||(e[1]=[d("span",null,"å è½½ä¸",-1),d("span",{id:"loader"},null,-1)]))):(c(),i(B,{key:0},[F("å è½½æ´å¤")],64))])):(c(),i("div",K,"æ²¡ææ´å¤äº"))])])}}}),se=P(O,[["__scopeId","data-v-da69c849"]]);export{se 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.