teacher-list.2bd9bdc5.js 3.7 KB

12
  1. import{d as _,r as h,Z as d,$ as y,c as t,q as g,ai as S,ak as w,m as b,f as k}from"./index.ffe80dbe.js";import{O as T}from"./index.a0ef77e4.js";import{O as j}from"./index.4ddd16f0.js";import{i as C}from"./icon_teacher.df08d662.js";import{O as I}from"./index.c7af3af2.js";import{L as v}from"./index.cafcb8b5.js";import{C as L}from"./index.914765a1.js";import{C as m}from"./index.ea031708.js";import{I as x}from"./index.7e972106.js";import{T as N}from"./index.55ba7429.js";const F="_cellTeacher_k4wyd_1",O="_img_k4wyd_1",E="_name_k4wyd_9",z="_subjectContainer_k4wyd_25",A="_tagSubject_k4wyd_32",V="_manageCell_k4wyd_39",q="_teacherContent_k4wyd_46",B="_content_k4wyd_51",H="_classNum_k4wyd_61",D="_num_k4wyd_65",G="_numText_k4wyd_71",M="_messageImg_k4wyd_76",R="_phone_k4wyd_94",W="_status_k4wyd_99",Z="_frozen_k4wyd_104";var n={cellTeacher:F,img:O,name:E,class:"_class_k4wyd_16",subjectContainer:z,tagSubject:A,manageCell:V,teacherContent:q,content:B,classNum:H,num:D,numText:G,messageImg:M,phone:R,status:W,frozen:Z};function f(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!w(s)}var oe=_({name:"teacher-list",props:{header:{type:Boolean,default:!0},mode:{type:String,default:"fixed"},courseType:{type:String,default:""},removeTeacherId:{type:String,default:""},subjectIdList:{type:Array,default:()=>[]}},emits:["close","select"],setup(s,{slots:$,attrs:J,emit:u}){const e=h({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,courseType:s.courseType,subjectIdList:s.subjectIdList,page:1,rows:20}}),r=async()=>{try{if(e.isLoad)return;e.isLoad=!0;const o=await b.post("/api-school/teacher/page",{data:{...e.params,schoolId:k.user.data.school.id,removeTeacherId:s.removeTeacherId,delFlag:!1}});e.listState.loading=!1;const a=o.data||{};if(e.list.length>0&&a.current===1)return;const l=a.rows||[];l.forEach(i=>{i.subjectNames=i.subjectName?i.subjectName.split(","):[]}),e.list=e.list.concat(l),e.listState.finished=a.current>=a.pages,e.params.page=a.current+1,e.listState.dataShow=e.list.length>0,e.isLoad=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isLoad=!1}},c=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,r()},p=o=>{u("close"),u("select",o)};return d(()=>s.courseType,()=>{e.params.courseType=s.courseType,c()}),d(()=>s.subjectIdList,()=>{e.params.subjectIdList=s.subjectIdList,c()}),d(()=>s.removeTeacherId,()=>{c()}),y(()=>{r()}),()=>{let o;return t("div",{class:!e.listState.dataShow&&"emptyRootContainer",style:{background:"#F8F8F8",minHeight:"100%"}},[t(j,{position:"top",mode:s.mode},{default:()=>[s.header&&t(T,{title:"\u9009\u62E9\u4F34\u5B66\u6307\u5BFC",border:!1},null),t(I,{placeholder:"\u4F34\u5B66\u6307\u5BFC\u540D\u79F0",onSearch:a=>{e.params.keyword=a,c()}},null)]}),e.listState.dataShow?t(v,{finished:e.listState.finished,finishedText:" ",onLoad:r,style:{paddingTop:"12px"},immediateCheck:!1},f(o=e.list.map(a=>t(L,{inset:!0,style:{marginBottom:"12px"},onClick:()=>p(a)},{default:()=>[t(m,{center:!0,class:n.manageCell,clickable:!1},{icon:()=>t(x,{class:n.img,src:a.avatar?a.avatar:C,fit:"cover"},null),title:()=>t("div",{class:n.teacherContent},[t("div",{class:n.content},[t("p",{class:[n.name,"van-ellipsis"]},[a.nickname])])])}),t(m,{center:!0},{title:()=>t("div",{class:n.subjectContainer},[t("span",null,[g("\u58F0\u90E8\uFF1A")]),t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[a.subjectNames&&a.subjectNames.length>0&&a.subjectNames.map(l=>t(N,{type:"primary",class:n.tagSubject,color:"#FFE7DA",textColor:"#F67146"},f(l)?l:{default:()=>[l]}))])])})]})))?o:{default:()=>[o]}):t(S,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u6307\u5BFC"},null)])}}});export{oe as T};