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-1d4a9afa.js";import{M}from"./index-575d1b2d.js";import{M as k}from"./index-6b314488.js";import{S as I,s}from"./skeletion-index-modal-f26dfd49.js";import{D as T}from"./drop-down-modal-3282bbb5.js";import{i as N}from"./icon-teacher-default-a5bec550.js";import{M as x}from"./index-8fc031c0.js";import{t as n,o as u}from"./constant-a400d214.js";import{D as R,a as h}from"./index-ab43c325.js";import{C as V}from"./index-a27d7671.js";import{I as E}from"./index-c272bcfa.js";import"./index-dbc03ded.js";import"./index-fc00eb76.js";import"./index-6d1e9935.js";import"./index-22c9ea74.js";import"./use-tab-status-a36febbc.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};
|