index-5b2c425e.js 2.0 KB

1
  1. import{d as c,q as p,x as u,a as s,S as d,a0 as h,a1 as f,V as m,E as g,C as S}from"./index-a1bf1d15.js";import{M as _}from"./index-22636950.js";import{M as C}from"./index-f0e68d4e.js";import{L as b}from"./index-bfec3630.js";import{C as y}from"./index-e0238e8d.js";import"./index-599f5e7e.js";import"./use-tab-status-a66a826a.js";const k="_helpCenter_14hbg_1",w="_title_14hbg_1",M="_container_14hbg_6",I="_containerInformation_14hbg_12",L="_img_14hbg_12",q="_bgImg_14hbg_20",x="_content_14hbg_34",T="_time_14hbg_41",o={helpCenter:k,title:w,container:M,containerInformation:I,img:L,bgImg:q,content:x,time:T};function j(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!f(i)}const H=c({name:"help-center",setup(){const i=m(),r=g(),t=p({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,status:!0,page:1,rows:20}}),n=async()=>{try{if(t.isClick)return;t.isClick=!0;const e=await S.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}},l=e=>{t.params.keyword=e,t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,n()};return u(()=>{n()}),()=>{let e;return s("div",{class:[o.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(C,{position:"top"},{default:()=>[s(d,{border:!1},null),s(_,{onSearch:l},null)]}),t.listState.dataShow?s(b,{finished:t.listState.finished,finishedText:" ",class:o.container,onLoad:n,immediateCheck:!1},j(e=t.list.map(a=>s(y,{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(h,{description:"暂无数据"},null)])}}});export{H as default};