index-b547dbbf.js 3.7 KB

1
  1. import{d as v,i as d,O as C,o as w,g as a,R as g,h as c,T as y,N as A,a as D}from"./index-071fe22e.js";import{M}from"./index-6e946af3.js";import{M as k}from"./index-9eb775de.js";import{S as I,s}from"./skeletion-index-modal-be58582a.js";import{D as T}from"./drop-down-modal-0acf6951.js";import{i as N}from"./icon-teacher-default-a5bec550.js";import{M as x}from"./index-627a2934.js";import{t as n,o as u}from"./constant-a400d214.js";import{D as R,a as h}from"./index-e9165e94.js";import{C as V}from"./index-02fc6d53.js";import{I as E}from"./index-71c05002.js";import"./index-df3b588b.js";import"./index-ba01ad91.js";import"./index-031935fc.js";import"./index-119ece69.js";import"./use-tab-status-9f8207e0.js";const X=v({name:"teacher-attendance",setup(){const m=d(),o=d(),f=A(),t=C({listState:{loading:!0,dataShow:!0,refreshing:!1},statusColumns:[{text:"全部状态",value:""}],classColumns:[{text:"全部班级",value:""}],isClick:!1,params:{teacherAttendanceStatus:"",classType:"",search:""},list:[]}),i=e=>{e.value&&e.value.toggle()},S=e=>{if(e==="orchestra"){let l="";return t.classColumns.forEach(p=>{t.params.classType===p.value&&(l=p.text)}),l}},r=async()=>{try{if(t.isClick)return;t.isClick=!0;const{data:e}=await D.post("/api-web/schoolTeacherAttendance/queryTeacherAttendance",{data:{...t.params}}),l=e||[];if(t.list.length>0&&l.pageNo===1)return;t.list=l||[]}catch(e){}finally{t.listState.dataShow=t.list.length>0,t.listState.refreshing=!1,t.listState.loading=!1,t.isClick=!1}};return w(()=>{for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const l=n[e];t.statusColumns.push({text:l,value:e})}for(const e in u)if(Object.prototype.hasOwnProperty.call(u,e)){const l=u[e];t.classColumns.push({text:l,value:e})}r()}),()=>a("div",{class:s.teacherAttendance},[a(k,{position:"top"},{default:()=>[a(g,null,null),a(M,{placeholder:"请输入老师姓名",onSearch:e=>{t.params.search=e,t.listState.dataShow=!0,t.list=[],r()}},null),a(R,null,{default:()=>[a(h,{ref:m,modelValue:t.params.teacherAttendanceStatus,"onUpdate:modelValue":e=>t.params.teacherAttendanceStatus=e,options:t.statusColumns,onChange:()=>{t.listState.dataShow=!0,t.list=[],r()}},null),a(h,{ref:o,title:S("orchestra")},{default:()=>[a(T,{selectValues:t.params.classType,columns:t.classColumns,open:o.value.state.showPopup,onDropDownClose:()=>i(o),onDropDownConfirm:e=>{t.params.classType=e[0],i(o),t.listState.dataShow=!0,t.list=[],r()}},null)]})]})]}),a(I,{show:t.listState.loading,"onUpdate:show":e=>t.listState.loading=e},{default:()=>[a(x,{modelValue:t.listState.refreshing,"onUpdate:modelValue":e=>t.listState.refreshing=e,onRefresh:()=>r(),style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[a("div",{class:s.cellGroup},[t.listState.dataShow?t.list.map(e=>a(V,{center:!0,isLink:!0,clickable:!1,class:s.cell,onClick:()=>{f.push({path:"/teacher-attendance-detail",query:{teacherId:e.teacherId,classGroupId:e.classGroupId}})}},{icon:()=>a(E,{src:e.teacherAvatar||N,fit:"cover",class:s.iconTeacher},null),title:()=>a("div",{class:s.username},[a("p",{class:s.name},[e.teacherName]),a("p",{class:s.class},[e.classGroupName])]),value:()=>a("div",{class:s.attendance},[a("div",{class:[s.attendanceItem,s.weekAttendance]},[a("p",{class:[s.value,e.teacherAttendanceStatus==="ERR"?s.error:"",e.teacherAttendanceStatus==="NORMAL"?s.success:""]},[n[e.teacherAttendanceStatus]||"--"]),a("p",{class:s.title},[c("本周考勤")])]),a("div",{class:[s.attendanceItem,s.classAttendance]},[a("p",{class:[s.value,e.errCourseNum>0?s.error:s.success]},[e.errCourseNum,a("span",null,[c("课时")])]),a("p",{class:s.title},[c("学期异常")])])])})):a(y,{style:{minHeight:"calc(100vh - var(--header-height))"},description:"暂无老师考勤"},null)])]})]})])}});export{X as default};