import{d as c,U as p,q as u,x as d,y as f,a as s,S as h,a0 as m,a1 as S,D as C}from"./index-971588a5.js";import{M as y}from"./index-1b54b9d7.js";import{M as g}from"./index-b5096637.js";import{s as o}from"./index.module-caa3742e.js";import{L as k}from"./index-b1d7c2d8.js";import{C as w}from"./index-a1fa647c.js";import"./index-0c6f164a.js";import"./use-tab-status-fddb4bf4.js";function M(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!S(i)}const R=c({name:"help-center",setup(){const i=p(),r=u(),t=d({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,status:!0,page:1,rows:20}}),l=async()=>{try{if(t.isClick)return;t.isClick=!0;const e=await C.post("/edu-app/helpCenterContent/page",{data:{...t.params,catalogType:"STUDENT"}});t.listState.loading=!1;const a=e.data||{};if(t.list.length>0&&a.current===1)return;t.list=t.list.concat(a.rows||[]),t.listState.finished=a.current>=a.pages,t.params.page=a.current+1,t.listState.dataShow=t.list.length>0,t.isClick=!1}catch(e){t.listState.dataShow=!1,t.listState.finished=!0,t.isClick=!1}},n=e=>{t.params.keyword=e,t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,l()};return f(()=>{l()}),()=>{let e;return s("div",{class:[o.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(g,{position:"top"},{default:()=>[s(h,{border:!1},null),s(y,{onSearch:n},null)]}),t.listState.dataShow?s(k,{finished:t.listState.finished,finishedText:" ",class:o.container,onLoad:l,immediateCheck:!1},M(e=t.list.map(a=>s(w,{titleClass:[o.title,"van-ellipsis"],title:a.title,isLink:!0,onClick:()=>{r.push({path:"help-detail",query:{id:a.id,source:i.query.source}})}},null)))?e:{default:()=>[e]}):s(m,{description:"暂无数据"},null)])}}});export{R as default};
