import{d,ag as u,r as m,$ as p,c as a,aj as h,a5 as f,ak as _,al as g,m as S,g as C}from"./index.28bb778f.js";import{O as T}from"./index.8323fc08.js";import{O as y}from"./index.82695db9.js";import{i as v}from"./icon_teacher.df08d662.js";import{O as k}from"./index.08f6aad4.js";import{m as O}from"./index.b28db9f5.js";import{O as x}from"./index.26391f0c.js";import{L as I}from"./index.4ac17938.js";import{C as w}from"./index.49de14a4.js";import{I as L}from"./index.7e0a75cb.js";import"./index.5332ff88.js";import"./index.a369baa0.js";import"./use-tab-status.c9f6a196.js";const B="_searchBand_1u71i_1",N="_manageCell_1u71i_7",P="_img_1u71i_10",b="_name_1u71i_17",z="_phone_1u71i_24",A="_status_1u71i_30",V="_frozen_1u71i_35",j="_codeContainer_1u71i_38",E="_codeImg_1u71i_38",R="_codeContent_1u71i_45",q="_codeTitle_1u71i_48",D="_codeName_1u71i_58",H="_codeQr_1u71i_64",Q="_codeBtnText_1u71i_77",K="_codeTips_1u71i_87",U="_close_1u71i_95",$="_codeBottom_1u71i_100",F="_title_1u71i_107",G="_shareImg_1u71i_122",M="_shareText_1u71i_126";var s={searchBand:B,manageCell:N,img:P,name:b,phone:z,status:A,frozen:V,codeContainer:j,codeImg:E,codeContent:R,codeTitle:q,codeName:D,codeQr:H,codeBtnText:Q,codeTips:K,close:U,codeBottom:$,title:F,shareImg:G,shareText:M};function J(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!g(i)}var ce=d({name:"companion-teacher",setup(){const i=u(),e=m({oPopover:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},statusText:"\u72B6\u6001",params:{keyword:null,status:null,page:1,rows:20},isClick:!1,actions:[{name:"\u5168\u90E8",id:"ALL",selected:!0},{name:"\u51BB\u7ED3",id:"LOCKED"},{name:"\u6B63\u5E38",id:"ACTIVATION"}]}),n=async()=>{try{if(e.isClick)return;e.isClick=!0;const o=await S.post("/api-school/schoolStaff/page",{data:{...e.params,schoolId:C.user.data.school.id}});e.listState.loading=!1,e.listState.refreshing=!1;const t=o.data||{};if(e.list.length>0&&t.current===1)return;e.list=e.list.concat(t.rows||[]),e.listState.finished=t.current>=t.pages,e.params.page=t.current+1,e.listState.dataShow=e.list.length>0,e.isClick=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.listState.refreshing=!1,e.isClick=!1}},l=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,n()},r=o=>{i.push({path:"/manage-teacher-detail",query:{id:o.id}})};return p(async()=>{n()}),()=>{let o;return a("div",{class:!e.listState.dataShow&&"emptyRootContainer"},[a(y,{position:"top",onGetHeight:t=>{e.listState.height=t}},{default:()=>[a(h,{border:!1},{right:()=>a(f,{name:"plus",size:19,onClick:()=>{i.push({path:"save-share-image",query:{type:"manage"}})}},null)}),a(T,{placeholder:"\u8BF7\u8F93\u5165\u7BA1\u7406\u8001\u5E08\u59D3\u540D",onSearch:t=>{console.log(t),e.params.keyword=t,l()}},{left:()=>a("div",{class:["searchItem-left",e.oPopover?"searchItem-active":""],onClick:()=>e.oPopover=!0},[a("span",null,[e.statusText])])})]}),e.listState.dataShow?a(k,{modelValue:e.listState.refreshing,"onUpdate:modelValue":t=>e.listState.refreshing=t,onRefresh:l,style:{minHeight:`calc(100vh - ${e.listState.height}px)`}},{default:()=>[a(I,{finished:e.listState.finished,finishedText:" ",class:[s.liveList],onLoad:n,style:{paddingTop:"12px"},immediateCheck:!1},J(o=e.list.map(t=>a(w,{center:!0,isLink:!0,class:s.manageCell,onClick:()=>r(t)},{icon:()=>a(L,{class:s.img,src:t.avatar?t.avatar:v},null),title:()=>a("div",{class:s.content},[a("p",{class:[s.name,"van-ellipsis"]},[t.nickname]),a("p",{class:s.phone},[t.phone])]),value:()=>a("span",{class:[s.status,t.status==="LOCKED"?s.frozen:""]},[O[t.status]])})))?o:{default:()=>[o]})]}):a(_,{btnStatus:!1,tips:"\u6682\u65E0\u7BA1\u7406\u8001\u5E08"},null),a(x,{show:e.oPopover,"onUpdate:show":t=>e.oPopover=t,actions:e.actions,onSelect:t=>{e.actions.forEach(c=>{c.selected=!1}),t.selected=!0,e.statusText=t.name,e.params.status=t.id==="ALL"?null:t.id,e.oPopover=!1,l()}},null)])}}});export{ce as default};
