import{d,ag as u,r as m,$ as p,c as a,a5 as h,ai as f,ak as _,m as g,f as S}from"./index.ffe80dbe.js";import{O as C}from"./index.a0ef77e4.js";import{O as T}from"./index.c7af3af2.js";import{O as y}from"./index.4ddd16f0.js";import{i as v}from"./icon_teacher.df08d662.js";import{O}from"./index.45b38760.js";import{m as k}from"./index.931cf0b8.js";import{O as x}from"./index.6daa5b04.js";import{L as I}from"./index.cafcb8b5.js";import{C as w}from"./index.ea031708.js";import{I as L}from"./index.7e972106.js";import"./index.1d5c6f70.js";import"./index.92ec0bf4.js";import"./index.84851ef1.js";import"./use-tab-status.5a3cd090.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",E="_codeContainer_1u71i_38",R="_codeImg_1u71i_38",j="_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:E,codeImg:R,codeContent:j,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]"&&!_(i)}var ue=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 g.post("/api-school/schoolStaff/page",{data:{...e.params,schoolId:S.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(C,{border:!1},{right:()=>a(h,{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(O,{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:""]},[k[t.status]])})))?o:{default:()=>[o]})]}):a(f,{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{ue as default};