import{d as u,r as i,w as m,y as r,a as e,A as o,C as f,a8 as I}from"./index-7945cc5d.js";import{R,a as _}from"./index-0bf71090.js";import{I as A}from"./index-610eeac6.js";const g="_popupTitle_m5lxk_1",x="_selectStudent_m5lxk_9",S="_cell_m5lxk_15",B="_cellSelected_m5lxk_26",k="_iconImage_m5lxk_29",w="_userInfo_m5lxk_34",M="_userImg_m5lxk_39",v="_usernames_m5lxk_47",C="_name_m5lxk_47",b="_tag_m5lxk_53",h="_schoolname_m5lxk_62",p="_addStudentBtn_m5lxk_73",E="_iconAdd_m5lxk_76",s={popupTitle:g,selectStudent:x,cell:S,cellSelected:B,iconImage:k,userInfo:w,userImg:M,usernames:v,name:C,tag:b,schoolname:h,addStudentBtn:p,iconAdd:E},L="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAUVBMVEUAAAAAkP8Qif8Rif8Qif8Qiv8Rif8Si/8Ri/8Qif8Mhv8AgP8Qif8Rif8Rif8Rif8Rif8Riv8Rif8Rif8Rif8Ri/8Pi/8Piv8Sif8Rif8Rif8hmc1vAAAAGnRSTlMABfDY3MykZFM3FQn49+bEp5iKdWhYRCEc0czz7xoAAAEFSURBVDjLbJFZcsQgDAWF2GzjdbzN9P0PmkqwU5SZ/oRGTxJScm7Ba9+rD9spXzH7RMG0m9o5LOgc286Yro2zgj0eSlrAxVQcRAdLKp3OM6zmEb8O+K5wLGMrFe2I/beS5/OWL7w/+DtxYcxObY0s11wMd5ZpglW1oTF34sDxd2FZJdM4LlwjmRX7+2DHXe9eFLyu2o5dRCZi4VRWZBI50ZSzeJATk3LKxnzXfXB1MbNJIJaF6lKRIJ48f6Ai5C3gRcmbt1TY/Geo9ORopUJzs/Q/jdSxDQAACMOw/7/2C96RQLRJDdW6OrxeUM+sWCbgqkqVbuo7IBRSA+dgPsI49bzESocAjxMxyfVaThAAAAAASUVORK5CYII=",V="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAPFBMVEUAAADBwcHCwsLKysrBwcHCwsLBwcHBwcHCwsLCwsLBwcHBwcHBwcHCwsLDw8PCwsLCwsLDw8PMzMzBwcFj7DUOAAAAE3RSTlMA9mUG2aY3HhXP6+bKxJh1WEQKpOsVIgAAANRJREFUOMt8kEcOwkAQBCdtcgTX//+KMEEW2FvS3Gpa6pYjxVIbVIeWrMg5t5kD8+1EuQdoslzda7akEPcfxRcI2+TLZgGLH506oav//K3KVA9OMGb5I4/E1/KJdtqmNKZP/sJ40biMLO9eaJYLsvLqGKxyyUrsGxJ+LXnwXHXGpIMxixR060mbUsRI0iVh+/XYUxq5L2WaDNS+VBlE8b7k6KOROrYBAABhGPb/137BOxKINqmhWleH1wvqmRXLBFxVmdJVfQeEQmrgHMxHGKeel1jpEGjoDf1F7oGIAAAAAElFTkSuQmCC";function F(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!I(t)}const D=u({name:"select-student",props:{list:{type:Array,default:()=>[]},studentItem:{type:Object,default:()=>({})},showAdd:{type:Boolean,default:!0}},emits:["close","confirm"],setup(t,{emit:a}){const c=i();return m(()=>t.studentItem,()=>{t.studentItem&&t.studentItem.userId?c.value=t.studentItem.userId:c.value=null}),r(()=>{t.studentItem&&t.studentItem.userId&&(c.value=t.studentItem.userId)}),()=>{let n;return e("div",null,[e("div",{class:s.popupTitle},[o("选择学生")]),e(R,{class:s.selectStudent,modelValue:c.value,"onUpdate:modelValue":l=>c.value=l},F(n=t.list.map(l=>e("div",{class:[s.cell,c.value===l.userId&&s.cellSelected],onClick:()=>{c.value=l.userId,a("confirm",l),a("close")}},[e(_,{name:l.userId},{icon:d=>e(A,{class:s.iconImage,src:d.checked?L:V},null)}),e("div",{class:s.userInfo},[e(A,{src:l.avatar,class:s.userImg,fit:"cover"},null),e("div",{class:s.usernames},[e("div",{class:s.name},[l.nickname,!t.showAdd&&l.registerFlag&&e("span",{class:s.tag},null)]),l.schoolName&&e("div",{class:s.schoolname},[l.schoolName])])])])))?n:{default:()=>[n]}),t.showAdd&&e("div",{class:s.addStudentBtn},[e(f,{block:!0,color:"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",onClick:()=>{a("confirm",{})}},{default:()=>[e("i",{class:s.iconAdd},null),e("span",null,[o("新增学生")])]})])])}}});export{D as S};
