index-0a38c012.js 2.0 KB

1
  1. import{d as c,U as u,q as p,x as d,y as h,a as s,S as f,a0 as m,a1 as g,D as S}from"./index-fac4d009.js";import{M as _}from"./index-bbdb5913.js";import{M as C}from"./index-bc672952.js";import{L as b}from"./index-1621d131.js";import{C as y}from"./index-5cba6af7.js";import"./index-ff3fe408.js";import"./use-tab-status-5c9ad5e4.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",E="_time_14hbg_41",o={helpCenter:k,title:w,container:M,containerInformation:I,img:L,bgImg:q,content:x,time:E};function T(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!g(i)}const V=c({name:"help-center",setup(){const i=u(),r=p(),t=d({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 h(()=>{n()}),()=>{let e;return s("div",{class:[o.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(C,{position:"top"},{default:()=>[s(f,{border:!1},null),s(_,{onSearch:l},null)]}),t.listState.dataShow?s(b,{finished:t.listState.finished,finishedText:" ",class:o.container,onLoad:n,immediateCheck:!1},T(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(m,{description:"暂无数据"},null)])}}});export{V as default};